From f2714010aae802af5da8ffb3370d9c6a3c567391 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 28 Apr 2025 23:47:33 +0000 Subject: [PATCH] CodeGen from PR 33973 in Azure/azure-rest-api-specs Merge d1a9c9273c94a765419d61af7a5ed523f717a7e9 into b5645320db76184396eec256649f0475bfd31e24 --- .../tsp-location.yaml | 7 +- .../api/Azure.ResourceManager.Chaos.net8.0.cs | 222 +- ...re.ResourceManager.Chaos.netstandard2.0.cs | 222 +- .../Sample_ChaosCapabilityCollection.cs | 20 +- ...ample_ChaosCapabilityMetadataCollection.cs | 160 + .../Sample_ChaosCapabilityMetadataResource.cs | 49 + .../Samples/Sample_ChaosCapabilityResource.cs | 12 +- .../Sample_ChaosExperimentCollection.cs | 50 +- ...mple_ChaosExperimentExecutionCollection.cs | 16 +- ...Sample_ChaosExperimentExecutionResource.cs | 8 +- .../Samples/Sample_ChaosExperimentResource.cs | 26 +- .../Samples/Sample_ChaosTargetCollection.cs | 37 +- .../Sample_ChaosTargetMetadataCollection.cs | 157 + .../Sample_ChaosTargetMetadataResource.cs | 48 + .../Samples/Sample_ChaosTargetResource.cs | 26 +- .../Sample_SubscriptionResourceExtensions.cs | 7 +- .../src/Generated/ArmChaosModelFactory.cs | 73 +- .../Generated/ChaosCapabilityCollection.cs | 44 +- ...s => ChaosCapabilityMetadataCollection.cs} | 162 +- ...osCapabilityMetadataData.Serialization.cs} | 94 +- ...Data.cs => ChaosCapabilityMetadataData.cs} | 29 +- ...apabilityMetadataResource.Serialization.cs | 26 + ....cs => ChaosCapabilityMetadataResource.cs} | 76 +- .../src/Generated/ChaosCapabilityResource.cs | 24 +- ...aosCapabilityTypeResource.Serialization.cs | 26 - .../Generated/ChaosExperimentCollection.cs | 40 +- .../ChaosExperimentData.Serialization.cs | 6 +- .../src/Generated/ChaosExperimentData.cs | 4 +- .../ChaosExperimentExecutionCollection.cs | 78 +- .../ChaosExperimentExecutionResource.cs | 42 +- .../src/Generated/ChaosExperimentResource.cs | 64 +- .../src/Generated/ChaosTargetCollection.cs | 46 +- .../ChaosTargetData.Serialization.cs | 32 +- .../src/Generated/ChaosTargetData.cs | 10 +- ...on.cs => ChaosTargetMetadataCollection.cs} | 166 +- ... ChaosTargetMetadataData.Serialization.cs} | 54 +- ...TypeData.cs => ChaosTargetMetadataData.cs} | 16 +- ...aosTargetMetadataResource.Serialization.cs | 26 + ...urce.cs => ChaosTargetMetadataResource.cs} | 108 +- .../src/Generated/ChaosTargetResource.cs | 32 +- .../ChaosTargetTypeResource.Serialization.cs | 26 - .../Generated/Extensions/ChaosExtensions.cs | 255 +- .../Extensions/MockableChaosArmClient.cs | 48 +- .../MockableChaosResourceGroupResource.cs | 118 +- .../MockableChaosSubscriptionResource.cs | 56 +- .../CapabilityListResult.Serialization.cs | 37 +- .../Generated/Models/CapabilityListResult.cs | 26 +- .../CapabilityTypeListResult.Serialization.cs | 43 +- .../Models/CapabilityTypeListResult.cs | 28 +- ...etadataRuntimeProperties.Serialization.cs} | 38 +- ...aosCapabilityMetadataRuntimeProperties.cs} | 10 +- .../ChaosContinuousAction.Serialization.cs | 12 +- .../Generated/Models/ChaosContinuousAction.cs | 8 +- .../Models/ChaosDelayAction.Serialization.cs | 12 +- .../src/Generated/Models/ChaosDelayAction.cs | 8 +- .../ChaosDiscreteAction.Serialization.cs | 12 +- .../Generated/Models/ChaosDiscreteAction.cs | 8 +- .../ChaosExperimentAction.Serialization.cs | 4 +- .../Generated/Models/ChaosExperimentAction.cs | 10 +- .../ChaosExperimentPatch.Serialization.cs | 34 +- .../Generated/Models/ChaosExperimentPatch.cs | 14 +- .../Models/ChaosProvisioningState.cs | 12 +- .../Models/ChaosTargetFilter.Serialization.cs | 2 +- .../src/Generated/Models/ChaosTargetFilter.cs | 10 +- .../ChaosTargetListSelector.Serialization.cs | 35 +- .../Models/ChaosTargetListSelector.cs | 10 +- .../ChaosTargetQuerySelector.Serialization.cs | 37 +- .../Models/ChaosTargetQuerySelector.cs | 10 +- .../Models/ChaosTargetReferenceType.cs | 2 +- .../ChaosTargetSelector.Serialization.cs | 19 +- .../Generated/Models/ChaosTargetSelector.cs | 78 +- .../Models/ChaosTargetSimpleFilter.cs | 8 +- .../Generated/Models/ExperimentActionType.cs | 54 + ...onTargetDetailsProperties.Serialization.cs | 36 +- ...xperimentExecutionDetails.Serialization.cs | 4 +- .../Models/ExperimentExecutionDetails.cs | 4 +- ...PropertiesRunInformation.Serialization.cs} | 38 +- ...ecutionDetailsPropertiesRunInformation.cs} | 10 +- ...rimentExecutionListResult.Serialization.cs | 37 +- .../Models/ExperimentExecutionListResult.cs | 26 +- .../ExperimentListResult.Serialization.cs | 37 +- .../Generated/Models/ExperimentListResult.cs | 26 +- .../src/Generated/Models/FilterType.cs | 2 +- .../src/Generated/Models/SelectorType.cs | 4 +- .../Models/TargetListResult.Serialization.cs | 37 +- .../src/Generated/Models/TargetListResult.cs | 26 +- .../TargetTypeListResult.Serialization.cs | 43 +- .../Generated/Models/TargetTypeListResult.cs | 28 +- ...nownChaosExperimentAction.Serialization.cs | 12 +- .../Models/UnknownChaosExperimentAction.cs | 6 +- .../Models/UnknownChaosTargetFilter.cs | 6 +- ...nknownChaosTargetSelector.Serialization.cs | 35 +- .../Models/UnknownChaosTargetSelector.cs | 8 +- .../CapabilitiesRestOperations.cs | 264 +- .../CapabilityTypesRestOperations.cs | 176 +- .../ExperimentExecutionsRestOperations.cs | 423 ++ .../ExperimentsRestOperations.cs | 790 +--- .../TargetTypesRestOperations.cs | 176 +- .../RestOperations/TargetsRestOperations.cs | 260 +- .../src/autorest.md | 81 - .../tsp-location.yaml | 4 + .../tsp-location.yaml | 4 +- .../Sample_SubscriptionResourceExtensions.cs | 655 +++- .../ArmComputeScheduleModelFactory.cs | 93 + .../Extensions/ComputeScheduleExtensions.cs | 308 +- ...ableComputeScheduleSubscriptionResource.cs | 364 +- ...ResourceOperationResponse.Serialization.cs | 167 + .../Models/CreateResourceOperationResponse.cs | 94 + ...ResourceOperationResponse.Serialization.cs | 167 + .../Models/DeleteResourceOperationResponse.cs | 94 + .../ExecuteCreateContent.Serialization.cs | 145 + .../Generated/Models/ExecuteCreateContent.cs | 86 + .../ExecuteDeleteContent.Serialization.cs | 160 + .../Generated/Models/ExecuteDeleteContent.cs | 97 + .../ResourceProvisionPayload.Serialization.cs | 173 + .../Models/ResourceProvisionPayload.cs | 85 + .../SubmitCreateContent.Serialization.cs | 160 + .../Generated/Models/SubmitCreateContent.cs | 90 + .../SubmitDeleteContent.Serialization.cs | 174 + .../Generated/Models/SubmitDeleteContent.cs | 104 + .../ScheduledActionsRestOperations.cs | 378 +- .../tsp-location.yaml | 5 +- ...e.ResourceManager.DatabaseFleetManager.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 80 + ...urceManager.DatabaseFleetManager.net8.0.cs | 637 +++ ...ger.DatabaseFleetManager.netstandard2.0.cs | 637 +++ .../assets.json | 7 + ...anager.DatabaseFleetManager.Samples.csproj | 13 + .../Samples/Sample_FirewallRuleCollection.cs | 209 + .../Samples/Sample_FirewallRuleResource.cs | 120 + .../Samples/Sample_FleetCollection.cs | 204 + .../Samples/Sample_FleetDatabaseCollection.cs | 232 ++ .../Samples/Sample_FleetDatabaseResource.cs | 236 ++ .../Generated/Samples/Sample_FleetResource.cs | 118 + .../Samples/Sample_FleetTierCollection.cs | 213 + .../Samples/Sample_FleetTierResource.cs | 157 + .../Samples/Sample_FleetspaceCollection.cs | 211 + .../Samples/Sample_FleetspaceResource.cs | 186 + .../Sample_SubscriptionResourceExtensions.cs | 50 + ...esourceManager.DatabaseFleetManager.csproj | 8 + .../ArmDatabaseFleetManagerModelFactory.cs | 220 ++ .../DatabaseFleetManagerExtensions.cs | 295 ++ .../MockableDatabaseFleetManagerArmClient.cs | 97 + ...tabaseFleetManagerResourceGroupResource.cs | 105 + ...atabaseFleetManagerSubscriptionResource.cs | 102 + .../src/Generated/FirewallRuleCollection.cs | 499 +++ .../FirewallRuleData.Serialization.cs | 155 + .../src/Generated/FirewallRuleData.cs | 75 + .../FirewallRuleResource.Serialization.cs | 26 + .../src/Generated/FirewallRuleResource.cs | 348 ++ .../src/Generated/FleetCollection.cs | 500 +++ .../src/Generated/FleetData.Serialization.cs | 178 + .../src/Generated/FleetData.cs | 83 + .../src/Generated/FleetDatabaseCollection.cs | 501 +++ .../FleetDatabaseData.Serialization.cs | 155 + .../src/Generated/FleetDatabaseData.cs | 75 + .../FleetDatabaseResource.Serialization.cs | 26 + .../src/Generated/FleetDatabaseResource.cs | 617 +++ .../Generated/FleetResource.Serialization.cs | 26 + .../src/Generated/FleetResource.cs | 845 ++++ .../src/Generated/FleetTierCollection.cs | 499 +++ .../Generated/FleetTierData.Serialization.cs | 155 + .../src/Generated/FleetTierData.cs | 75 + .../FleetTierResource.Serialization.cs | 26 + .../src/Generated/FleetTierResource.cs | 423 ++ .../src/Generated/FleetspaceCollection.cs | 499 +++ .../Generated/FleetspaceData.Serialization.cs | 155 + .../src/Generated/FleetspaceData.cs | 75 + .../FleetspaceResource.Serialization.cs | 26 + .../src/Generated/FleetspaceResource.cs | 662 ++++ .../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 + .../DatabaseFleetManagerArmOperation.cs | 94 + .../DatabaseFleetManagerArmOperationOfT.cs | 100 + .../FirewallRuleOperationSource.cs | 36 + .../FleetDatabaseOperationSource.cs | 36 + .../FleetOperationSource.cs | 36 + .../FleetTierOperationSource.cs | 36 + .../FleetspaceOperationSource.cs | 36 + .../Models/AzureProvisioningState.cs | 60 + ...abaseChangeTierProperties.Serialization.cs | 129 + .../Models/DatabaseChangeTierProperties.cs | 65 + .../Generated/Models/DatabaseCreateMode.cs | 54 + .../Models/DatabaseIdentity.Serialization.cs | 163 + .../src/Generated/Models/DatabaseIdentity.cs | 74 + .../DatabaseRenameProperties.Serialization.cs | 129 + .../Models/DatabaseRenameProperties.cs | 65 + .../DestinationTierOverride.Serialization.cs | 142 + .../Models/DestinationTierOverride.cs | 88 + .../FirewallRuleListResult.Serialization.cs | 151 + .../Models/FirewallRuleListResult.cs | 80 + .../FirewallRuleProperties.Serialization.cs | 155 + .../Models/FirewallRuleProperties.cs | 73 + .../FleetDatabaseListResult.Serialization.cs | 151 + .../Models/FleetDatabaseListResult.cs | 80 + .../FleetDatabaseProperties.Serialization.cs | 366 ++ .../Models/FleetDatabaseProperties.cs | 126 + .../Models/FleetListResult.Serialization.cs | 151 + .../src/Generated/Models/FleetListResult.cs | 80 + .../Models/FleetPatch.Serialization.cs | 159 + .../src/Generated/Models/FleetPatch.cs | 70 + .../Models/FleetProperties.Serialization.cs | 144 + .../src/Generated/Models/FleetProperties.cs | 69 + .../FleetTierListResult.Serialization.cs | 151 + .../Generated/Models/FleetTierListResult.cs | 80 + .../FleetTierProperties.Serialization.cs | 319 ++ .../Generated/Models/FleetTierProperties.cs | 113 + .../FleetspaceListResult.Serialization.cs | 151 + .../Generated/Models/FleetspaceListResult.cs | 80 + .../FleetspaceProperties.Serialization.cs | 163 + .../Generated/Models/FleetspaceProperties.cs | 73 + .../IdentityProperties.Serialization.cs | 173 + .../Generated/Models/IdentityProperties.cs | 74 + .../src/Generated/Models/IdentityType.cs | 51 + .../Models/MainPrincipal.Serialization.cs | 195 + .../src/Generated/Models/MainPrincipal.cs | 81 + .../src/Generated/Models/PrincipalType.cs | 51 + .../RegisterServerProperties.Serialization.cs | 193 + .../Models/RegisterServerProperties.cs | 82 + .../src/Generated/Models/ResourceType.cs | 51 + ...TransparentDataEncryption.Serialization.cs | 173 + .../Models/TransparentDataEncryption.cs | 74 + .../src/Generated/Models/ZoneRedundancy.cs | 51 + .../src/Generated/ProviderConstants.cs | 16 + .../FirewallRulesRestOperations.cs | 585 +++ .../FleetDatabasesRestOperations.cs | 1021 +++++ .../FleetTiersRestOperations.cs | 751 ++++ .../RestOperations/FleetsRestOperations.cs | 759 ++++ .../FleetspacesRestOperations.cs | 841 ++++ .../src/Properties/AssemblyInfo.cs | 11 + ...eManager.DatabaseFleetManager.Tests.csproj | 8 + .../DatabaseFleetManagerManagementTestBase.cs | 45 + ...seFleetManagerManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 4 + sdk/databasefleetmanager/ci.mgmt.yml | 26 + .../tsp-location.yaml | 3 +- sdk/durabletask/ci.mgmt.yml | 1 - .../tsp-location.yaml | 5 +- ...re.ResourceManager.IotOperations.net8.0.cs | 34 +- ...rceManager.IotOperations.netstandard2.0.cs | 34 +- ...perationsBrokerAuthenticationCollection.cs | 12 +- ...tOperationsBrokerAuthenticationResource.cs | 8 +- ...OperationsBrokerAuthorizationCollection.cs | 14 +- ...otOperationsBrokerAuthorizationResource.cs | 10 +- .../Sample_IotOperationsBrokerCollection.cs | 16 +- ...e_IotOperationsBrokerListenerCollection.cs | 14 +- ...ple_IotOperationsBrokerListenerResource.cs | 10 +- .../Sample_IotOperationsBrokerResource.cs | 12 +- .../Sample_IotOperationsDataflowCollection.cs | 20 +- ...IotOperationsDataflowEndpointCollection.cs | 28 +- ...e_IotOperationsDataflowEndpointResource.cs | 24 +- ..._IotOperationsDataflowProfileCollection.cs | 14 +- ...le_IotOperationsDataflowProfileResource.cs | 10 +- .../Sample_IotOperationsDataflowResource.cs | 16 +- .../Sample_IotOperationsInstanceCollection.cs | 10 +- .../Sample_IotOperationsInstanceResource.cs | 6 +- .../Sample_SubscriptionResourceExtensions.cs | 2 +- .../Generated/ArmIotOperationsModelFactory.cs | 13 +- .../Extensions/IotOperationsExtensions.cs | 8 +- ...kableIotOperationsResourceGroupResource.cs | 4 +- ...ckableIotOperationsSubscriptionResource.cs | 4 +- ...perationsBrokerAuthenticationCollection.cs | 20 +- ...tOperationsBrokerAuthenticationResource.cs | 12 +- ...OperationsBrokerAuthorizationCollection.cs | 20 +- ...otOperationsBrokerAuthorizationResource.cs | 12 +- .../IotOperationsBrokerCollection.cs | 20 +- .../IotOperationsBrokerListenerCollection.cs | 20 +- .../IotOperationsBrokerListenerResource.cs | 12 +- .../Generated/IotOperationsBrokerResource.cs | 24 +- .../IotOperationsDataflowCollection.cs | 20 +- ...IotOperationsDataflowEndpointCollection.cs | 20 +- .../IotOperationsDataflowEndpointResource.cs | 12 +- .../IotOperationsDataflowProfileCollection.cs | 20 +- .../IotOperationsDataflowProfileResource.cs | 16 +- .../IotOperationsDataflowResource.cs | 12 +- .../IotOperationsInstanceCollection.cs | 20 +- .../IotOperationsInstanceResource.cs | 36 +- .../Models/InstanceFeature.Serialization.cs | 159 + .../src/Generated/Models/InstanceFeature.cs | 70 + .../Generated/Models/InstanceFeatureMode.cs | 54 + ...rationsInstanceProperties.Serialization.cs | 34 +- .../Models/IotOperationsInstanceProperties.cs | 8 +- .../BrokerAuthenticationRestOperations.cs | 2 +- .../BrokerAuthorizationRestOperations.cs | 2 +- .../BrokerListenerRestOperations.cs | 2 +- .../RestOperations/BrokerRestOperations.cs | 2 +- .../DataflowEndpointRestOperations.cs | 2 +- .../DataflowProfileRestOperations.cs | 2 +- .../RestOperations/DataflowRestOperations.cs | 2 +- .../RestOperations/InstanceRestOperations.cs | 2 +- .../tsp-location.yaml | 3 +- .../Azure.ResourceManager.Migrate.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../Azure.ResourceManager.Migrate/README.md | 80 + .../Azure.ResourceManager.Migrate.net8.0.cs | 747 ++++ ....ResourceManager.Migrate.netstandard2.0.cs | 747 ++++ .../Azure.ResourceManager.Migrate/assets.json | 7 + ...ure.ResourceManager.Migrate.Samples.csproj | 13 + .../Sample_AssessedMachineV2Collection.cs | 167 + .../Sample_AssessedMachineV2Resource.cs | 50 + .../Sample_AssessedSqlDatabaseV3Collection.cs | 167 + .../Sample_AssessedSqlDatabaseV3Resource.cs | 50 + .../Sample_AssessedSqlInstanceV3Collection.cs | 167 + .../Sample_AssessedSqlInstanceV3Resource.cs | 50 + .../Sample_AssessedSqlMachineV3Collection.cs | 167 + .../Sample_AssessedSqlMachineV3Resource.cs | 50 + .../Sample_AssessedWebAppV3Collection.cs | 164 + .../Sample_AssessedWebAppV3Resource.cs | 50 + .../Sample_AssessmentProjectCollection.cs | 206 + .../Sample_AssessmentProjectResource.cs | 120 + ...mple_AssessmentProjectSummaryCollection.cs | 160 + ...Sample_AssessmentProjectSummaryResource.cs | 49 + .../Sample_AvsAssessedMachineV2Collection.cs | 167 + .../Sample_AvsAssessedMachineV2Resource.cs | 50 + .../Sample_AvsAssessmentV2Collection.cs | 247 ++ .../Samples/Sample_AvsAssessmentV2Resource.cs | 188 + ...Sample_AvsAssessmentV2SummaryCollection.cs | 164 + .../Sample_AvsAssessmentV2SummaryResource.cs | 50 + ...mple_AvsGraphAssessmentOptionCollection.cs | 158 + ...Sample_AvsGraphAssessmentOptionResource.cs | 48 + .../Samples/Sample_AvsSummaryCollection.cs | 164 + .../Samples/Sample_AvsSummaryResource.cs | 50 + .../Samples/Sample_BusinessCaseCollection.cs | 261 ++ .../Samples/Sample_BusinessCaseResource.cs | 231 ++ .../Sample_CompoundAssessmentCollection.cs | 209 + .../Sample_CompoundAssessmentResource.cs | 150 + .../Sample_EvaluatedAvsMachineCollection.cs | 167 + .../Sample_EvaluatedAvsMachineResource.cs | 50 + .../Sample_EvaluatedMachineCollection.cs | 167 + .../Sample_EvaluatedMachineResource.cs | 50 + .../Sample_EvaluatedSqlEntityCollection.cs | 167 + .../Sample_EvaluatedSqlEntityResource.cs | 50 + .../Sample_EvaluatedWebAppCollection.cs | 167 + .../Samples/Sample_EvaluatedWebAppResource.cs | 50 + ...ample_HeterogeneousAssessmentCollection.cs | 204 + .../Sample_HeterogeneousAssessmentResource.cs | 116 + ...eterogeneousAssessmentSummaryCollection.cs | 164 + ..._HeterogeneousAssessmentSummaryResource.cs | 50 + .../Samples/Sample_IaasSummaryCollection.cs | 164 + .../Samples/Sample_IaasSummaryResource.cs | 50 + .../Sample_MachineAssessmentV2Collection.cs | 249 ++ .../Sample_MachineAssessmentV2Resource.cs | 190 + ...le_MachineAssessmentV2SummaryCollection.cs | 164 + ...mple_MachineAssessmentV2SummaryResource.cs | 50 + ..._MachineGraphAssessmentOptionCollection.cs | 158 + ...le_MachineGraphAssessmentOptionResource.cs | 48 + ...ratePrivateEndpointConnectionCollection.cs | 204 + ...igratePrivateEndpointConnectionResource.cs | 117 + ...igratePrivateLinkResourceDataCollection.cs | 160 + ..._MigratePrivateLinkResourceDataResource.cs | 49 + .../Sample_OverviewSummaryCollection.cs | 164 + .../Samples/Sample_OverviewSummaryResource.cs | 50 + .../Samples/Sample_PaasSummaryCollection.cs | 164 + .../Samples/Sample_PaasSummaryResource.cs | 50 + .../Sample_SqlAssessmentV3Collection.cs | 264 ++ .../Samples/Sample_SqlAssessmentV3Resource.cs | 205 + ...Sample_SqlAssessmentV3SummaryCollection.cs | 164 + .../Sample_SqlAssessmentV3SummaryResource.cs | 50 + ...mple_SqlGraphAssessmentOptionCollection.cs | 158 + ...Sample_SqlGraphAssessmentOptionResource.cs | 48 + .../Sample_SubscriptionResourceExtensions.cs | 50 + .../Sample_WebAppAssessmentV3Collection.cs | 237 ++ .../Sample_WebAppAssessmentV3Resource.cs | 178 + ...ple_WebAppAssessmentV3SummaryCollection.cs | 164 + ...ample_WebAppAssessmentV3SummaryResource.cs | 50 + ...bAppCompoundAssessmentSummaryCollection.cs | 164 + ...WebAppCompoundAssessmentSummaryResource.cs | 50 + .../Sample_WebAppServicePlanV3Collection.cs | 164 + .../Sample_WebAppServicePlanV3Resource.cs | 50 + ...e_WepAppGraphAssessmentOptionCollection.cs | 158 + ...ple_WepAppGraphAssessmentOptionResource.cs | 48 + .../src/Azure.ResourceManager.Migrate.csproj | 8 + .../src/Generated/ArmMigrateModelFactory.cs | 279 ++ .../Generated/CompoundAssessmentCollection.cs | 499 +++ .../CompoundAssessmentData.Serialization.cs | 155 + .../src/Generated/CompoundAssessmentData.cs | 75 + ...ompoundAssessmentResource.Serialization.cs | 26 + .../Generated/CompoundAssessmentResource.cs | 514 +++ .../Generated/Extensions/MigrateExtensions.cs | 165 + .../Extensions/MockableMigrateArmClient.cs | 61 + .../MockableMigrateResourceGroupResource.cs | 110 + .../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 + .../CompoundAssessmentOperationSource.cs | 36 + .../DownloadUriOperationSource.cs | 30 + .../MigrateArmOperation.cs | 94 + .../MigrateArmOperationOfT.cs | 100 + .../src/Generated/Models/AssessmentSource.cs | 81 + .../src/Generated/Models/AssessmentStatus.cs | 72 + .../Models/AzureManagementOfferingType.cs | 60 + .../src/Generated/Models/AzureTarget.cs | 87 + .../Models/CloudSuitabilityCommon.cs | 63 + ...CompoundAssessmentDetails.Serialization.cs | 156 + .../Models/CompoundAssessmentDetails.cs | 80 + ...poundAssessmentListResult.Serialization.cs | 151 + .../Models/CompoundAssessmentListResult.cs | 80 + ...poundAssessmentProperties.Serialization.cs | 167 + .../Models/CompoundAssessmentProperties.cs | 87 + .../Models/CostDetailsCommon.Serialization.cs | 158 + .../src/Generated/Models/CostDetailsCommon.cs | 70 + .../src/Generated/Models/CostType.cs | 108 + .../DiscoveredLightSummary.Serialization.cs | 198 + .../Models/DiscoveredLightSummary.cs | 94 + .../Models/DownloadUri.Serialization.cs | 140 + .../src/Generated/Models/DownloadUri.cs | 78 + .../DownloadUrlContent.Serialization.cs | 118 + .../Generated/Models/DownloadUrlContent.cs | 60 + .../Models/ManagementDetails.Serialization.cs | 158 + .../src/Generated/Models/ManagementDetails.cs | 70 + .../Generated/Models/MigrateWorkloadType.cs | 72 + .../Models/MigrationDetails.Serialization.cs | 158 + .../src/Generated/Models/MigrationDetails.cs | 70 + .../src/Generated/Models/MigrationPlatform.cs | 57 + .../src/Generated/Models/MigrationType.cs | 60 + ...airCloudSuitabilityCommon.Serialization.cs | 148 + .../NameValuePairCloudSuitabilityCommon.cs | 69 + .../NameValuePairCostType.Serialization.cs | 148 + .../Generated/Models/NameValuePairCostType.cs | 69 + .../NameValuePairSavingsType.Serialization.cs | 148 + .../Models/NameValuePairSavingsType.cs | 69 + .../src/Generated/Models/ProvisioningState.cs | 66 + .../SavingsDetailsCommon.Serialization.cs | 158 + .../Generated/Models/SavingsDetailsCommon.cs | 70 + .../src/Generated/Models/SavingsOption.cs | 63 + .../src/Generated/Models/SavingsType.cs | 57 + .../Models/SourceDetails.Serialization.cs | 178 + .../src/Generated/Models/SourceDetails.cs | 77 + .../src/Generated/Models/SummaryType.cs | 54 + .../TargetAssessmentArmIds.Serialization.cs | 151 + .../Models/TargetAssessmentArmIds.cs | 73 + .../Models/TargetDetails.Serialization.cs | 178 + .../src/Generated/Models/TargetDetails.cs | 77 + .../Models/TargetSourcePair.Serialization.cs | 293 ++ .../src/Generated/Models/TargetSourcePair.cs | 100 + ...sessmentSummaryListResult.Serialization.cs | 151 + ...bAppCompoundAssessmentSummaryListResult.cs | 80 + ...sessmentSummaryProperties.Serialization.cs | 305 ++ ...bAppCompoundAssessmentSummaryProperties.cs | 102 + .../src/Generated/Models/WebAppType.cs | 54 + .../Models/WebAppsPerType.Serialization.cs | 134 + .../src/Generated/Models/WebAppsPerType.cs | 78 + .../src/Generated/Models/WebServerType.cs | 54 + .../Models/WebServersPerType.Serialization.cs | 134 + .../src/Generated/Models/WebServersPerType.cs | 78 + .../src/Generated/ProviderConstants.cs | 16 + .../CompoundAssessmentRestOperations.cs | 615 +++ ...CompoundAssessmentSummaryRestOperations.cs | 341 ++ ...bAppCompoundAssessmentSummaryCollection.cs | 395 ++ ...oundAssessmentSummaryData.Serialization.cs | 155 + .../WebAppCompoundAssessmentSummaryData.cs | 75 + ...AssessmentSummaryResource.Serialization.cs | 26 + ...WebAppCompoundAssessmentSummaryResource.cs | 172 + .../src/Properties/AssemblyInfo.cs | 11 + ...Azure.ResourceManager.Migrate.Tests.csproj | 8 + .../tests/MigrateManagementTestBase.cs | 45 + .../tests/MigrateManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 5 + sdk/migrate/ci.mgmt.yml | 26 + ...ure.ResourceManager.NeonPostgres.net8.0.cs | 534 ++- ...urceManager.NeonPostgres.netstandard2.0.cs | 534 ++- .../Generated/ArmNeonPostgresModelFactory.cs | 329 +- .../src/Generated/BranchCollection.cs | 493 +++ .../src/Generated/BranchData.Serialization.cs | 155 + .../src/Generated/BranchData.cs | 75 + .../Generated/BranchResource.Serialization.cs | 26 + .../src/Generated/BranchResource.cs | 628 +++ .../src/Generated/ComputeCollection.cs | 493 +++ .../Generated/ComputeData.Serialization.cs | 155 + .../src/Generated/ComputeData.cs | 75 + .../ComputeResource.Serialization.cs | 26 + .../src/Generated/ComputeResource.cs | 353 ++ .../src/Generated/EndpointCollection.cs | 493 +++ .../Generated/EndpointData.Serialization.cs | 155 + .../src/Generated/EndpointData.cs | 75 + .../EndpointResource.Serialization.cs | 26 + .../src/Generated/EndpointResource.cs | 353 ++ .../MockableNeonPostgresArmClient.cs | 72 + ...ckableNeonPostgresResourceGroupResource.cs | 90 +- ...ockableNeonPostgresSubscriptionResource.cs | 4 +- .../Extensions/NeonPostgresExtensions.cs | 195 +- .../BranchOperationSource.cs | 36 + .../ComputeOperationSource.cs | 36 + .../EndpointOperationSource.cs | 36 + .../NeonDatabaseOperationSource.cs | 36 + .../NeonRoleOperationSource.cs | 36 + .../ProjectOperationSource.cs | 36 + .../Models/Attributes.Serialization.cs | 134 + .../src/Generated/Models/Attributes.cs | 82 + .../Models/BranchListResult.Serialization.cs | 151 + .../src/Generated/Models/BranchListResult.cs | 80 + .../Models/ComputeListResult.Serialization.cs | 151 + .../src/Generated/Models/ComputeListResult.cs | 80 + .../ConnectionUriProperties.Serialization.cs | 207 + .../Models/ConnectionUriProperties.cs | 89 + .../DefaultEndpointSettings.Serialization.cs | 134 + .../Models/DefaultEndpointSettings.cs | 78 + .../EndpointListResult.Serialization.cs | 151 + .../Generated/Models/EndpointListResult.cs | 80 + .../src/Generated/Models/EndpointType.cs | 51 + .../NeonBranchProperties.Serialization.cs | 323 ++ .../Generated/Models/NeonBranchProperties.cs | 113 + .../NeonComputeProperties.Serialization.cs | 253 ++ .../Generated/Models/NeonComputeProperties.cs | 98 + .../NeonDatabaseListResult.Serialization.cs | 151 + .../Models/NeonDatabaseListResult.cs | 80 + .../NeonDatabaseProperties.Serialization.cs | 221 ++ .../Models/NeonDatabaseProperties.cs | 90 + .../NeonEndpointProperties.Serialization.cs | 237 ++ .../Models/NeonEndpointProperties.cs | 94 + ...eonOrganizationProperties.Serialization.cs | 16 + .../Models/NeonOrganizationProperties.cs | 12 +- .../NeonProjectProperties.Serialization.cs | 367 ++ .../Generated/Models/NeonProjectProperties.cs | 121 + .../NeonRoleListResult.Serialization.cs | 151 + .../Generated/Models/NeonRoleListResult.cs | 80 + .../NeonRoleProperties.Serialization.cs | 251 ++ .../Generated/Models/NeonRoleProperties.cs | 95 + .../Models/PgVersion.Serialization.cs | 133 + .../src/Generated/Models/PgVersion.cs | 65 + .../Models/PgVersionsResult.Serialization.cs | 136 + .../src/Generated/Models/PgVersionsResult.cs | 76 + .../Models/ProjectListResult.Serialization.cs | 151 + .../src/Generated/Models/ProjectListResult.cs | 80 + .../src/Generated/NeonDatabaseCollection.cs | 493 +++ .../NeonDatabaseData.Serialization.cs | 155 + .../src/Generated/NeonDatabaseData.cs | 75 + .../NeonDatabaseResource.Serialization.cs | 26 + .../src/Generated/NeonDatabaseResource.cs | 353 ++ .../Generated/NeonOrganizationCollection.cs | 20 +- .../src/Generated/NeonOrganizationResource.cs | 93 +- .../src/Generated/NeonRoleCollection.cs | 493 +++ .../Generated/NeonRoleData.Serialization.cs | 155 + .../src/Generated/NeonRoleData.cs | 75 + .../NeonRoleResource.Serialization.cs | 26 + .../src/Generated/NeonRoleResource.cs | 353 ++ .../src/Generated/ProjectCollection.cs | 493 +++ .../Generated/ProjectData.Serialization.cs | 155 + .../src/Generated/ProjectData.cs | 75 + .../ProjectResource.Serialization.cs | 26 + .../src/Generated/ProjectResource.cs | 505 +++ .../RestOperations/BranchesRestOperations.cs | 657 ++++ .../RestOperations/ComputesRestOperations.cs | 701 ++++ .../RestOperations/EndpointsRestOperations.cs | 701 ++++ .../NeonDatabasesRestOperations.cs | 701 ++++ .../RestOperations/NeonRolesRestOperations.cs | 701 ++++ .../OrganizationsRestOperations.cs | 97 +- .../RestOperations/ProjectsRestOperations.cs | 723 ++++ .../tsp-location.yaml | 3 +- .../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 | 69 + .../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 + ...aseCharacterSetProperties.Serialization.cs | 126 + ...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/pineconevectordb/ci.yml | 35 - ...anager.RecoveryServicesDataReplication.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 80 + ....RecoveryServicesDataReplication.net8.0.cs | 2383 +++++++++++ ...yServicesDataReplication.netstandard2.0.cs | 2383 +++++++++++ .../assets.json | 7 + ...veryServicesDataReplication.Samples.csproj | 13 + ...ReplicationEmailConfigurationCollection.cs | 204 + ...taReplicationEmailConfigurationResource.cs | 90 + .../Sample_DataReplicationEventCollection.cs | 161 + .../Sample_DataReplicationEventResource.cs | 49 + ...mple_DataReplicationExtensionCollection.cs | 200 + ...Sample_DataReplicationExtensionResource.cs | 113 + ...le_DataReplicationFabricAgentCollection.cs | 200 + ...mple_DataReplicationFabricAgentResource.cs | 113 + .../Sample_DataReplicationFabricCollection.cs | 197 + .../Sample_DataReplicationFabricResource.cs | 111 + .../Sample_DataReplicationJobCollection.cs | 161 + .../Sample_DataReplicationJobResource.cs | 49 + .../Sample_DataReplicationPolicyCollection.cs | 200 + .../Sample_DataReplicationPolicyResource.cs | 113 + ...tionPrivateEndpointConnectionCollection.cs | 209 + ...rivateEndpointConnectionProxyCollection.cs | 246 ++ ...nPrivateEndpointConnectionProxyResource.cs | 240 ++ ...cationPrivateEndpointConnectionResource.cs | 122 + ...mple_DataReplicationPrivateLinkResource.cs | 49 + ...eplicationPrivateLinkResourceCollection.cs | 160 + ..._DataReplicationProtectedItemCollection.cs | 200 + ...le_DataReplicationProtectedItemResource.cs | 140 + ..._DataReplicationRecoveryPointCollection.cs | 164 + ...le_DataReplicationRecoveryPointResource.cs | 50 + .../Sample_DataReplicationVaultCollection.cs | 204 + .../Sample_DataReplicationVaultResource.cs | 117 + .../Sample_ResourceGroupResourceExtensions.cs | 56 + .../Sample_SubscriptionResourceExtensions.cs | 112 + ...ger.RecoveryServicesDataReplication.csproj | 8 + ...veryServicesDataReplicationModelFactory.cs | 1413 +++++++ ...ReplicationEmailConfigurationCollection.cs | 497 +++ ...ionEmailConfigurationData.Serialization.cs | 155 + .../DataReplicationEmailConfigurationData.cs | 75 + ...mailConfigurationResource.Serialization.cs | 26 + ...taReplicationEmailConfigurationResource.cs | 267 ++ .../DataReplicationEventCollection.cs | 401 ++ .../DataReplicationEventData.Serialization.cs | 155 + .../src/Generated/DataReplicationEventData.cs | 75 + ...aReplicationEventResource.Serialization.cs | 26 + .../Generated/DataReplicationEventResource.cs | 171 + .../DataReplicationExtensionCollection.cs | 493 +++ ...aReplicationExtensionData.Serialization.cs | 155 + .../Generated/DataReplicationExtensionData.cs | 75 + ...licationExtensionResource.Serialization.cs | 26 + .../DataReplicationExtensionResource.cs | 347 ++ .../DataReplicationFabricAgentCollection.cs | 493 +++ ...eplicationFabricAgentData.Serialization.cs | 155 + .../DataReplicationFabricAgentData.cs | 75 + ...cationFabricAgentResource.Serialization.cs | 26 + .../DataReplicationFabricAgentResource.cs | 347 ++ .../DataReplicationFabricCollection.cs | 496 +++ ...DataReplicationFabricData.Serialization.cs | 178 + .../Generated/DataReplicationFabricData.cs | 83 + ...ReplicationFabricResource.Serialization.cs | 26 + .../DataReplicationFabricResource.cs | 776 ++++ .../Generated/DataReplicationJobCollection.cs | 401 ++ .../DataReplicationJobData.Serialization.cs | 155 + .../src/Generated/DataReplicationJobData.cs | 75 + ...ataReplicationJobResource.Serialization.cs | 26 + .../Generated/DataReplicationJobResource.cs | 171 + .../DataReplicationPolicyCollection.cs | 493 +++ ...DataReplicationPolicyData.Serialization.cs | 155 + .../Generated/DataReplicationPolicyData.cs | 75 + ...ReplicationPolicyResource.Serialization.cs | 26 + .../DataReplicationPolicyResource.cs | 347 ++ ...tionPrivateEndpointConnectionCollection.cs | 497 +++ ...ateEndpointConnectionData.Serialization.cs | 155 + ...eplicationPrivateEndpointConnectionData.cs | 75 + ...rivateEndpointConnectionProxyCollection.cs | 497 +++ ...dpointConnectionProxyData.Serialization.cs | 171 + ...ationPrivateEndpointConnectionProxyData.cs | 79 + ...ntConnectionProxyResource.Serialization.cs | 26 + ...nPrivateEndpointConnectionProxyResource.cs | 435 ++ ...ndpointConnectionResource.Serialization.cs | 26 + ...cationPrivateEndpointConnectionResource.cs | 351 ++ ...cationPrivateLinkResource.Serialization.cs | 26 + .../DataReplicationPrivateLinkResource.cs | 171 + ...eplicationPrivateLinkResourceCollection.cs | 395 ++ ...onPrivateLinkResourceData.Serialization.cs | 155 + .../DataReplicationPrivateLinkResourceData.cs | 75 + .../DataReplicationProtectedItemCollection.cs | 499 +++ ...licationProtectedItemData.Serialization.cs | 155 + .../DataReplicationProtectedItemData.cs | 75 + ...tionProtectedItemResource.Serialization.cs | 26 + .../DataReplicationProtectedItemResource.cs | 511 +++ .../DataReplicationRecoveryPointCollection.cs | 395 ++ ...licationRecoveryPointData.Serialization.cs | 155 + .../DataReplicationRecoveryPointData.cs | 75 + ...tionRecoveryPointResource.Serialization.cs | 26 + .../DataReplicationRecoveryPointResource.cs | 172 + .../DataReplicationVaultCollection.cs | 496 +++ .../DataReplicationVaultData.Serialization.cs | 196 + .../src/Generated/DataReplicationVaultData.cs | 87 + ...aReplicationVaultResource.Serialization.cs | 26 + .../Generated/DataReplicationVaultResource.cs | 1328 +++++++ ...ecoveryServicesDataReplicationArmClient.cs | 193 + ...cesDataReplicationResourceGroupResource.cs | 262 ++ ...icesDataReplicationSubscriptionResource.cs | 245 ++ ...coveryServicesDataReplicationExtensions.cs | 747 ++++ .../src/Generated/Internal/Argument.cs | 129 + .../Internal/ChangeTrackingDictionary.cs | 167 + .../Generated/Internal/ChangeTrackingList.cs | 153 + .../Internal/ModelSerializationExtensions.cs | 399 ++ .../src/Generated/Internal/Optional.cs | 51 + .../Internal/Utf8JsonRequestContent.cs | 55 + ...DataReplicationExtensionOperationSource.cs | 36 + ...taReplicationFabricAgentOperationSource.cs | 36 + .../DataReplicationFabricOperationSource.cs | 36 + .../DataReplicationPolicyOperationSource.cs | 36 + ...ReplicationProtectedItemOperationSource.cs | 36 + .../DataReplicationVaultOperationSource.cs | 36 + .../PlannedFailoverOperationSource.cs | 30 + ...veryServicesDataReplicationArmOperation.cs | 94 + ...yServicesDataReplicationArmOperationOfT.cs | 100 + ...StackHciClusterProperties.Serialization.cs | 160 + .../Models/AzStackHciClusterProperties.cs | 97 + ...HciFabricCustomProperties.Serialization.cs | 213 + .../AzStackHciFabricCustomProperties.cs | 77 + ...ationDiskControllerInputs.Serialization.cs | 142 + .../DataReplicationDiskControllerInputs.cs | 87 + ...ilConfigurationProperties.Serialization.cs | 177 + ...ReplicationEmailConfigurationProperties.cs | 85 + .../DataReplicationErrorInfo.Serialization.cs | 207 + .../Models/DataReplicationErrorInfo.cs | 89 + ...tionEventCustomProperties.Serialization.cs | 118 + .../DataReplicationEventCustomProperties.cs | 69 + ...eplicationEventProperties.Serialization.cs | 274 ++ .../Models/DataReplicationEventProperties.cs | 129 + ...ExtensionCustomProperties.Serialization.cs | 118 + ...ataReplicationExtensionCustomProperties.cs | 69 + ...cationExtensionProperties.Serialization.cs | 141 + .../DataReplicationExtensionProperties.cs | 91 + ...bricAgentCustomProperties.Serialization.cs | 117 + ...aReplicationFabricAgentCustomProperties.cs | 69 + ...tionFabricAgentProperties.Serialization.cs | 262 ++ .../DataReplicationFabricAgentProperties.cs | 140 + ...ionFabricCustomProperties.Serialization.cs | 119 + .../DataReplicationFabricCustomProperties.cs | 69 + ...ataReplicationFabricPatch.Serialization.cs | 181 + .../Models/DataReplicationFabricPatch.cs | 76 + ...plicationFabricProperties.Serialization.cs | 214 + .../Models/DataReplicationFabricProperties.cs | 109 + ...eplicationHealthErrorInfo.Serialization.cs | 327 ++ .../Models/DataReplicationHealthErrorInfo.cs | 120 + .../Models/DataReplicationHealthStatus.cs | 54 + .../DataReplicationIdentity.Serialization.cs | 164 + .../Models/DataReplicationIdentity.cs | 102 + ...ationInnerHealthErrorInfo.Serialization.cs | 259 ++ .../DataReplicationInnerHealthErrorInfo.cs | 105 + ...cationJobCustomProperties.Serialization.cs | 124 + .../DataReplicationJobCustomProperties.cs | 73 + .../Models/DataReplicationJobObjectType.cs | 69 + ...aReplicationJobProperties.Serialization.cs | 394 ++ .../Models/DataReplicationJobProperties.cs | 158 + .../Models/DataReplicationJobState.cs | 72 + ...onNameAvailabilityContent.Serialization.cs | 144 + .../DataReplicationNameAvailabilityContent.cs | 70 + ...ionNameAvailabilityResult.Serialization.cs | 155 + .../DataReplicationNameAvailabilityResult.cs | 73 + ...ionPolicyCustomProperties.Serialization.cs | 118 + .../DataReplicationPolicyCustomProperties.cs | 69 + ...plicationPolicyProperties.Serialization.cs | 141 + .../Models/DataReplicationPolicyProperties.cs | 91 + ...pointConnectionProperties.Serialization.cs | 164 + ...tionPrivateEndpointConnectionProperties.cs | 87 + ...ConnectionProxyProperties.Serialization.cs | 148 + ...rivateEndpointConnectionProxyProperties.cs | 69 + ...licationPrivateEndpointConnectionStatus.cs | 57 + ...ateLinkResourceProperties.Serialization.cs | 194 + ...eplicationPrivateLinkResourceProperties.cs | 79 + ...vateLinkServiceConnection.Serialization.cs | 165 + ...ReplicationPrivateLinkServiceConnection.cs | 74 + ...inkServiceConnectionState.Serialization.cs | 155 + ...cationPrivateLinkServiceConnectionState.cs | 73 + ...onPrivateLinkServiceProxy.Serialization.cs | 185 + .../DataReplicationPrivateLinkServiceProxy.cs | 92 + ...ectedItemCustomProperties.Serialization.cs | 118 + ...eplicationProtectedItemCustomProperties.cs | 69 + ...temCustomPropertiesUpdate.Serialization.cs | 118 + ...tionProtectedItemCustomPropertiesUpdate.cs | 69 + ...icationProtectedItemPatch.Serialization.cs | 154 + .../DataReplicationProtectedItemPatch.cs | 86 + ...onProtectedItemProperties.Serialization.cs | 538 +++ .../DataReplicationProtectedItemProperties.cs | 207 + ...ectedItemPropertiesUpdate.Serialization.cs | 133 + ...eplicationProtectedItemPropertiesUpdate.cs | 73 + .../Models/DataReplicationProtectionState.cs | 201 + .../DataReplicationProvisioningState.cs | 66 + ...veryPointCustomProperties.Serialization.cs | 118 + ...eplicationRecoveryPointCustomProperties.cs | 69 + ...onRecoveryPointProperties.Serialization.cs | 157 + .../DataReplicationRecoveryPointProperties.cs | 103 + .../DataReplicationRecoveryPointType.cs | 51 + .../DataReplicationResynchronizationState.cs | 57 + .../DataReplicationTask.Serialization.cs | 221 ++ .../Generated/Models/DataReplicationTask.cs | 92 + ...ationTaskCustomProperties.Serialization.cs | 126 + .../DataReplicationTaskCustomProperties.cs | 75 + .../Models/DataReplicationTaskState.cs | 63 + .../DataReplicationTestFailoverState.cs | 72 + ...DataReplicationVaultPatch.Serialization.cs | 197 + .../Models/DataReplicationVaultPatch.cs | 80 + ...eplicationVaultProperties.Serialization.cs | 163 + .../Models/DataReplicationVaultProperties.cs | 74 + .../Models/DataReplicationVaultType.cs | 51 + .../DeploymentPreflight.Serialization.cs | 143 + .../Generated/Models/DeploymentPreflight.cs | 66 + ...mentPreflightResourceInfo.Serialization.cs | 198 + .../Models/DeploymentPreflightResourceInfo.cs | 111 + ...figurationModelListResult.Serialization.cs | 151 + .../EmailConfigurationModelListResult.cs | 80 + .../EventModelListResult.Serialization.cs | 151 + .../Generated/Models/EventModelListResult.cs | 80 + ...abricAgentModelListResult.Serialization.cs | 151 + .../Models/FabricAgentModelListResult.cs | 80 + .../FabricModelListResult.Serialization.cs | 151 + .../Generated/Models/FabricModelListResult.cs | 80 + ...iloverJobCustomProperties.Serialization.cs | 145 + .../Models/FailoverJobCustomProperties.cs | 37 + ...erProtectedItemProperties.Serialization.cs | 207 + .../Models/FailoverProtectedItemProperties.cs | 89 + ...upConnectivityInformation.Serialization.cs | 205 + .../Models/GroupConnectivityInformation.cs | 86 + ...ateFabricCustomProperties.Serialization.cs | 178 + .../HyperVMigrateFabricCustomProperties.cs | 65 + ...perVToAzStackHciDiskInput.Serialization.cs | 263 ++ .../Models/HyperVToAzStackHciDiskInput.cs | 123 + ...kHciEventCustomProperties.Serialization.cs | 172 + ...HyperVToAzStackHciEventCustomProperties.cs | 51 + ...yperVToAzStackHciNicInput.Serialization.cs | 205 + .../Models/HyperVToAzStackHciNicInput.cs | 101 + ...dFailoverCustomProperties.Serialization.cs | 118 + ...StackHciPlannedFailoverCustomProperties.cs | 42 + ...HciPolicyCustomProperties.Serialization.cs | 134 + ...yperVToAzStackHciPolicyCustomProperties.cs | 54 + ...ciProtectedDiskProperties.Serialization.cs | 315 ++ ...perVToAzStackHciProtectedDiskProperties.cs | 118 + ...ectedItemCustomProperties.Serialization.cs | 636 +++ ...AzStackHciProtectedItemCustomProperties.cs | 234 ++ ...temCustomPropertiesUpdate.Serialization.cs | 214 + ...kHciProtectedItemCustomPropertiesUpdate.cs | 56 + ...HciProtectedNicProperties.Serialization.cs | 195 + ...yperVToAzStackHciProtectedNicProperties.cs | 85 + ...veryPointCustomProperties.Serialization.cs | 135 + ...AzStackHciRecoveryPointCustomProperties.cs | 36 + ...ExtensionCustomProperties.Serialization.cs | 318 ++ ...HciReplicationExtensionCustomProperties.cs | 109 + ...tiesAffectedObjectDetails.Serialization.cs | 144 + ...elCustomPropertiesAffectedObjectDetails.cs | 69 + ...stomPropertiesAffectedObjectDetailsType.cs | 48 + .../JobModelListResult.Serialization.cs | 151 + .../Generated/Models/JobModelListResult.cs | 80 + .../Models/PlannedFailover.Serialization.cs | 126 + .../src/Generated/Models/PlannedFailover.cs | 85 + ...dFailoverCustomProperties.Serialization.cs | 118 + .../Models/PlannedFailoverCustomProperties.cs | 69 + ...PlannedFailoverProperties.Serialization.cs | 126 + .../Models/PlannedFailoverProperties.cs | 87 + .../PolicyModelListResult.Serialization.cs | 151 + .../Generated/Models/PolicyModelListResult.cs | 80 + ...ConnectionProxyListResult.Serialization.cs | 151 + ...rivateEndpointConnectionProxyListResult.cs | 80 + .../Models/ProtectedItemActiveLocation.cs | 51 + ...edItemDynamicMemoryConfig.Serialization.cs | 142 + .../ProtectedItemDynamicMemoryConfig.cs | 84 + ...rotectedItemJobProperties.Serialization.cs | 211 + .../Models/ProtectedItemJobProperties.cs | 89 + ...tectedItemModelListResult.Serialization.cs | 151 + .../Models/ProtectedItemModelListResult.cs | 80 + ...overyPointModelListResult.Serialization.cs | 151 + .../Models/RecoveryPointModelListResult.cs | 80 + ...pointConnectionListResult.Serialization.cs | 151 + ...tionPrivateEndpointConnectionListResult.cs | 80 + ...ateLinkResourceListResult.Serialization.cs | 151 + ...eplicationPrivateLinkResourceListResult.cs | 80 + .../RemotePrivateEndpoint.Serialization.cs | 232 ++ .../Generated/Models/RemotePrivateEndpoint.cs | 95 + ...EndpointConnectionDetails.Serialization.cs | 179 + .../RemotePrivateEndpointConnectionDetails.cs | 81 + ...nExtensionModelListResult.Serialization.cs | 151 + .../ReplicationExtensionModelListResult.cs | 80 + ...torageContainerProperties.Serialization.cs | 134 + .../Models/StorageContainerProperties.cs | 82 + ...leanupJobCustomProperties.Serialization.cs | 131 + .../TestFailoverCleanupJobCustomProperties.cs | 36 + ...iloverJobCustomProperties.Serialization.cs | 145 + .../Models/TestFailoverJobCustomProperties.cs | 37 + ...tionEventCustomProperties.Serialization.cs | 110 + ...ownDataReplicationEventCustomProperties.cs | 29 + ...ExtensionCustomProperties.Serialization.cs | 110 + ...ataReplicationExtensionCustomProperties.cs | 29 + ...bricAgentCustomProperties.Serialization.cs | 110 + ...aReplicationFabricAgentCustomProperties.cs | 29 + ...ionFabricCustomProperties.Serialization.cs | 110 + ...wnDataReplicationFabricCustomProperties.cs | 29 + ...cationJobCustomProperties.Serialization.cs | 120 + ...knownDataReplicationJobCustomProperties.cs | 30 + ...ionPolicyCustomProperties.Serialization.cs | 110 + ...wnDataReplicationPolicyCustomProperties.cs | 29 + ...ectedItemCustomProperties.Serialization.cs | 110 + ...eplicationProtectedItemCustomProperties.cs | 29 + ...temCustomPropertiesUpdate.Serialization.cs | 110 + ...tionProtectedItemCustomPropertiesUpdate.cs | 29 + ...veryPointCustomProperties.Serialization.cs | 110 + ...eplicationRecoveryPointCustomProperties.cs | 29 + ...dFailoverCustomProperties.Serialization.cs | 110 + .../UnknownPlannedFailoverCustomProperties.cs | 29 + ...bricAgentCustomProperties.Serialization.cs | 126 + .../VMwareFabricAgentCustomProperties.cs | 52 + ...ateFabricCustomProperties.Serialization.cs | 126 + .../VMwareMigrateFabricCustomProperties.cs | 53 + ...wareToAzStackHciDiskInput.Serialization.cs | 263 ++ .../Models/VMwareToAzStackHciDiskInput.cs | 123 + ...kHciEventCustomProperties.Serialization.cs | 172 + ...VMwareToAzStackHciEventCustomProperties.cs | 51 + ...MwareToAzStackHciNicInput.Serialization.cs | 214 + .../Models/VMwareToAzStackHciNicInput.cs | 108 + ...dFailoverCustomProperties.Serialization.cs | 118 + ...StackHciPlannedFailoverCustomProperties.cs | 42 + ...HciPolicyCustomProperties.Serialization.cs | 134 + ...MwareToAzStackHciPolicyCustomProperties.cs | 54 + ...ciProtectedDiskProperties.Serialization.cs | 315 ++ ...wareToAzStackHciProtectedDiskProperties.cs | 118 + ...ectedItemCustomProperties.Serialization.cs | 748 ++++ ...AzStackHciProtectedItemCustomProperties.cs | 262 ++ ...temCustomPropertiesUpdate.Serialization.cs | 214 + ...kHciProtectedItemCustomPropertiesUpdate.cs | 56 + ...HciProtectedNicProperties.Serialization.cs | 223 ++ ...MwareToAzStackHciProtectedNicProperties.cs | 93 + ...veryPointCustomProperties.Serialization.cs | 135 + ...AzStackHciRecoveryPointCustomProperties.cs | 36 + ...ExtensionCustomProperties.Serialization.cs | 318 ++ ...HciReplicationExtensionCustomProperties.cs | 109 + .../Models/VMwareToAzureMigrateResyncState.cs | 54 + .../VaultModelListResult.Serialization.cs | 151 + .../Generated/Models/VaultModelListResult.cs | 80 + .../src/Generated/Models/VmNicSelection.cs | 57 + .../src/Generated/ProviderConstants.cs | 16 + .../CheckNameAvailabilityRestOperations.cs | 132 + .../DeploymentPreflightRestOperations.cs | 142 + .../EmailConfigurationRestOperations.cs | 431 ++ .../RestOperations/EventRestOperations.cs | 357 ++ .../FabricAgentRestOperations.cs | 513 +++ .../RestOperations/FabricRestOperations.cs | 735 ++++ .../RestOperations/JobRestOperations.cs | 357 ++ .../RestOperations/PolicyRestOperations.cs | 513 +++ ...EndpointConnectionProxiesRestOperations.cs | 633 +++ ...rivateEndpointConnectionsRestOperations.cs | 523 +++ .../PrivateLinkResourcesRestOperations.cs | 321 ++ .../ProtectedItemRestOperations.cs | 761 ++++ .../RecoveryPointRestOperations.cs | 341 ++ .../ReplicationExtensionRestOperations.cs | 513 +++ .../RestOperations/VaultRestOperations.cs | 735 ++++ .../src/Properties/AssemblyInfo.cs | 11 + ...coveryServicesDataReplication.Tests.csproj | 8 + ...rvicesDataReplicationManagementTestBase.cs | 45 + ...ataReplicationManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 4 + .../ci.mgmt.yml | 26 + sdk/resourcemanager/ci.mgmt.yml | 10 + ...rviceFabricManagedApplicationCollection.cs | 67 +- ...ServiceFabricManagedApplicationResource.cs | 43 +- ...eFabricManagedApplicationTypeCollection.cs | 22 +- ...iceFabricManagedApplicationTypeResource.cs | 20 +- ...ManagedApplicationTypeVersionCollection.cs | 25 +- ...icManagedApplicationTypeVersionResource.cs | 20 +- ...e_ServiceFabricManagedClusterCollection.cs | 117 +- ...ple_ServiceFabricManagedClusterResource.cs | 44 +- ..._ServiceFabricManagedNodeTypeCollection.cs | 295 +- ...le_ServiceFabricManagedNodeTypeResource.cs | 197 +- ...e_ServiceFabricManagedServiceCollection.cs | 55 +- ...ple_ServiceFabricManagedServiceResource.cs | 20 +- .../Sample_SubscriptionResourceExtensions.cs | 170 +- .../Sample_TenantResourceExtensions.cs | 43 + ...erviceFabricManagedClustersModelFactory.cs | 648 ++- ...leServiceFabricManagedClustersArmClient.cs | 24 +- ...ricManagedClustersResourceGroupResource.cs | 8 +- ...bricManagedClustersSubscriptionResource.cs | 506 ++- ...viceFabricManagedClustersTenantResource.cs | 95 + .../ServiceFabricManagedClustersExtensions.cs | 513 ++- .../FaultSimulationOperationSource.cs | 30 + .../Models/ApplicationHealthPolicy.cs | 8 +- .../ApplicationResourceList.Serialization.cs | 31 +- .../Models/ApplicationResourceList.cs | 26 +- ...plicationTypeResourceList.Serialization.cs | 31 +- .../Models/ApplicationTypeResourceList.cs | 26 +- ...onTypeVersionResourceList.Serialization.cs | 31 +- .../ApplicationTypeVersionResourceList.cs | 26 +- .../Models/ApplicationUpgradePolicy.cs | 14 +- .../ApplicationUserAssignedIdentityInfo.cs | 2 +- .../AutoGeneratedDomainNameLabelScope.cs | 3 +- ...AvailableOperationDisplay.Serialization.cs | 162 + .../Models/AvailableOperationDisplay.cs | 77 + .../AveragePartitionLoadScalingTrigger.cs | 2 +- .../AverageServiceLoadScalingTrigger.cs | 2 +- .../Models/ErrorModelError.Serialization.cs | 140 + .../src/Generated/Models/ErrorModelError.cs | 69 + .../src/Generated/Models/FaultKind.cs | 48 + .../Models/FaultSimulation.Serialization.cs | 195 + .../src/Generated/Models/FaultSimulation.cs | 81 + ...aultSimulationConstraints.Serialization.cs | 133 + .../Models/FaultSimulationConstraints.cs | 65 + .../FaultSimulationContent.Serialization.cs | 127 + .../Models/FaultSimulationContent.cs | 88 + ...tSimulationContentWrapper.Serialization.cs | 126 + .../Models/FaultSimulationContentWrapper.cs | 87 + .../FaultSimulationDetails.Serialization.cs | 180 + .../Models/FaultSimulationDetails.cs | 86 + .../FaultSimulationIdContent.Serialization.cs | 126 + .../Models/FaultSimulationIdContent.cs | 75 + ...FaultSimulationListResult.Serialization.cs | 151 + .../Models/FaultSimulationListResult.cs | 80 + .../Generated/Models/FaultSimulationStatus.cs | 63 + ...ongRunningOperationResult.Serialization.cs | 207 + .../Models/LongRunningOperationResult.cs | 85 + ...dClusterClientCertificate.Serialization.cs | 34 +- .../Models/ManagedClusterClientCertificate.cs | 68 +- .../Models/ManagedClusterHealthPolicy.cs | 11 +- .../ManagedClusterListResult.Serialization.cs | 29 +- .../Models/ManagedClusterListResult.cs | 28 +- .../ManagedClusterLoadBalanceProbeProtocol.cs | 8 +- ...usterLoadBalancingRuleTransportProtocol.cs | 4 +- ...edClusterMonitoringPolicy.Serialization.cs | 12 +- .../Models/ManagedClusterMonitoringPolicy.cs | 12 +- ...gedClusterServiceEndpoint.Serialization.cs | 12 +- .../Models/ManagedClusterServiceEndpoint.cs | 11 +- .../ManagedClusterSubnet.Serialization.cs | 2 +- ...bnetPrivateEndpointNetworkPoliciesState.cs | 4 +- ...tPrivateLinkServiceNetworkPoliciesState.cs | 4 +- .../ManagedClusterUpgradeDeltaHealthPolicy.cs | 7 - .../Models/ManagedClusterUpgradeMode.cs | 5 +- .../Models/ManagedClusterUpgradePolicy.cs | 2 - .../ManagedClusterVersionEnvironment.cs | 4 +- ...gedServicePartitionScheme.Serialization.cs | 4 +- .../Models/ManagedServicePartitionScheme.cs | 4 +- ...gedServicePlacementPolicy.Serialization.cs | 6 +- .../Models/ManagedServicePlacementPolicy.cs | 10 +- .../ManagedServiceProperties.Serialization.cs | 3 +- .../Models/ManagedServiceProperties.cs | 6 +- ...edServiceScalingMechanism.Serialization.cs | 4 +- .../Models/ManagedServiceScalingMechanism.cs | 4 +- ...agedServiceScalingTrigger.Serialization.cs | 4 +- .../Models/ManagedServiceScalingTrigger.cs | 4 +- .../ManagedVmSizesResult.Serialization.cs | 31 +- .../Generated/Models/ManagedVmSizesResult.cs | 26 +- ...medPartitionAddOrRemoveScalingMechanism.cs | 2 +- .../Generated/Models/NamedPartitionScheme.cs | 2 +- .../Generated/Models/NodeTypeAvailableSku.cs | 4 +- .../NodeTypeFaultSimulation.Serialization.cs | 170 + .../Models/NodeTypeFaultSimulation.cs | 77 + ...TypeFrontendConfiguration.Serialization.cs | 6 +- .../Models/NodeTypeFrontendConfiguration.cs | 12 +- ...eTypeFrontendConfigurationIPAddressType.cs | 5 +- .../NodeTypeListResult.Serialization.cs | 29 +- .../Generated/Models/NodeTypeListResult.cs | 28 +- .../NodeTypeListSkuResult.Serialization.cs | 29 +- .../Generated/Models/NodeTypeListSkuResult.cs | 26 +- .../src/Generated/Models/NodeTypeSku.cs | 14 +- .../Generated/Models/NodeTypeSkuScaleType.cs | 5 +- .../Generated/Models/NodeTypeSupportedSku.cs | 4 +- .../Models/NodeTypeVaultCertificate.cs | 6 +- .../NodeTypeVmssExtension.Serialization.cs | 28 +- .../Generated/Models/NodeTypeVmssExtension.cs | 84 +- .../OperationListResult.Serialization.cs | 151 + .../Generated/Models/OperationListResult.cs | 80 + .../Models/OperationResult.Serialization.cs | 187 + .../src/Generated/Models/OperationResult.cs | 81 + .../PartitionInstanceCountScalingMechanism.cs | 2 +- .../PolicyViolationCompensationAction.cs | 11 +- ...ngUpgradeMonitoringPolicy.Serialization.cs | 30 +- .../Models/RollingUpgradeMonitoringPolicy.cs | 21 +- .../Models/SecurityEncryptionType.cs | 51 + ...viceFabricManagedClusterIPConfiguration.cs | 4 +- ...icManagedClusterPrivateIPAddressVersion.cs | 4 +- ...ricManagedClusterPublicIPAddressVersion.cs | 4 +- ...ServiceFabricManagedClusterSecurityType.cs | 3 + .../ServiceFabricManagedClusterState.cs | 5 +- ...bricManagedClusterVersion.Serialization.cs | 2 +- .../ServiceFabricManagedDataDiskType.cs | 26 +- ...bricManagedNetworkSecurityRuleDirection.cs | 4 +- ...erviceFabricManagedNetworkTrafficAccess.cs | 4 +- .../Models/ServiceFabricManagedNsgProtocol.cs | 14 +- ...eFabricManagedResourceProvisioningState.cs | 20 +- .../ServicePlacementInvalidDomainPolicy.cs | 8 +- ...PlacementNonPartiallyPlaceServicePolicy.cs | 10 +- ...rvicePlacementPreferPrimaryDomainPolicy.cs | 9 +- ...lacementRequireDomainDistributionPolicy.cs | 9 +- .../ServicePlacementRequiredDomainPolicy.cs | 8 +- .../ServiceResourceList.Serialization.cs | 31 +- .../Generated/Models/ServiceResourceList.cs | 26 +- .../Models/ServiceTypeHealthPolicy.cs | 14 +- .../Generated/Models/SfmcOperationStatus.cs | 63 + .../Models/SingletonPartitionScheme.cs | 4 +- ...StatefulServiceProperties.Serialization.cs | 40 +- .../Models/StatefulServiceProperties.cs | 11 +- .../Models/StatelessServiceProperties.cs | 1 - .../UniformInt64RangePartitionScheme.cs | 8 +- ...ownFaultSimulationContent.Serialization.cs | 130 + .../Models/UnknownFaultSimulationContent.cs | 31 + ...edServicePartitionScheme.Serialization.cs} | 6 +- ...> UnknownManagedServicePartitionScheme.cs} | 14 +- ...edServicePlacementPolicy.Serialization.cs} | 6 +- .../UnknownManagedServicePlacementPolicy.cs | 29 + ...ManagedServiceProperties.Serialization.cs} | 6 +- ....cs => UnknownManagedServiceProperties.cs} | 13 +- ...dServiceScalingMechanism.Serialization.cs} | 6 +- .../UnknownManagedServiceScalingMechanism.cs | 29 + ...gedServiceScalingTrigger.Serialization.cs} | 6 +- ...=> UnknownManagedServiceScalingTrigger.cs} | 14 +- .../Generated/Models/UnknownScalingTrigger.cs | 29 - .../Models/UnknownServicePlacementPolicy.cs | 29 - .../src/Generated/Models/VmImagePlan.cs | 2 +- .../Models/VmManagedIdentity.Serialization.cs | 24 +- .../src/Generated/Models/VmManagedIdentity.cs | 11 +- ...opertiesProtectedSettings.Serialization.cs | 118 + ...mSSExtensionPropertiesProtectedSettings.cs | 60 + ...tensionPropertiesSettings.Serialization.cs | 118 + .../Models/VmSSExtensionPropertiesSettings.cs | 60 + .../Models/VmssExtensionSetupOrder.cs | 5 +- ...oneFaultSimulationContent.Serialization.cs | 155 + .../Models/ZoneFaultSimulationContent.cs | 38 + .../ApplicationTypeVersionsRestOperations.cs | 76 +- .../ApplicationTypesRestOperations.cs | 76 +- .../ApplicationsRestOperations.cs | 474 ++- ...gedApplyMaintenanceWindowRestOperations.cs | 14 +- ...ManagedAzResiliencyStatusRestOperations.cs | 26 +- .../ManagedClusterVersionRestOperations.cs | 182 +- .../ManagedClustersRestOperations.cs | 698 +++- ...edMaintenanceWindowStatusRestOperations.cs | 14 +- ...ManagedUnsupportedVMSizesRestOperations.cs | 128 +- .../NodeTypeSkusRestOperations.cs | 46 +- .../RestOperations/NodeTypesRestOperations.cs | 1164 +++++- .../OperationResultsRestOperations.cs | 121 + .../OperationStatusRestOperations.cs | 129 + .../OperationsRestOperations.cs | 173 + .../RestOperations/ServicesRestOperations.cs | 76 +- ...rviceFabricManagedApplicationCollection.cs | 60 +- ...ricManagedApplicationData.Serialization.cs | 2 +- .../ServiceFabricManagedApplicationData.cs | 12 +- ...ServiceFabricManagedApplicationResource.cs | 172 +- ...eFabricManagedApplicationTypeCollection.cs | 60 +- ...iceFabricManagedApplicationTypeResource.cs | 88 +- ...ManagedApplicationTypeVersionCollection.cs | 60 +- ...icManagedApplicationTypeVersionResource.cs | 76 +- .../ServiceFabricManagedClusterCollection.cs | 40 +- ...eFabricManagedClusterData.Serialization.cs | 79 +- .../ServiceFabricManagedClusterData.cs | 97 +- .../ServiceFabricManagedClusterResource.cs | 553 ++- .../ServiceFabricManagedNodeTypeCollection.cs | 40 +- ...FabricManagedNodeTypeData.Serialization.cs | 76 +- .../ServiceFabricManagedNodeTypeData.cs | 38 +- .../ServiceFabricManagedNodeTypeResource.cs | 744 +++- .../ServiceFabricManagedServiceCollection.cs | 60 +- .../ServiceFabricManagedServiceResource.cs | 76 +- .../src/autorest.md | 232 -- .../tsp-location.yaml | 4 + ...zure.ResourceManager.StandbyPool.net8.0.cs | 6 - ...ourceManager.StandbyPool.netstandard2.0.cs | 6 - .../Generated/ArmStandbyPoolModelFactory.cs | 37 - .../tsp-location.yaml | 5 +- sdk/storage/ci.yml | 8 + ...re.ResourceManager.SapVirtualInstances.sln | 56 + .../CHANGELOG.md | 11 + .../Directory.Build.props | 6 + .../README.md | 80 + .../assets.json | 7 + ...Manager.SapVirtualInstances.Samples.csproj | 13 + ..._SapApplicationServerInstanceCollection.cs | 241 ++ ...le_SapApplicationServerInstanceResource.cs | 306 ++ ...mple_SapCentralServerInstanceCollection.cs | 241 ++ ...Sample_SapCentralServerInstanceResource.cs | 240 ++ .../Sample_SapDatabaseInstanceCollection.cs | 241 ++ .../Sample_SapDatabaseInstanceResource.cs | 306 ++ .../Sample_SapVirtualInstanceCollection.cs | 3485 +++++++++++++++++ .../Sample_SapVirtualInstanceResource.cs | 372 ++ .../Sample_SubscriptionResourceExtensions.cs | 423 ++ ...ResourceManager.SapVirtualInstances.csproj | 8 + .../ArmSapVirtualInstancesModelFactory.cs | 565 +++ .../MockableSapVirtualInstancesArmClient.cs | 85 + ...apVirtualInstancesResourceGroupResource.cs | 105 + ...SapVirtualInstancesSubscriptionResource.cs | 449 +++ .../SapVirtualInstancesExtensions.cs | 573 +++ .../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 + .../OperationStatusResultOperationSource.cs | 30 + ...pplicationServerInstanceOperationSource.cs | 36 + ...SapCentralServerInstanceOperationSource.cs | 36 + .../SapDatabaseInstanceOperationSource.cs | 36 + .../SapVirtualInstanceOperationSource.cs | 36 + .../SapVirtualInstancesArmOperation.cs | 94 + .../SapVirtualInstancesArmOperationOfT.cs | 100 + ...cationServerConfiguration.Serialization.cs | 142 + .../Models/ApplicationServerConfiguration.cs | 88 + ...onServerFullResourceNames.Serialization.cs | 154 + .../ApplicationServerFullResourceNames.cs | 70 + .../ApplicationServerVirtualMachineType.cs | 54 + ...pplicationServerVmDetails.Serialization.cs | 170 + .../Models/ApplicationServerVmDetails.cs | 75 + ...entralServerConfiguration.Serialization.cs | 142 + .../Models/CentralServerConfiguration.cs | 88 + ...alServerFullResourceNames.Serialization.cs | 169 + .../Models/CentralServerFullResourceNames.cs | 74 + .../Models/CentralServerVirtualMachineType.cs | 66 + .../CentralServerVmDetails.Serialization.cs | 170 + .../Models/CentralServerVmDetails.cs | 75 + ...untFileShareConfiguration.Serialization.cs | 132 + .../CreateAndMountFileShareConfiguration.cs | 39 + .../DatabaseConfiguration.Serialization.cs | 178 + .../Generated/Models/DatabaseConfiguration.cs | 106 + ...seServerFullResourceNames.Serialization.cs | 169 + .../Models/DatabaseServerFullResourceNames.cs | 74 + .../Models/DatabaseVmDetails.Serialization.cs | 170 + .../src/Generated/Models/DatabaseVmDetails.cs | 75 + .../DeployerVmPackages.Serialization.cs | 140 + .../Generated/Models/DeployerVmPackages.cs | 69 + .../DeploymentConfiguration.Serialization.cs | 151 + .../Models/DeploymentConfiguration.cs | 59 + ...oymentWithOSConfiguration.Serialization.cs | 172 + .../Models/DeploymentWithOSConfiguration.cs | 63 + .../DiscoveryConfiguration.Serialization.cs | 143 + .../Models/DiscoveryConfiguration.cs | 43 + .../Models/DiskConfiguration.Serialization.cs | 144 + .../src/Generated/Models/DiskConfiguration.cs | 66 + .../Models/DiskDetails.Serialization.cs | 227 ++ .../src/Generated/Models/DiskDetails.cs | 95 + .../Generated/Models/DiskSku.Serialization.cs | 133 + .../src/Generated/Models/DiskSku.cs | 65 + .../src/Generated/Models/DiskSkuName.cs | 66 + .../DiskVolumeConfiguration.Serialization.cs | 163 + .../Models/DiskVolumeConfiguration.cs | 84 + ...plicationServerProperties.Serialization.cs | 211 + .../EnqueueReplicationServerProperties.cs | 89 + .../Models/EnqueueReplicationServerType.cs | 51 + .../EnqueueServerProperties.Serialization.cs | 170 + .../Models/EnqueueServerProperties.cs | 77 + .../Models/ErrorInformation.Serialization.cs | 165 + .../src/Generated/Models/ErrorInformation.cs | 74 + ...tionSoftwareConfiguration.Serialization.cs | 121 + ...ternalInstallationSoftwareConfiguration.cs | 35 + .../FileShareConfiguration.Serialization.cs | 119 + .../Models/FileShareConfiguration.cs | 69 + .../Models/FileShareConfigurationType.cs | 54 + .../GatewayServerProperties.Serialization.cs | 148 + .../Models/GatewayServerProperties.cs | 69 + ...AvailabilityConfiguration.Serialization.cs | 126 + .../Models/HighAvailabilityConfiguration.cs | 72 + ...litySoftwareConfiguration.Serialization.cs | 134 + .../HighAvailabilitySoftwareConfiguration.cs | 82 + .../Models/ImageReference.Serialization.cs | 183 + .../src/Generated/Models/ImageReference.cs | 82 + ...frastructureConfiguration.Serialization.cs | 120 + .../Models/InfrastructureConfiguration.cs | 83 + .../LinuxConfiguration.Serialization.cs | 155 + .../Generated/Models/LinuxConfiguration.cs | 54 + ...LoadBalancerResourceNames.Serialization.cs | 204 + .../Models/LoadBalancerResourceNames.cs | 80 + .../ManagedRGConfiguration.Serialization.cs | 129 + .../Models/ManagedRGConfiguration.cs | 65 + .../ManagedResourcesNetworkAccessType.cs | 51 + .../MessageServerProperties.Serialization.cs | 223 ++ .../Models/MessageServerProperties.cs | 89 + ...untFileShareConfiguration.Serialization.cs | 126 + .../Models/MountFileShareConfiguration.cs | 52 + .../src/Generated/Models/NamingPatternType.cs | 48 + .../NetworkConfiguration.Serialization.cs | 133 + .../Generated/Models/NetworkConfiguration.cs | 65 + ...orkInterfaceResourceNames.Serialization.cs | 129 + .../Models/NetworkInterfaceResourceNames.cs | 65 + .../Models/OSConfiguration.Serialization.cs | 118 + .../src/Generated/Models/OSConfiguration.cs | 69 + .../Models/OSProfile.Serialization.cs | 155 + .../src/Generated/Models/OSProfile.cs | 81 + .../OSSapConfiguration.Serialization.cs | 144 + .../Generated/Models/OSSapConfiguration.cs | 69 + .../src/Generated/Models/OSType.cs | 51 + .../OperationStatusResult.Serialization.cs | 258 ++ .../Generated/Models/OperationStatusResult.cs | 109 + ...nServerInstanceListResult.Serialization.cs | 151 + .../SAPApplicationServerInstanceListResult.cs | 80 + ...lServerInstanceListResult.Serialization.cs | 151 + .../SAPCentralServerInstanceListResult.cs | 80 + ...atabaseInstanceListResult.Serialization.cs | 151 + .../Models/SAPDatabaseInstanceListResult.cs | 80 + ...APVirtualInstanceIdentity.Serialization.cs | 153 + .../Models/SAPVirtualInstanceIdentity.cs | 78 + .../Models/SAPVirtualInstanceIdentityType.cs | 51 + ...VirtualInstanceListResult.Serialization.cs | 151 + .../Models/SAPVirtualInstanceListResult.cs | 80 + ...cationServerInstancePatch.Serialization.cs | 144 + .../SapApplicationServerInstancePatch.cs | 66 + ...plicationServerProperties.Serialization.cs | 358 ++ .../Models/SapApplicationServerProperties.cs | 139 + ...abilityZoneDetailsContent.Serialization.cs | 142 + .../SapAvailabilityZoneDetailsContent.cs | 87 + ...labilityZoneDetailsResult.Serialization.cs | 143 + .../SapAvailabilityZoneDetailsResult.cs | 66 + .../SapAvailabilityZonePair.Serialization.cs | 148 + .../Models/SapAvailabilityZonePair.cs | 69 + ...entralServerInstancePatch.Serialization.cs | 144 + .../Models/SapCentralServerInstancePatch.cs | 66 + ...apCentralServerProperties.Serialization.cs | 338 ++ .../Models/SapCentralServerProperties.cs | 131 + .../Models/SapConfiguration.Serialization.cs | 119 + .../src/Generated/Models/SapConfiguration.cs | 69 + .../Generated/Models/SapConfigurationType.cs | 54 + .../SapDatabaseInstancePatch.Serialization.cs | 144 + .../Models/SapDatabaseInstancePatch.cs | 66 + .../SapDatabaseProperties.Serialization.cs | 258 ++ .../Generated/Models/SapDatabaseProperties.cs | 111 + .../Models/SapDatabaseScaleMethod.cs | 48 + .../src/Generated/Models/SapDatabaseType.cs | 51 + .../src/Generated/Models/SapDeploymentType.cs | 51 + .../SapDiskConfiguration.Serialization.cs | 158 + .../Generated/Models/SapDiskConfiguration.cs | 70 + ...DiskConfigurationsContent.Serialization.cs | 173 + .../Models/SapDiskConfigurationsContent.cs | 106 + ...pDiskConfigurationsResult.Serialization.cs | 144 + .../Models/SapDiskConfigurationsResult.cs | 66 + .../Generated/Models/SapEnvironmentType.cs | 51 + .../src/Generated/Models/SapHealthState.cs | 57 + .../Models/SapHighAvailabilityType.cs | 51 + ...nfigSoftwareConfiguration.Serialization.cs | 155 + ...allWithoutOSConfigSoftwareConfiguration.cs | 63 + .../src/Generated/Models/SapProductType.cs | 54 + ...zingRecommendationContent.Serialization.cs | 214 + .../Models/SapSizingRecommendationContent.cs | 119 + ...izingRecommendationResult.Serialization.cs | 118 + .../Models/SapSizingRecommendationResult.cs | 69 + .../Models/SapSoftwareInstallationType.cs | 54 + ...pportedResourceSkusResult.Serialization.cs | 143 + .../Models/SapSupportedResourceSkusResult.cs | 66 + .../Models/SapSupportedSku.Serialization.cs | 159 + .../src/Generated/Models/SapSupportedSku.cs | 73 + .../SapSupportedSkusContent.Serialization.cs | 180 + .../Models/SapSupportedSkusContent.cs | 103 + .../SapVirtualInstanceError.Serialization.cs | 133 + .../Models/SapVirtualInstanceError.cs | 65 + .../SapVirtualInstancePatch.Serialization.cs | 174 + .../Models/SapVirtualInstancePatch.cs | 85 + ...VirtualInstanceProperties.Serialization.cs | 258 ++ .../Models/SapVirtualInstanceProperties.cs | 144 + .../SapVirtualInstanceProvisioningState.cs | 63 + .../Models/SapVirtualInstanceState.cs | 84 + .../Models/SapVirtualInstanceStatus.cs | 66 + ...atedSoftwareConfiguration.Serialization.cs | 173 + .../ServiceInitiatedSoftwareConfiguration.cs | 77 + ...haredStorageResourceNames.Serialization.cs | 140 + .../Models/SharedStorageResourceNames.cs | 69 + ...SingleServerConfiguration.Serialization.cs | 201 + .../Models/SingleServerConfiguration.cs | 102 + ...ServerCustomResourceNames.Serialization.cs | 117 + .../Models/SingleServerCustomResourceNames.cs | 69 + ...leServerFullResourceNames.Serialization.cs | 125 + .../Models/SingleServerFullResourceNames.cs | 35 + ...erverRecommendationResult.Serialization.cs | 121 + .../SingleServerRecommendationResult.cs | 35 + ...kipFileShareConfiguration.Serialization.cs | 110 + .../Models/SkipFileShareConfiguration.cs | 30 + .../SoftwareConfiguration.Serialization.cs | 119 + .../Generated/Models/SoftwareConfiguration.cs | 69 + .../Models/SshConfiguration.Serialization.cs | 143 + .../src/Generated/Models/SshConfiguration.cs | 66 + .../Models/SshKeyPair.Serialization.cs | 140 + .../src/Generated/Models/SshKeyPair.cs | 69 + .../Models/SshPublicKey.Serialization.cs | 129 + .../src/Generated/Models/SshPublicKey.cs | 65 + .../Models/StartContent.Serialization.cs | 133 + .../src/Generated/Models/StartContent.cs | 65 + .../Models/StopContent.Serialization.cs | 148 + .../src/Generated/Models/StopContent.cs | 69 + .../StorageConfiguration.Serialization.cs | 133 + .../Generated/Models/StorageConfiguration.cs | 73 + .../ThreeTierConfiguration.Serialization.cs | 210 + .../Models/ThreeTierConfiguration.cs | 124 + ...eeTierCustomResourceNames.Serialization.cs | 117 + .../Models/ThreeTierCustomResourceNames.cs | 69 + ...hreeTierFullResourceNames.Serialization.cs | 176 + .../Models/ThreeTierFullResourceNames.cs | 47 + ...eTierRecommendationResult.Serialization.cs | 196 + .../Models/ThreeTierRecommendationResult.cs | 55 + ...ownFileShareConfiguration.Serialization.cs | 110 + .../Models/UnknownFileShareConfiguration.cs | 29 + ...frastructureConfiguration.Serialization.cs | 116 + .../UnknownInfrastructureConfiguration.cs | 30 + .../UnknownOSConfiguration.Serialization.cs | 110 + .../Models/UnknownOSConfiguration.cs | 29 + .../UnknownSapConfiguration.Serialization.cs | 110 + .../Models/UnknownSapConfiguration.cs | 29 + ...izingRecommendationResult.Serialization.cs | 110 + .../UnknownSapSizingRecommendationResult.cs | 29 + ...ServerCustomResourceNames.Serialization.cs | 110 + .../UnknownSingleServerCustomResourceNames.cs | 29 + ...nownSoftwareConfiguration.Serialization.cs | 110 + .../Models/UnknownSoftwareConfiguration.cs | 29 + ...eeTierCustomResourceNames.Serialization.cs | 110 + .../UnknownThreeTierCustomResourceNames.cs | 29 + ...VirtualInstanceProperties.Serialization.cs | 133 + .../UpdateSapVirtualInstanceProperties.cs | 65 + ...rtualMachineConfiguration.Serialization.cs | 142 + .../Models/VirtualMachineConfiguration.cs | 89 + ...rtualMachineResourceNames.Serialization.cs | 230 ++ .../Models/VirtualMachineResourceNames.cs | 83 + .../WindowsConfiguration.Serialization.cs | 110 + .../Generated/Models/WindowsConfiguration.cs | 30 + .../src/Generated/ProviderConstants.cs | 16 + ...pplicationServerInstancesRestOperations.cs | 827 ++++ ...SapCentralServerInstancesRestOperations.cs | 827 ++++ .../SapDatabaseInstancesRestOperations.cs | 827 ++++ .../SapVirtualInstancesRestOperations.cs | 1281 ++++++ .../SapApplicationServerInstanceCollection.cs | 493 +++ ...icationServerInstanceData.Serialization.cs | 178 + .../SapApplicationServerInstanceData.cs | 83 + ...ionServerInstanceResource.Serialization.cs | 26 + .../SapApplicationServerInstanceResource.cs | 871 ++++ .../SapCentralServerInstanceCollection.cs | 493 +++ ...CentralServerInstanceData.Serialization.cs | 178 + .../Generated/SapCentralServerInstanceData.cs | 83 + ...ralServerInstanceResource.Serialization.cs | 26 + .../SapCentralServerInstanceResource.cs | 871 ++++ .../SapDatabaseInstanceCollection.cs | 493 +++ .../SapDatabaseInstanceData.Serialization.cs | 178 + .../src/Generated/SapDatabaseInstanceData.cs | 83 + ...pDatabaseInstanceResource.Serialization.cs | 26 + .../Generated/SapDatabaseInstanceResource.cs | 871 ++++ .../Generated/SapVirtualInstanceCollection.cs | 494 +++ .../SapVirtualInstanceData.Serialization.cs | 194 + .../src/Generated/SapVirtualInstanceData.cs | 87 + ...apVirtualInstanceResource.Serialization.cs | 26 + .../Generated/SapVirtualInstanceResource.cs | 1086 +++++ .../src/Properties/AssemblyInfo.cs | 11 + ...ceManager.SapVirtualInstances.Tests.csproj | 8 + .../SapVirtualInstancesManagementTestBase.cs | 45 + ...rtualInstancesManagementTestEnvironment.cs | 11 + .../tsp-location.yaml | 4 + sdk/workloadssapvirtualinstance/ci.mgmt.yml | 26 + 1834 files changed, 265239 insertions(+), 7293 deletions(-) create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityMetadataCollection.cs create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityMetadataResource.cs create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetMetadataCollection.cs create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetMetadataResource.cs rename sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/{ChaosCapabilityTypeCollection.cs => ChaosCapabilityMetadataCollection.cs} (55%) rename sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/{ChaosCapabilityTypeData.Serialization.cs => ChaosCapabilityMetadataData.Serialization.cs} (74%) rename sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/{ChaosCapabilityTypeData.cs => ChaosCapabilityMetadataData.cs} (77%) create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataResource.Serialization.cs rename sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/{ChaosCapabilityTypeResource.cs => ChaosCapabilityMetadataResource.cs} (57%) delete mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeResource.Serialization.cs rename sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/{ChaosTargetTypeCollection.cs => ChaosTargetMetadataCollection.cs} (57%) rename sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/{ChaosTargetTypeData.Serialization.cs => ChaosTargetMetadataData.Serialization.cs} (75%) rename sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/{ChaosTargetTypeData.cs => ChaosTargetMetadataData.cs} (80%) create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataResource.Serialization.cs rename sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/{ChaosTargetTypeResource.cs => ChaosTargetMetadataResource.cs} (59%) delete mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeResource.Serialization.cs rename sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/{ChaosCapabilityTypeRuntimeProperties.Serialization.cs => ChaosCapabilityMetadataRuntimeProperties.Serialization.cs} (62%) rename sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/{ChaosCapabilityTypeRuntimeProperties.cs => ChaosCapabilityMetadataRuntimeProperties.cs} (86%) create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentActionType.cs rename sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/{ChaosExperimentRunInformation.Serialization.cs => ExperimentExecutionDetailsPropertiesRunInformation.Serialization.cs} (61%) rename sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/{ChaosExperimentRunInformation.cs => ExperimentExecutionDetailsPropertiesRunInformation.cs} (79%) create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/ExperimentExecutionsRestOperations.cs delete mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/src/autorest.md create mode 100644 sdk/chaos/Azure.ResourceManager.Chaos/tsp-location.yaml create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResponse.Serialization.cs create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResponse.cs create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResponse.Serialization.cs create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResponse.cs create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.Serialization.cs create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.cs create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.Serialization.cs create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.cs create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.Serialization.cs create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.cs create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitCreateContent.Serialization.cs create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitCreateContent.cs create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeleteContent.Serialization.cs create mode 100644 sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeleteContent.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Azure.ResourceManager.DatabaseFleetManager.sln create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/CHANGELOG.md create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Directory.Build.props create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/README.md create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.net8.0.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.netstandard2.0.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/assets.json create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Azure.ResourceManager.DatabaseFleetManager.Samples.csproj create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Azure.ResourceManager.DatabaseFleetManager.csproj create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ArmDatabaseFleetManagerModelFactory.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/DatabaseFleetManagerExtensions.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerArmClient.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerResourceGroupResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerSubscriptionResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceCollection.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Argument.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Optional.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperation.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperationOfT.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FirewallRuleOperationSource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetDatabaseOperationSource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetOperationSource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetTierOperationSource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetspaceOperationSource.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/AzureProvisioningState.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseCreateMode.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityType.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/PrincipalType.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ResourceType.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.Serialization.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ZoneRedundancy.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ProviderConstants.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FirewallRulesRestOperations.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetDatabasesRestOperations.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetTiersRestOperations.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetsRestOperations.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetspacesRestOperations.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Properties/AssemblyInfo.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/Azure.ResourceManager.DatabaseFleetManager.Tests.csproj create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestBase.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestEnvironment.cs create mode 100644 sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tsp-location.yaml create mode 100644 sdk/databasefleetmanager/ci.mgmt.yml create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceFeature.Serialization.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceFeature.cs create mode 100644 sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceFeatureMode.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/Azure.ResourceManager.Migrate.sln create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/CHANGELOG.md create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/Directory.Build.props create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/README.md create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.net8.0.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.netstandard2.0.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/assets.json create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Azure.ResourceManager.Migrate.Samples.csproj create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Collection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Resource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Collection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Resource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Collection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Resource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Collection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Resource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Collection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Resource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Collection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Resource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Collection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Resource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Collection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Resource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Collection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Resource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Collection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Resource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Collection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Resource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Azure.ResourceManager.Migrate.csproj create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ArmMigrateModelFactory.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MigrateExtensions.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateArmClient.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateResourceGroupResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Argument.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Optional.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/CompoundAssessmentOperationSource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/DownloadUriOperationSource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperation.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperationOfT.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentSource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentStatus.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureManagementOfferingType.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureTarget.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CloudSuitabilityCommon.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostType.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrateWorkloadType.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationPlatform.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationType.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProvisioningState.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsOption.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsType.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SummaryType.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppType.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServerType.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ProviderConstants.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/CompoundAssessmentRestOperations.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/CompoundAssessmentSummaryRestOperations.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryCollection.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.Serialization.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/src/Properties/AssemblyInfo.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/tests/Azure.ResourceManager.Migrate.Tests.csproj create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/tests/MigrateManagementTestBase.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/tests/MigrateManagementTestEnvironment.cs create mode 100644 sdk/migrate/Azure.ResourceManager.Migrate/tsp-location.yaml create mode 100644 sdk/migrate/ci.mgmt.yml create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchCollection.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchData.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchData.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchResource.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchResource.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeCollection.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeData.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeData.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeResource.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeResource.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointCollection.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointData.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointData.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointResource.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointResource.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/BranchOperationSource.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/ComputeOperationSource.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/EndpointOperationSource.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonDatabaseOperationSource.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonRoleOperationSource.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/ProjectOperationSource.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointType.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseCollection.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseData.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseData.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseResource.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseResource.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleCollection.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleData.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleData.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleResource.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleResource.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectCollection.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectData.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectData.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectResource.Serialization.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectResource.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/BranchesRestOperations.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ComputesRestOperations.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/EndpointsRestOperations.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonDatabasesRestOperations.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonRolesRestOperations.cs create mode 100644 sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ProjectsRestOperations.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 create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ApexDetailsType.cs 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 create mode 100644 sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.Serialization.cs 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 delete mode 100644 sdk/pineconevectordb/ci.yml create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Azure.ResourceManager.RecoveryServicesDataReplication.sln create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/CHANGELOG.md create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Directory.Build.props create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/README.md create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.net8.0.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.netstandard2.0.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/assets.json create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Azure.ResourceManager.RecoveryServicesDataReplication.Samples.csproj create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResourceCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Azure.ResourceManager.RecoveryServicesDataReplication.csproj create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ArmRecoveryServicesDataReplicationModelFactory.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultCollection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationArmClient.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationResourceGroupResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationSubscriptionResource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationExtensions.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Argument.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Optional.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationExtensionOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricAgentOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationPolicyOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationProtectedItemOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationVaultOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PlannedFailoverOperationSource.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperation.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperationOfT.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciClusterProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciClusterProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthStatus.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobObjectType.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionStatus.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectionState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProvisioningState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointType.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationResynchronizationState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTestFailoverState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultType.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciDiskInput.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciDiskInput.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciNicInput.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciNicInput.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedDiskProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedDiskProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedNicProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedNicProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetailsType.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemActiveLocation.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciDiskInput.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciDiskInput.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciNicInput.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciNicInput.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedDiskProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedDiskProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedNicProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedNicProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzureMigrateResyncState.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.Serialization.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VmNicSelection.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProviderConstants.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/CheckNameAvailabilityRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/DeploymentPreflightRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EmailConfigurationRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EventRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricAgentRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/JobRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PolicyRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionProxiesRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ProtectedItemRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/RecoveryPointRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ReplicationExtensionRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/VaultRestOperations.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Properties/AssemblyInfo.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/Azure.ResourceManager.RecoveryServicesDataReplication.Tests.csproj create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestBase.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestEnvironment.cs create mode 100644 sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tsp-location.yaml create mode 100644 sdk/recoveryservicesdatareplication/ci.mgmt.yml create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_TenantResourceExtensions.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersTenantResource.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/LongRunningOperation/FaultSimulationOperationSource.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AvailableOperationDisplay.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AvailableOperationDisplay.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ErrorModelError.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ErrorModelError.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultKind.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulation.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulation.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationConstraints.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationConstraints.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContent.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContent.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContentWrapper.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContentWrapper.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationDetails.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationDetails.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationIdContent.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationIdContent.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationListResult.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationListResult.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationStatus.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/LongRunningOperationResult.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/LongRunningOperationResult.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFaultSimulation.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFaultSimulation.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationListResult.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationListResult.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationResult.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationResult.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/SecurityEncryptionType.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/SfmcOperationStatus.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownFaultSimulationContent.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownFaultSimulationContent.cs rename sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/{UnknownPartition.Serialization.cs => UnknownManagedServicePartitionScheme.Serialization.cs} (92%) rename sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/{UnknownPartition.cs => UnknownManagedServicePartitionScheme.cs} (50%) rename sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/{UnknownServicePlacementPolicy.Serialization.cs => UnknownManagedServicePlacementPolicy.Serialization.cs} (92%) create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServicePlacementPolicy.cs rename sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/{UnknownServiceResourceProperties.Serialization.cs => UnknownManagedServiceProperties.Serialization.cs} (96%) rename sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/{UnknownServiceResourceProperties.cs => UnknownManagedServiceProperties.cs} (74%) rename sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/{UnknownScalingMechanism.Serialization.cs => UnknownManagedServiceScalingMechanism.Serialization.cs} (92%) create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceScalingMechanism.cs rename sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/{UnknownScalingTrigger.Serialization.cs => UnknownManagedServiceScalingTrigger.Serialization.cs} (92%) rename sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/{UnknownScalingMechanism.cs => UnknownManagedServiceScalingTrigger.cs} (50%) delete mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownScalingTrigger.cs delete mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownServicePlacementPolicy.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesProtectedSettings.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesProtectedSettings.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesSettings.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesSettings.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ZoneFaultSimulationContent.Serialization.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ZoneFaultSimulationContent.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/OperationResultsRestOperations.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/OperationStatusRestOperations.cs create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/OperationsRestOperations.cs delete mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/autorest.md create mode 100644 sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/tsp-location.yaml create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Azure.ResourceManager.SapVirtualInstances.sln create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/CHANGELOG.md create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Directory.Build.props create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/README.md create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/assets.json create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Azure.ResourceManager.SapVirtualInstances.Samples.csproj create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceCollection.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceResource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceCollection.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceResource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceCollection.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceResource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceCollection.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceResource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Azure.ResourceManager.SapVirtualInstances.csproj create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/ArmSapVirtualInstancesModelFactory.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesArmClient.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesResourceGroupResource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesSubscriptionResource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/SapVirtualInstancesExtensions.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Argument.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ChangeTrackingDictionary.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ChangeTrackingList.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ModelSerializationExtensions.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Optional.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Utf8JsonRequestContent.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/OperationStatusResultOperationSource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapApplicationServerInstanceOperationSource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapCentralServerInstanceOperationSource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapDatabaseInstanceOperationSource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstanceOperationSource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperation.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperationOfT.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVirtualMachineType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVirtualMachineType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSkuName.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfigurationType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedResourcesNetworkAccessType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NamingPatternType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentityType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfigurationType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseScaleMethod.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDeploymentType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapEnvironmentType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHealthState.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHighAvailabilityType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapProductType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSoftwareInstallationType.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProvisioningState.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceState.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceStatus.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/ProviderConstants.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapApplicationServerInstancesRestOperations.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapCentralServerInstancesRestOperations.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapDatabaseInstancesRestOperations.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapVirtualInstancesRestOperations.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceCollection.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceCollection.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceCollection.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceCollection.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.Serialization.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Properties/AssemblyInfo.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/Azure.ResourceManager.SapVirtualInstances.Tests.csproj create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestBase.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestEnvironment.cs create mode 100644 sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tsp-location.yaml create mode 100644 sdk/workloadssapvirtualinstance/ci.mgmt.yml diff --git a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tsp-location.yaml b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tsp-location.yaml index d42f5de7a940..6ae337df2369 100644 --- a/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tsp-location.yaml +++ b/sdk/agricultureplatform/Azure.ResourceManager.AgriculturePlatform/tsp-location.yaml @@ -1,3 +1,4 @@ -directory: specification/agricultureplatform -commit: eeb0e92b55f6c56827df9e7d57f5e08bc633e077 -repo: Azure/azure-rest-api-specs \ No newline at end of file +directory: specification/agricultureplatform/AgriculturePlatform.Management +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/api/Azure.ResourceManager.Chaos.net8.0.cs b/sdk/chaos/Azure.ResourceManager.Chaos/api/Azure.ResourceManager.Chaos.net8.0.cs index 0bc6e73faea0..771f2cd7ddb8 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/api/Azure.ResourceManager.Chaos.net8.0.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/api/Azure.ResourceManager.Chaos.net8.0.cs @@ -32,75 +32,75 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ChaosCapabilityResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected ChaosCapabilityResource() { } - public virtual Azure.ResourceManager.Chaos.ChaosCapabilityData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.Chaos.ChaosCapabilityData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosCapabilityData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Chaos.ChaosCapabilityData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Chaos.ChaosCapabilityData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class ChaosCapabilityTypeCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + public partial class ChaosCapabilityMetadataCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { - protected ChaosCapabilityTypeCollection() { } + protected ChaosCapabilityMetadataCollection() { } public virtual Azure.Response Exists(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + public virtual Azure.Response Get(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class ChaosCapabilityTypeData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ChaosCapabilityMetadataData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ChaosCapabilityTypeData() { } - public System.Collections.Generic.IList AzureRbacActions { get { throw null; } } - public System.Collections.Generic.IList AzureRbacDataActions { get { throw null; } } + internal ChaosCapabilityMetadataData() { } + public System.Collections.Generic.IReadOnlyList AzureRbacActions { get { throw null; } } + public System.Collections.Generic.IReadOnlyList AzureRbacDataActions { get { throw null; } } public string Description { get { throw null; } } public string DisplayName { get { throw null; } } public string Kind { get { throw null; } } - public Azure.Core.AzureLocation? Location { get { throw null; } set { } } public string ParametersSchema { get { throw null; } } public string Publisher { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredAzureRoleDefinitionIds { get { throw null; } } public string RuntimeKind { get { throw null; } } public string TargetType { get { throw null; } } public string Urn { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosCapabilityTypeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosCapabilityTypeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Chaos.ChaosCapabilityMetadataData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Chaos.ChaosCapabilityMetadataData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ChaosCapabilityTypeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ChaosCapabilityMetadataResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; - protected ChaosCapabilityTypeResource() { } - public virtual Azure.ResourceManager.Chaos.ChaosCapabilityTypeData Data { get { throw null; } } + protected ChaosCapabilityMetadataResource() { } + public virtual Azure.ResourceManager.Chaos.ChaosCapabilityMetadataData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, Azure.Core.AzureLocation location, string targetTypeName, string capabilityTypeName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Chaos.ChaosCapabilityMetadataData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Chaos.ChaosCapabilityMetadataData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ChaosCapabilityResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ChaosCapabilityResource() { } + public virtual Azure.ResourceManager.Chaos.ChaosCapabilityData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string locationName, string targetTypeName, string capabilityTypeName) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.Chaos.ChaosCapabilityTypeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosCapabilityTypeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Chaos.ChaosCapabilityData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Chaos.ChaosCapabilityData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Chaos.ChaosCapabilityData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Chaos.ChaosCapabilityData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class ChaosExperimentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -212,8 +212,9 @@ protected ChaosExperimentResource() { } } public static partial class ChaosExtensions { + public static Azure.ResourceManager.Chaos.ChaosTargetMetadataCollection GetAllChaosTargetMetadata(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location) { throw null; } + public static Azure.ResourceManager.Chaos.ChaosCapabilityMetadataResource GetChaosCapabilityMetadataResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Chaos.ChaosCapabilityResource GetChaosCapabilityResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.Chaos.ChaosCapabilityTypeResource GetChaosCapabilityTypeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetChaosExperiment(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string experimentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetChaosExperimentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string experimentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.Chaos.ChaosExperimentExecutionResource GetChaosExperimentExecutionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -223,12 +224,11 @@ public static partial class ChaosExtensions public static Azure.AsyncPageable GetChaosExperimentsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, bool? running = default(bool?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetChaosTarget(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetChaosTargetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetChaosTargetMetadata(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetChaosTargetMetadataAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Chaos.ChaosTargetMetadataResource GetChaosTargetMetadataResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Chaos.ChaosTargetResource GetChaosTargetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Chaos.ChaosTargetCollection GetChaosTargets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName) { throw null; } - public static Azure.Response GetChaosTargetType(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetChaosTargetTypeAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.Chaos.ChaosTargetTypeResource GetChaosTargetTypeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.Chaos.ChaosTargetTypeCollection GetChaosTargetTypes(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName) { throw null; } } public partial class ChaosTargetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -259,6 +259,53 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ChaosTargetMetadataCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ChaosTargetMetadataCollection() { } + public virtual Azure.Response Exists(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ChaosTargetMetadataData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ChaosTargetMetadataData() { } + public string Description { get { throw null; } } + public string DisplayName { get { throw null; } } + public string PropertiesSchema { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ResourceTypes { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Chaos.ChaosTargetMetadataData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Chaos.ChaosTargetMetadataData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ChaosTargetMetadataResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ChaosTargetMetadataResource() { } + public virtual Azure.ResourceManager.Chaos.ChaosTargetMetadataData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, Azure.Core.AzureLocation location, string targetTypeName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Chaos.ChaosCapabilityMetadataCollection GetAllChaosCapabilityMetadata() { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetChaosCapabilityMetadata(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetChaosCapabilityMetadataAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Chaos.ChaosTargetMetadataData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Chaos.ChaosTargetMetadataData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ChaosTargetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; @@ -281,66 +328,18 @@ protected ChaosTargetResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Chaos.ChaosTargetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Chaos.ChaosTargetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } - public partial class ChaosTargetTypeCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected ChaosTargetTypeCollection() { } - public virtual Azure.Response Exists(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class ChaosTargetTypeData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public ChaosTargetTypeData() { } - public string Description { get { throw null; } } - public string DisplayName { get { throw null; } } - public Azure.Core.AzureLocation? Location { get { throw null; } set { } } - public string PropertiesSchema { get { throw null; } } - public System.Collections.Generic.IReadOnlyList ResourceTypes { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosTargetTypeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosTargetTypeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class ChaosTargetTypeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected ChaosTargetTypeResource() { } - public virtual Azure.ResourceManager.Chaos.ChaosTargetTypeData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string locationName, string targetTypeName) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetChaosCapabilityType(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetChaosCapabilityTypeAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.Chaos.ChaosCapabilityTypeCollection GetChaosCapabilityTypes() { throw null; } - Azure.ResourceManager.Chaos.ChaosTargetTypeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosTargetTypeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } } namespace Azure.ResourceManager.Chaos.Mocking { public partial class MockableChaosArmClient : Azure.ResourceManager.ArmResource { protected MockableChaosArmClient() { } + public virtual Azure.ResourceManager.Chaos.ChaosCapabilityMetadataResource GetChaosCapabilityMetadataResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Chaos.ChaosCapabilityResource GetChaosCapabilityResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.Chaos.ChaosCapabilityTypeResource GetChaosCapabilityTypeResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Chaos.ChaosExperimentExecutionResource GetChaosExperimentExecutionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Chaos.ChaosExperimentResource GetChaosExperimentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Chaos.ChaosTargetMetadataResource GetChaosTargetMetadataResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Chaos.ChaosTargetResource GetChaosTargetResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.Chaos.ChaosTargetTypeResource GetChaosTargetTypeResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableChaosResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -355,11 +354,11 @@ protected MockableChaosResourceGroupResource() { } public partial class MockableChaosSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockableChaosSubscriptionResource() { } + public virtual Azure.ResourceManager.Chaos.ChaosTargetMetadataCollection GetAllChaosTargetMetadata(Azure.Core.AzureLocation location) { throw null; } public virtual Azure.Pageable GetChaosExperiments(bool? running = default(bool?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetChaosExperimentsAsync(bool? running = default(bool?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetChaosTargetType(string locationName, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetChaosTargetTypeAsync(string locationName, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.Chaos.ChaosTargetTypeCollection GetChaosTargetTypes(string locationName) { throw null; } + public virtual Azure.Response GetChaosTargetMetadata(Azure.Core.AzureLocation location, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetChaosTargetMetadataAsync(Azure.Core.AzureLocation location, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.Chaos.Models @@ -367,14 +366,14 @@ namespace Azure.ResourceManager.Chaos.Models public static partial class ArmChaosModelFactory { public static Azure.ResourceManager.Chaos.ChaosCapabilityData ChaosCapabilityData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string publisher = null, string targetType = null, string description = null, string parametersSchema = null, string urn = null) { throw null; } - public static Azure.ResourceManager.Chaos.ChaosCapabilityTypeData ChaosCapabilityTypeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string publisher = null, string targetType = null, string displayName = null, string description = null, string parametersSchema = null, string urn = null, string kind = null, System.Collections.Generic.IEnumerable azureRbacActions = null, System.Collections.Generic.IEnumerable azureRbacDataActions = null, string runtimeKind = null) { throw null; } + public static Azure.ResourceManager.Chaos.ChaosCapabilityMetadataData ChaosCapabilityMetadataData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string publisher = null, string targetType = null, string displayName = null, string description = null, string parametersSchema = null, string urn = null, string kind = null, System.Collections.Generic.IEnumerable azureRbacActions = null, System.Collections.Generic.IEnumerable azureRbacDataActions = null, System.Collections.Generic.IEnumerable requiredAzureRoleDefinitionIds = null, string runtimeKind = null) { throw null; } public static Azure.ResourceManager.Chaos.ChaosExperimentData ChaosExperimentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Chaos.Models.ChaosProvisioningState? provisioningState = default(Azure.ResourceManager.Chaos.Models.ChaosProvisioningState?), System.Collections.Generic.IEnumerable steps = null, System.Collections.Generic.IEnumerable selectors = null) { throw null; } public static Azure.ResourceManager.Chaos.ChaosExperimentExecutionData ChaosExperimentExecutionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string status = null, System.DateTimeOffset? startedOn = default(System.DateTimeOffset?), System.DateTimeOffset? stoppedOn = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.Chaos.Models.ChaosExperimentRunActionStatus ChaosExperimentRunActionStatus(string actionName = null, string actionId = null, string status = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable targets = null) { throw null; } public static Azure.ResourceManager.Chaos.Models.ChaosExperimentRunBranchStatus ChaosExperimentRunBranchStatus(string branchName = null, string branchId = null, string status = null, System.Collections.Generic.IEnumerable actions = null) { throw null; } public static Azure.ResourceManager.Chaos.Models.ChaosExperimentRunStepStatus ChaosExperimentRunStepStatus(string stepName = null, string stepId = null, string status = null, System.Collections.Generic.IEnumerable branches = null) { throw null; } - public static Azure.ResourceManager.Chaos.ChaosTargetData ChaosTargetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary properties = null) { throw null; } - public static Azure.ResourceManager.Chaos.ChaosTargetTypeData ChaosTargetTypeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string displayName = null, string description = null, string propertiesSchema = null, System.Collections.Generic.IEnumerable resourceTypes = null) { throw null; } + public static Azure.ResourceManager.Chaos.ChaosTargetData ChaosTargetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary properties = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } + public static Azure.ResourceManager.Chaos.ChaosTargetMetadataData ChaosTargetMetadataData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string displayName = null, string description = null, string propertiesSchema = null, System.Collections.Generic.IEnumerable resourceTypes = null) { throw null; } public static Azure.ResourceManager.Chaos.Models.ExperimentExecutionActionTargetDetailsError ExperimentExecutionActionTargetDetailsError(string code = null, string message = null) { throw null; } public static Azure.ResourceManager.Chaos.Models.ExperimentExecutionActionTargetDetailsProperties ExperimentExecutionActionTargetDetailsProperties(string status = null, string target = null, System.DateTimeOffset? targetFailedOn = default(System.DateTimeOffset?), System.DateTimeOffset? targetCompletedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Chaos.Models.ExperimentExecutionActionTargetDetailsError error = null) { throw null; } public static Azure.ResourceManager.Chaos.Models.ExperimentExecutionDetails ExperimentExecutionDetails(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string status = null, System.DateTimeOffset? startedOn = default(System.DateTimeOffset?), System.DateTimeOffset? stoppedOn = default(System.DateTimeOffset?), string failureReason = null, System.DateTimeOffset? lastActionOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable runInformationSteps = null) { throw null; } @@ -605,7 +604,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public abstract partial class ChaosTargetSelector : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected ChaosTargetSelector(string id) { } - public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } public Azure.ResourceManager.Chaos.Models.ChaosTargetFilter Filter { get { throw null; } set { } } public string Id { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/api/Azure.ResourceManager.Chaos.netstandard2.0.cs b/sdk/chaos/Azure.ResourceManager.Chaos/api/Azure.ResourceManager.Chaos.netstandard2.0.cs index 0bc6e73faea0..771f2cd7ddb8 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/api/Azure.ResourceManager.Chaos.netstandard2.0.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/api/Azure.ResourceManager.Chaos.netstandard2.0.cs @@ -32,75 +32,75 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ChaosCapabilityResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected ChaosCapabilityResource() { } - public virtual Azure.ResourceManager.Chaos.ChaosCapabilityData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.Chaos.ChaosCapabilityData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosCapabilityData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Chaos.ChaosCapabilityData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Chaos.ChaosCapabilityData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - } - public partial class ChaosCapabilityTypeCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + public partial class ChaosCapabilityMetadataCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { - protected ChaosCapabilityTypeCollection() { } + protected ChaosCapabilityMetadataCollection() { } public virtual Azure.Response Exists(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> ExistsAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + public virtual Azure.Response Get(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } } - public partial class ChaosCapabilityTypeData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ChaosCapabilityMetadataData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { - public ChaosCapabilityTypeData() { } - public System.Collections.Generic.IList AzureRbacActions { get { throw null; } } - public System.Collections.Generic.IList AzureRbacDataActions { get { throw null; } } + internal ChaosCapabilityMetadataData() { } + public System.Collections.Generic.IReadOnlyList AzureRbacActions { get { throw null; } } + public System.Collections.Generic.IReadOnlyList AzureRbacDataActions { get { throw null; } } public string Description { get { throw null; } } public string DisplayName { get { throw null; } } public string Kind { get { throw null; } } - public Azure.Core.AzureLocation? Location { get { throw null; } set { } } public string ParametersSchema { get { throw null; } } public string Publisher { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredAzureRoleDefinitionIds { get { throw null; } } public string RuntimeKind { get { throw null; } } public string TargetType { get { throw null; } } public string Urn { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosCapabilityTypeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosCapabilityTypeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + Azure.ResourceManager.Chaos.ChaosCapabilityMetadataData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Chaos.ChaosCapabilityMetadataData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } - public partial class ChaosCapabilityTypeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + public partial class ChaosCapabilityMetadataResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; - protected ChaosCapabilityTypeResource() { } - public virtual Azure.ResourceManager.Chaos.ChaosCapabilityTypeData Data { get { throw null; } } + protected ChaosCapabilityMetadataResource() { } + public virtual Azure.ResourceManager.Chaos.ChaosCapabilityMetadataData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, Azure.Core.AzureLocation location, string targetTypeName, string capabilityTypeName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Chaos.ChaosCapabilityMetadataData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Chaos.ChaosCapabilityMetadataData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ChaosCapabilityResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ChaosCapabilityResource() { } + public virtual Azure.ResourceManager.Chaos.ChaosCapabilityData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string locationName, string targetTypeName, string capabilityTypeName) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - Azure.ResourceManager.Chaos.ChaosCapabilityTypeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosCapabilityTypeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Chaos.ChaosCapabilityData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Chaos.ChaosCapabilityData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Chaos.ChaosCapabilityData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Chaos.ChaosCapabilityData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class ChaosExperimentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -212,8 +212,9 @@ protected ChaosExperimentResource() { } } public static partial class ChaosExtensions { + public static Azure.ResourceManager.Chaos.ChaosTargetMetadataCollection GetAllChaosTargetMetadata(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location) { throw null; } + public static Azure.ResourceManager.Chaos.ChaosCapabilityMetadataResource GetChaosCapabilityMetadataResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Chaos.ChaosCapabilityResource GetChaosCapabilityResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.Chaos.ChaosCapabilityTypeResource GetChaosCapabilityTypeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetChaosExperiment(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string experimentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetChaosExperimentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string experimentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.Chaos.ChaosExperimentExecutionResource GetChaosExperimentExecutionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -223,12 +224,11 @@ public static partial class ChaosExtensions public static Azure.AsyncPageable GetChaosExperimentsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, bool? running = default(bool?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Response GetChaosTarget(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetChaosTargetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response GetChaosTargetMetadata(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetChaosTargetMetadataAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Chaos.ChaosTargetMetadataResource GetChaosTargetMetadataResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Chaos.ChaosTargetResource GetChaosTargetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.Chaos.ChaosTargetCollection GetChaosTargets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName) { throw null; } - public static Azure.Response GetChaosTargetType(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static System.Threading.Tasks.Task> GetChaosTargetTypeAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public static Azure.ResourceManager.Chaos.ChaosTargetTypeResource GetChaosTargetTypeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } - public static Azure.ResourceManager.Chaos.ChaosTargetTypeCollection GetChaosTargetTypes(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, string locationName) { throw null; } } public partial class ChaosTargetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { @@ -259,6 +259,53 @@ protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter write string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class ChaosTargetMetadataCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ChaosTargetMetadataCollection() { } + public virtual Azure.Response Exists(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ChaosTargetMetadataData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ChaosTargetMetadataData() { } + public string Description { get { throw null; } } + public string DisplayName { get { throw null; } } + public string PropertiesSchema { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ResourceTypes { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Chaos.ChaosTargetMetadataData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Chaos.ChaosTargetMetadataData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ChaosTargetMetadataResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ChaosTargetMetadataResource() { } + public virtual Azure.ResourceManager.Chaos.ChaosTargetMetadataData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, Azure.Core.AzureLocation location, string targetTypeName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Chaos.ChaosCapabilityMetadataCollection GetAllChaosCapabilityMetadata() { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetChaosCapabilityMetadata(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetChaosCapabilityMetadataAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Chaos.ChaosTargetMetadataData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Chaos.ChaosTargetMetadataData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class ChaosTargetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public static readonly Azure.Core.ResourceType ResourceType; @@ -281,66 +328,18 @@ protected ChaosTargetResource() { } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Chaos.ChaosTargetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Chaos.ChaosTargetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } - public partial class ChaosTargetTypeCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable - { - protected ChaosTargetTypeCollection() { } - public virtual Azure.Response Exists(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> ExistsAsync(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response Get(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.NullableResponse GetIfExists(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } - System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } - } - public partial class ChaosTargetTypeData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public ChaosTargetTypeData() { } - public string Description { get { throw null; } } - public string DisplayName { get { throw null; } } - public Azure.Core.AzureLocation? Location { get { throw null; } set { } } - public string PropertiesSchema { get { throw null; } } - public System.Collections.Generic.IReadOnlyList ResourceTypes { get { throw null; } } - protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosTargetTypeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosTargetTypeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } - public partial class ChaosTargetTypeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel - { - public static readonly Azure.Core.ResourceType ResourceType; - protected ChaosTargetTypeResource() { } - public virtual Azure.ResourceManager.Chaos.ChaosTargetTypeData Data { get { throw null; } } - public virtual bool HasData { get { throw null; } } - public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string locationName, string targetTypeName) { throw null; } - public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetChaosCapabilityType(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetChaosCapabilityTypeAsync(string capabilityTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.Chaos.ChaosCapabilityTypeCollection GetChaosCapabilityTypes() { throw null; } - Azure.ResourceManager.Chaos.ChaosTargetTypeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } - Azure.ResourceManager.Chaos.ChaosTargetTypeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } - } } namespace Azure.ResourceManager.Chaos.Mocking { public partial class MockableChaosArmClient : Azure.ResourceManager.ArmResource { protected MockableChaosArmClient() { } + public virtual Azure.ResourceManager.Chaos.ChaosCapabilityMetadataResource GetChaosCapabilityMetadataResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Chaos.ChaosCapabilityResource GetChaosCapabilityResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.Chaos.ChaosCapabilityTypeResource GetChaosCapabilityTypeResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Chaos.ChaosExperimentExecutionResource GetChaosExperimentExecutionResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Chaos.ChaosExperimentResource GetChaosExperimentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Chaos.ChaosTargetMetadataResource GetChaosTargetMetadataResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.Chaos.ChaosTargetResource GetChaosTargetResource(Azure.Core.ResourceIdentifier id) { throw null; } - public virtual Azure.ResourceManager.Chaos.ChaosTargetTypeResource GetChaosTargetTypeResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableChaosResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -355,11 +354,11 @@ protected MockableChaosResourceGroupResource() { } public partial class MockableChaosSubscriptionResource : Azure.ResourceManager.ArmResource { protected MockableChaosSubscriptionResource() { } + public virtual Azure.ResourceManager.Chaos.ChaosTargetMetadataCollection GetAllChaosTargetMetadata(Azure.Core.AzureLocation location) { throw null; } public virtual Azure.Pageable GetChaosExperiments(bool? running = default(bool?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.AsyncPageable GetChaosExperimentsAsync(bool? running = default(bool?), string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.Response GetChaosTargetType(string locationName, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual System.Threading.Tasks.Task> GetChaosTargetTypeAsync(string locationName, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } - public virtual Azure.ResourceManager.Chaos.ChaosTargetTypeCollection GetChaosTargetTypes(string locationName) { throw null; } + public virtual Azure.Response GetChaosTargetMetadata(Azure.Core.AzureLocation location, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetChaosTargetMetadataAsync(Azure.Core.AzureLocation location, string targetTypeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.Chaos.Models @@ -367,14 +366,14 @@ namespace Azure.ResourceManager.Chaos.Models public static partial class ArmChaosModelFactory { public static Azure.ResourceManager.Chaos.ChaosCapabilityData ChaosCapabilityData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string publisher = null, string targetType = null, string description = null, string parametersSchema = null, string urn = null) { throw null; } - public static Azure.ResourceManager.Chaos.ChaosCapabilityTypeData ChaosCapabilityTypeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string publisher = null, string targetType = null, string displayName = null, string description = null, string parametersSchema = null, string urn = null, string kind = null, System.Collections.Generic.IEnumerable azureRbacActions = null, System.Collections.Generic.IEnumerable azureRbacDataActions = null, string runtimeKind = null) { throw null; } + public static Azure.ResourceManager.Chaos.ChaosCapabilityMetadataData ChaosCapabilityMetadataData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string publisher = null, string targetType = null, string displayName = null, string description = null, string parametersSchema = null, string urn = null, string kind = null, System.Collections.Generic.IEnumerable azureRbacActions = null, System.Collections.Generic.IEnumerable azureRbacDataActions = null, System.Collections.Generic.IEnumerable requiredAzureRoleDefinitionIds = null, string runtimeKind = null) { throw null; } public static Azure.ResourceManager.Chaos.ChaosExperimentData ChaosExperimentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null, Azure.ResourceManager.Chaos.Models.ChaosProvisioningState? provisioningState = default(Azure.ResourceManager.Chaos.Models.ChaosProvisioningState?), System.Collections.Generic.IEnumerable steps = null, System.Collections.Generic.IEnumerable selectors = null) { throw null; } public static Azure.ResourceManager.Chaos.ChaosExperimentExecutionData ChaosExperimentExecutionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string status = null, System.DateTimeOffset? startedOn = default(System.DateTimeOffset?), System.DateTimeOffset? stoppedOn = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.Chaos.Models.ChaosExperimentRunActionStatus ChaosExperimentRunActionStatus(string actionName = null, string actionId = null, string status = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable targets = null) { throw null; } public static Azure.ResourceManager.Chaos.Models.ChaosExperimentRunBranchStatus ChaosExperimentRunBranchStatus(string branchName = null, string branchId = null, string status = null, System.Collections.Generic.IEnumerable actions = null) { throw null; } public static Azure.ResourceManager.Chaos.Models.ChaosExperimentRunStepStatus ChaosExperimentRunStepStatus(string stepName = null, string stepId = null, string status = null, System.Collections.Generic.IEnumerable branches = null) { throw null; } - public static Azure.ResourceManager.Chaos.ChaosTargetData ChaosTargetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), System.Collections.Generic.IDictionary properties = null) { throw null; } - public static Azure.ResourceManager.Chaos.ChaosTargetTypeData ChaosTargetTypeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), string displayName = null, string description = null, string propertiesSchema = null, System.Collections.Generic.IEnumerable resourceTypes = null) { throw null; } + public static Azure.ResourceManager.Chaos.ChaosTargetData ChaosTargetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary properties = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?)) { throw null; } + public static Azure.ResourceManager.Chaos.ChaosTargetMetadataData ChaosTargetMetadataData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string displayName = null, string description = null, string propertiesSchema = null, System.Collections.Generic.IEnumerable resourceTypes = null) { throw null; } public static Azure.ResourceManager.Chaos.Models.ExperimentExecutionActionTargetDetailsError ExperimentExecutionActionTargetDetailsError(string code = null, string message = null) { throw null; } public static Azure.ResourceManager.Chaos.Models.ExperimentExecutionActionTargetDetailsProperties ExperimentExecutionActionTargetDetailsProperties(string status = null, string target = null, System.DateTimeOffset? targetFailedOn = default(System.DateTimeOffset?), System.DateTimeOffset? targetCompletedOn = default(System.DateTimeOffset?), Azure.ResourceManager.Chaos.Models.ExperimentExecutionActionTargetDetailsError error = null) { throw null; } public static Azure.ResourceManager.Chaos.Models.ExperimentExecutionDetails ExperimentExecutionDetails(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string status = null, System.DateTimeOffset? startedOn = default(System.DateTimeOffset?), System.DateTimeOffset? stoppedOn = default(System.DateTimeOffset?), string failureReason = null, System.DateTimeOffset? lastActionOn = default(System.DateTimeOffset?), System.Collections.Generic.IEnumerable runInformationSteps = null) { throw null; } @@ -605,7 +604,6 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public abstract partial class ChaosTargetSelector : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected ChaosTargetSelector(string id) { } - public System.Collections.Generic.IDictionary AdditionalProperties { get { throw null; } } public Azure.ResourceManager.Chaos.Models.ChaosTargetFilter Filter { get { throw null; } set { } } public string Id { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityCollection.cs b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityCollection.cs index 05c4c232eb51..72e059140ea9 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityCollection.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityCollection.cs @@ -19,8 +19,8 @@ public partial class Sample_ChaosCapabilityCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateACapabilityThatExtendsAVirtualMachineTargetResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CreateUpdateCapability.json - // this example is just showing the usage of "Capabilities_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Capabilities_CreateOrUpdate.json + // this example is just showing the usage of "Capability_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(); @@ -58,8 +58,8 @@ public async Task CreateOrUpdate_CreateUpdateACapabilityThatExtendsAVirtualMachi [Ignore("Only validating compilation of examples")] public async Task Get_GetACapabilityThatExtendsAVirtualMachineTargetResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetCapability.json - // this example is just showing the usage of "Capabilities_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Capabilities_Get.json + // this example is just showing the usage of "Capability_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -95,8 +95,8 @@ public async Task Get_GetACapabilityThatExtendsAVirtualMachineTargetResource() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAllCapabilitiesThatExtendAVirtualMachineTargetResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListCapabilities.json - // this example is just showing the usage of "Capabilities_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Capabilities_List.json + // this example is just showing the usage of "Capability_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -134,8 +134,8 @@ public async Task GetAll_ListAllCapabilitiesThatExtendAVirtualMachineTargetResou [Ignore("Only validating compilation of examples")] public async Task Exists_GetACapabilityThatExtendsAVirtualMachineTargetResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetCapability.json - // this example is just showing the usage of "Capabilities_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Capabilities_Get.json + // this example is just showing the usage of "Capability_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -167,8 +167,8 @@ public async Task Exists_GetACapabilityThatExtendsAVirtualMachineTargetResource( [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetACapabilityThatExtendsAVirtualMachineTargetResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetCapability.json - // this example is just showing the usage of "Capabilities_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Capabilities_Get.json + // this example is just showing the usage of "Capability_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityMetadataCollection.cs b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityMetadataCollection.cs new file mode 100644 index 000000000000..e42dd630ef59 --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityMetadataCollection.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.Chaos.Samples +{ + public partial class Sample_ChaosCapabilityMetadataCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetACapabilityTypeForAVirtualMachineTargetResourceOnWestus2Location() + { + // Generated from example definition: 2025-01-01/CapabilityTypes_Get.json + // this example is just showing the usage of "CapabilityType_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ChaosTargetMetadataResource created on azure + // for more information of creating ChaosTargetMetadataResource, please refer to the document of ChaosTargetMetadataResource + string subscriptionId = "6b052e15-03d3-4f17-b2e1-be7f07588291"; + AzureLocation location = new AzureLocation("westus2"); + string targetTypeName = "Microsoft-VirtualMachine"; + ResourceIdentifier chaosTargetMetadataResourceId = ChaosTargetMetadataResource.CreateResourceIdentifier(subscriptionId, location, targetTypeName); + ChaosTargetMetadataResource chaosTargetMetadata = client.GetChaosTargetMetadataResource(chaosTargetMetadataResourceId); + + // get the collection of this ChaosCapabilityMetadataResource + ChaosCapabilityMetadataCollection collection = chaosTargetMetadata.GetAllChaosCapabilityMetadata(); + + // invoke the operation + string capabilityTypeName = "Shutdown-1.0"; + ChaosCapabilityMetadataResource result = await collection.GetAsync(capabilityTypeName); + + // 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 + ChaosCapabilityMetadataData 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_ListAllCapabilityTypesForAVirtualMachineTargetResourceOnWestus2Location() + { + // Generated from example definition: 2025-01-01/CapabilityTypes_List.json + // this example is just showing the usage of "CapabilityType_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ChaosTargetMetadataResource created on azure + // for more information of creating ChaosTargetMetadataResource, please refer to the document of ChaosTargetMetadataResource + string subscriptionId = "6b052e15-03d3-4f17-b2e1-be7f07588291"; + AzureLocation location = new AzureLocation("westus2"); + string targetTypeName = "Microsoft-VirtualMachine"; + ResourceIdentifier chaosTargetMetadataResourceId = ChaosTargetMetadataResource.CreateResourceIdentifier(subscriptionId, location, targetTypeName); + ChaosTargetMetadataResource chaosTargetMetadata = client.GetChaosTargetMetadataResource(chaosTargetMetadataResourceId); + + // get the collection of this ChaosCapabilityMetadataResource + ChaosCapabilityMetadataCollection collection = chaosTargetMetadata.GetAllChaosCapabilityMetadata(); + + // invoke the operation and iterate over the result + await foreach (ChaosCapabilityMetadataResource 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 + ChaosCapabilityMetadataData 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_GetACapabilityTypeForAVirtualMachineTargetResourceOnWestus2Location() + { + // Generated from example definition: 2025-01-01/CapabilityTypes_Get.json + // this example is just showing the usage of "CapabilityType_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ChaosTargetMetadataResource created on azure + // for more information of creating ChaosTargetMetadataResource, please refer to the document of ChaosTargetMetadataResource + string subscriptionId = "6b052e15-03d3-4f17-b2e1-be7f07588291"; + AzureLocation location = new AzureLocation("westus2"); + string targetTypeName = "Microsoft-VirtualMachine"; + ResourceIdentifier chaosTargetMetadataResourceId = ChaosTargetMetadataResource.CreateResourceIdentifier(subscriptionId, location, targetTypeName); + ChaosTargetMetadataResource chaosTargetMetadata = client.GetChaosTargetMetadataResource(chaosTargetMetadataResourceId); + + // get the collection of this ChaosCapabilityMetadataResource + ChaosCapabilityMetadataCollection collection = chaosTargetMetadata.GetAllChaosCapabilityMetadata(); + + // invoke the operation + string capabilityTypeName = "Shutdown-1.0"; + bool result = await collection.ExistsAsync(capabilityTypeName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetACapabilityTypeForAVirtualMachineTargetResourceOnWestus2Location() + { + // Generated from example definition: 2025-01-01/CapabilityTypes_Get.json + // this example is just showing the usage of "CapabilityType_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ChaosTargetMetadataResource created on azure + // for more information of creating ChaosTargetMetadataResource, please refer to the document of ChaosTargetMetadataResource + string subscriptionId = "6b052e15-03d3-4f17-b2e1-be7f07588291"; + AzureLocation location = new AzureLocation("westus2"); + string targetTypeName = "Microsoft-VirtualMachine"; + ResourceIdentifier chaosTargetMetadataResourceId = ChaosTargetMetadataResource.CreateResourceIdentifier(subscriptionId, location, targetTypeName); + ChaosTargetMetadataResource chaosTargetMetadata = client.GetChaosTargetMetadataResource(chaosTargetMetadataResourceId); + + // get the collection of this ChaosCapabilityMetadataResource + ChaosCapabilityMetadataCollection collection = chaosTargetMetadata.GetAllChaosCapabilityMetadata(); + + // invoke the operation + string capabilityTypeName = "Shutdown-1.0"; + NullableResponse response = await collection.GetIfExistsAsync(capabilityTypeName); + ChaosCapabilityMetadataResource 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 + ChaosCapabilityMetadataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityMetadataResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityMetadataResource.cs new file mode 100644 index 000000000000..a6492cef353f --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityMetadataResource.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.Chaos.Samples +{ + public partial class Sample_ChaosCapabilityMetadataResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetACapabilityTypeForAVirtualMachineTargetResourceOnWestus2Location() + { + // Generated from example definition: 2025-01-01/CapabilityTypes_Get.json + // this example is just showing the usage of "CapabilityType_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ChaosCapabilityMetadataResource created on azure + // for more information of creating ChaosCapabilityMetadataResource, please refer to the document of ChaosCapabilityMetadataResource + string subscriptionId = "6b052e15-03d3-4f17-b2e1-be7f07588291"; + AzureLocation location = new AzureLocation("westus2"); + string targetTypeName = "Microsoft-VirtualMachine"; + string capabilityTypeName = "Shutdown-1.0"; + ResourceIdentifier chaosCapabilityMetadataResourceId = ChaosCapabilityMetadataResource.CreateResourceIdentifier(subscriptionId, location, targetTypeName, capabilityTypeName); + ChaosCapabilityMetadataResource chaosCapabilityMetadata = client.GetChaosCapabilityMetadataResource(chaosCapabilityMetadataResourceId); + + // invoke the operation + ChaosCapabilityMetadataResource result = await chaosCapabilityMetadata.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 + ChaosCapabilityMetadataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityResource.cs index 960a1549b3a9..722991fd4e8d 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosCapabilityResource.cs @@ -19,8 +19,8 @@ public partial class Sample_ChaosCapabilityResource [Ignore("Only validating compilation of examples")] public async Task Get_GetACapabilityThatExtendsAVirtualMachineTargetResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetCapability.json - // this example is just showing the usage of "Capabilities_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Capabilities_Get.json + // this example is just showing the usage of "Capability_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -53,8 +53,8 @@ public async Task Get_GetACapabilityThatExtendsAVirtualMachineTargetResource() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteACapabilityThatExtendsAVirtualMachineTargetResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/DeleteCapability.json - // this example is just showing the usage of "Capabilities_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Capabilities_Delete.json + // this example is just showing the usage of "Capability_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(); @@ -83,8 +83,8 @@ public async Task Delete_DeleteACapabilityThatExtendsAVirtualMachineTargetResour [Ignore("Only validating compilation of examples")] public async Task Update_CreateUpdateACapabilityThatExtendsAVirtualMachineTargetResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CreateUpdateCapability.json - // this example is just showing the usage of "Capabilities_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Capabilities_CreateOrUpdate.json + // this example is just showing the usage of "Capability_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(); diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentCollection.cs b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentCollection.cs index 3b612ed83a8c..038403ca5d40 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentCollection.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentCollection.cs @@ -6,8 +6,8 @@ #nullable disable using System; +using System.Collections.Generic; using System.Threading.Tasks; -using System.Xml; using Azure.Core; using Azure.Identity; using Azure.ResourceManager.Chaos.Models; @@ -23,8 +23,8 @@ public partial class Sample_ChaosExperimentCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateAExperimentInAResourceGroup() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CreateUpdateExperiment.json - // this example is just showing the usage of "Experiments_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_CreateOrUpdate.json + // this example is just showing the usage of "Experiment_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(); @@ -43,27 +43,14 @@ public async Task CreateOrUpdate_CreateUpdateAExperimentInAResourceGroup() // invoke the operation string experimentName = "exampleExperiment"; - ChaosExperimentData data = new ChaosExperimentData(new AzureLocation("eastus2euap"), new ChaosExperimentStep[] - { -new ChaosExperimentStep("step1", new ChaosExperimentBranch[] -{ -new ChaosExperimentBranch("branch1", new ChaosExperimentAction[] -{ -new ChaosContinuousAction("urn:csci:microsoft:virtualMachine:shutdown/1.0", XmlConvert.ToTimeSpan("PT10M"), new ChaosKeyValuePair[] -{ -new ChaosKeyValuePair("abruptShutdown", "false") -}, "selector1") -}) -}) - }, new ChaosTargetSelector[] - { -new ChaosTargetListSelector("selector1", new ChaosTargetReference[] -{ -new ChaosTargetReference(ChaosTargetReferenceType.ChaosTarget, new ResourceIdentifier("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine")) -}) - }) + ChaosExperimentData data = new ChaosExperimentData(new AzureLocation("eastus2euap"), null, null) { Identity = new ManagedServiceIdentity("SystemAssigned"), + Tags = +{ +["key7131"] = "ryohwcoiccwsnewjigfmijz", +["key2138"] = "fjaeecgnvqd" +}, }; ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, experimentName, data); ChaosExperimentResource result = lro.Value; @@ -79,8 +66,8 @@ public async Task CreateOrUpdate_CreateUpdateAExperimentInAResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Get_GetAExperimentInAResourceGroup() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetExperiment.json - // this example is just showing the usage of "Experiments_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_Get.json + // this example is just showing the usage of "Experiment_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -112,8 +99,8 @@ public async Task Get_GetAExperimentInAResourceGroup() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAllExperimentsInAResourceGroup() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListExperimentsInAResourceGroup.json - // this example is just showing the usage of "Experiments_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_List.json + // this example is just showing the usage of "Experiment_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -131,8 +118,7 @@ public async Task GetAll_ListAllExperimentsInAResourceGroup() ChaosExperimentCollection collection = resourceGroupResource.GetChaosExperiments(); // invoke the operation and iterate over the result - string continuationToken = null; - await foreach (ChaosExperimentResource item in collection.GetAllAsync(continuationToken: continuationToken)) + await foreach (ChaosExperimentResource 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 @@ -148,8 +134,8 @@ public async Task GetAll_ListAllExperimentsInAResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAExperimentInAResourceGroup() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetExperiment.json - // this example is just showing the usage of "Experiments_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_Get.json + // this example is just showing the usage of "Experiment_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -177,8 +163,8 @@ public async Task Exists_GetAExperimentInAResourceGroup() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAExperimentInAResourceGroup() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetExperiment.json - // this example is just showing the usage of "Experiments_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_Get.json + // this example is just showing the usage of "Experiment_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentExecutionCollection.cs b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentExecutionCollection.cs index 05e7b206e173..322c11e6d23e 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentExecutionCollection.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentExecutionCollection.cs @@ -19,8 +19,8 @@ public partial class Sample_ChaosExperimentExecutionCollection [Ignore("Only validating compilation of examples")] public async Task Get_GetTheExecutionOfAExperiment() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetExperimentExecution.json - // this example is just showing the usage of "Experiments_GetExecution" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_GetExecution.json + // this example is just showing the usage of "ExperimentExecution_GetExecution" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -53,8 +53,8 @@ public async Task Get_GetTheExecutionOfAExperiment() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAllExecutionsOfAnExperiment() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListExperimentExecutions.json - // this example is just showing the usage of "Experiments_ListAllExecutions" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_ListAllExecutions.json + // this example is just showing the usage of "ExperimentExecution_ListAllExecutions" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK 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,8 +89,8 @@ public async Task GetAll_ListAllExecutionsOfAnExperiment() [Ignore("Only validating compilation of examples")] public async Task Exists_GetTheExecutionOfAExperiment() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetExperimentExecution.json - // this example is just showing the usage of "Experiments_GetExecution" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_GetExecution.json + // this example is just showing the usage of "ExperimentExecution_GetExecution" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -119,8 +119,8 @@ public async Task Exists_GetTheExecutionOfAExperiment() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetTheExecutionOfAExperiment() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetExperimentExecution.json - // this example is just showing the usage of "Experiments_GetExecution" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_GetExecution.json + // this example is just showing the usage of "ExperimentExecution_GetExecution" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentExecutionResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentExecutionResource.cs index e27d10e20256..6cbf5076bc13 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentExecutionResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentExecutionResource.cs @@ -20,8 +20,8 @@ public partial class Sample_ChaosExperimentExecutionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetTheExecutionOfAExperiment() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetExperimentExecution.json - // this example is just showing the usage of "Experiments_GetExecution" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_GetExecution.json + // this example is just showing the usage of "ExperimentExecution_GetExecution" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -51,8 +51,8 @@ public async Task Get_GetTheExecutionOfAExperiment() [Ignore("Only validating compilation of examples")] public async Task ExecutionDetails_GetExperimentExecutionDetails() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/DetailsExperiment.json - // this example is just showing the usage of "Experiments_ExecutionDetails" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_ExecutionDetails.json + // this example is just showing the usage of "ExperimentExecutions_ExecutionDetails" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentResource.cs index 2596570569f0..499fcfbde169 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosExperimentResource.cs @@ -21,8 +21,8 @@ public partial class Sample_ChaosExperimentResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAExperimentInAResourceGroup() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetExperiment.json - // this example is just showing the usage of "Experiments_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_Get.json + // this example is just showing the usage of "Experiment_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -51,8 +51,8 @@ public async Task Get_GetAExperimentInAResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAExperimentInAResourceGroup() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/DeleteExperiment.json - // this example is just showing the usage of "Experiments_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_Delete.json + // this example is just showing the usage of "Experiment_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(); @@ -77,8 +77,8 @@ public async Task Delete_DeleteAExperimentInAResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Update_UpdateAnExperimentInAResourceGroup() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/UpdateExperiment.json - // this example is just showing the usage of "Experiments_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_Update.json + // this example is just showing the usage of "Experiment_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(); @@ -96,6 +96,11 @@ public async Task Update_UpdateAnExperimentInAResourceGroup() // invoke the operation ChaosExperimentPatch patch = new ChaosExperimentPatch { + Tags = +{ +["key1"] = "value1", +["key2"] = "value2" +}, Identity = new ManagedServiceIdentity("UserAssigned") { UserAssignedIdentities = @@ -103,11 +108,6 @@ public async Task Update_UpdateAnExperimentInAResourceGroup() [new ResourceIdentifier("/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.ManagedIdentity/userAssignedIdentity/exampleUMI")] = new UserAssignedIdentity() }, }, - Tags = -{ -["key1"] = "value1", -["key2"] = "value2" -}, }; ArmOperation lro = await chaosExperiment.UpdateAsync(WaitUntil.Completed, patch); ChaosExperimentResource result = lro.Value; @@ -123,7 +123,7 @@ public async Task Update_UpdateAnExperimentInAResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Cancel_CancelARunningExperiment() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CancelExperiment.json + // Generated from example definition: 2025-01-01/Experiments_Cancel.json // this example is just showing the usage of "Experiments_Cancel" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -149,7 +149,7 @@ public async Task Cancel_CancelARunningExperiment() [Ignore("Only validating compilation of examples")] public async Task Start_StartAExperiment() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/StartExperiment.json + // Generated from example definition: 2025-01-01/Experiments_Start.json // this example is just showing the usage of "Experiments_Start" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetCollection.cs b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetCollection.cs index e52ec080f07d..0048362fb9ec 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetCollection.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetCollection.cs @@ -21,8 +21,8 @@ public partial class Sample_ChaosTargetCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_CreateUpdateATargetThatExtendsAVirtualMachineResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CreateUpdateTarget.json - // this example is just showing the usage of "Targets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Targets_CreateOrUpdate.json + // this example is just showing the usage of "Target_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(); @@ -43,18 +43,8 @@ public async Task CreateOrUpdate_CreateUpdateATargetThatExtendsAVirtualMachineRe ChaosTargetCollection collection = resourceGroupResource.GetChaosTargets(parentProviderNamespace, parentResourceType, parentResourceName); // invoke the operation - string targetName = "Microsoft-Agent"; - ChaosTargetData data = new ChaosTargetData(new Dictionary - { - ["identities"] = BinaryData.FromObjectAsJson(new object[] - { -new -{ -type = "CertificateSubjectIssuer", -subject = "CN=example.subject", -} - }) - }); + string targetName = "Microsoft-VirtualMachine"; + ChaosTargetData data = new ChaosTargetData(new Dictionary()); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, targetName, data); ChaosTargetResource result = lro.Value; @@ -69,8 +59,8 @@ public async Task CreateOrUpdate_CreateUpdateATargetThatExtendsAVirtualMachineRe [Ignore("Only validating compilation of examples")] public async Task Get_GetATargetThatExtendsAVirtualMachineResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetTarget.json - // this example is just showing the usage of "Targets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Targets_Get.json + // this example is just showing the usage of "Target_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -105,8 +95,8 @@ public async Task Get_GetATargetThatExtendsAVirtualMachineResource() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListAllTargetsThatExtendAVirtualMachineResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListTargets.json - // this example is just showing the usage of "Targets_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Targets_List.json + // this example is just showing the usage of "Target_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -127,8 +117,7 @@ public async Task GetAll_ListAllTargetsThatExtendAVirtualMachineResource() ChaosTargetCollection collection = resourceGroupResource.GetChaosTargets(parentProviderNamespace, parentResourceType, parentResourceName); // invoke the operation and iterate over the result - string continuationToken = null; - await foreach (ChaosTargetResource item in collection.GetAllAsync(continuationToken: continuationToken)) + await foreach (ChaosTargetResource 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 @@ -144,8 +133,8 @@ public async Task GetAll_ListAllTargetsThatExtendAVirtualMachineResource() [Ignore("Only validating compilation of examples")] public async Task Exists_GetATargetThatExtendsAVirtualMachineResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetTarget.json - // this example is just showing the usage of "Targets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Targets_Get.json + // this example is just showing the usage of "Target_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -176,8 +165,8 @@ public async Task Exists_GetATargetThatExtendsAVirtualMachineResource() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetATargetThatExtendsAVirtualMachineResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetTarget.json - // this example is just showing the usage of "Targets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Targets_Get.json + // this example is just showing the usage of "Target_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetMetadataCollection.cs b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetMetadataCollection.cs new file mode 100644 index 000000000000..aa4533c6ff5d --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetMetadataCollection.cs @@ -0,0 +1,157 @@ +// 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.Chaos.Samples +{ + public partial class Sample_ChaosTargetMetadataCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetATargetTypeForWestus2Location() + { + // Generated from example definition: 2025-01-01/TargetTypes_Get.json + // this example is just showing the usage of "TargetType_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "6b052e15-03d3-4f17-b2e1-be7f07588291"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ChaosTargetMetadataResource + AzureLocation location = new AzureLocation("westus2"); + ChaosTargetMetadataCollection collection = subscriptionResource.GetAllChaosTargetMetadata(location); + + // invoke the operation + string targetTypeName = "Microsoft-Agent"; + ChaosTargetMetadataResource result = await collection.GetAsync(targetTypeName); + + // 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 + ChaosTargetMetadataData 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_ListAllTargetTypesForWestus2Location() + { + // Generated from example definition: 2025-01-01/TargetTypes_List.json + // this example is just showing the usage of "TargetType_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "6b052e15-03d3-4f17-b2e1-be7f07588291"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ChaosTargetMetadataResource + AzureLocation location = new AzureLocation("westus2"); + ChaosTargetMetadataCollection collection = subscriptionResource.GetAllChaosTargetMetadata(location); + + // invoke the operation and iterate over the result + await foreach (ChaosTargetMetadataResource 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 + ChaosTargetMetadataData 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_GetATargetTypeForWestus2Location() + { + // Generated from example definition: 2025-01-01/TargetTypes_Get.json + // this example is just showing the usage of "TargetType_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "6b052e15-03d3-4f17-b2e1-be7f07588291"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ChaosTargetMetadataResource + AzureLocation location = new AzureLocation("westus2"); + ChaosTargetMetadataCollection collection = subscriptionResource.GetAllChaosTargetMetadata(location); + + // invoke the operation + string targetTypeName = "Microsoft-Agent"; + bool result = await collection.ExistsAsync(targetTypeName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetATargetTypeForWestus2Location() + { + // Generated from example definition: 2025-01-01/TargetTypes_Get.json + // this example is just showing the usage of "TargetType_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "6b052e15-03d3-4f17-b2e1-be7f07588291"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // get the collection of this ChaosTargetMetadataResource + AzureLocation location = new AzureLocation("westus2"); + ChaosTargetMetadataCollection collection = subscriptionResource.GetAllChaosTargetMetadata(location); + + // invoke the operation + string targetTypeName = "Microsoft-Agent"; + NullableResponse response = await collection.GetIfExistsAsync(targetTypeName); + ChaosTargetMetadataResource 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 + ChaosTargetMetadataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetMetadataResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetMetadataResource.cs new file mode 100644 index 000000000000..dbb3bdc6a509 --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetMetadataResource.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.Chaos.Samples +{ + public partial class Sample_ChaosTargetMetadataResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetATargetTypeForWestus2Location() + { + // Generated from example definition: 2025-01-01/TargetTypes_Get.json + // this example is just showing the usage of "TargetType_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ChaosTargetMetadataResource created on azure + // for more information of creating ChaosTargetMetadataResource, please refer to the document of ChaosTargetMetadataResource + string subscriptionId = "6b052e15-03d3-4f17-b2e1-be7f07588291"; + AzureLocation location = new AzureLocation("westus2"); + string targetTypeName = "Microsoft-Agent"; + ResourceIdentifier chaosTargetMetadataResourceId = ChaosTargetMetadataResource.CreateResourceIdentifier(subscriptionId, location, targetTypeName); + ChaosTargetMetadataResource chaosTargetMetadata = client.GetChaosTargetMetadataResource(chaosTargetMetadataResourceId); + + // invoke the operation + ChaosTargetMetadataResource result = await chaosTargetMetadata.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 + ChaosTargetMetadataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetResource.cs index f7525989e395..300ea5c66627 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_ChaosTargetResource.cs @@ -20,8 +20,8 @@ public partial class Sample_ChaosTargetResource [Ignore("Only validating compilation of examples")] public async Task Get_GetATargetThatExtendsAVirtualMachineResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetTarget.json - // this example is just showing the usage of "Targets_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Targets_Get.json + // this example is just showing the usage of "Target_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -53,8 +53,8 @@ public async Task Get_GetATargetThatExtendsAVirtualMachineResource() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteATargetThatExtendsAVirtualMachineResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/DeleteTarget.json - // this example is just showing the usage of "Targets_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Targets_Delete.json + // this example is just showing the usage of "Target_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(); @@ -82,8 +82,8 @@ public async Task Delete_DeleteATargetThatExtendsAVirtualMachineResource() [Ignore("Only validating compilation of examples")] public async Task Update_CreateUpdateATargetThatExtendsAVirtualMachineResource() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CreateUpdateTarget.json - // this example is just showing the usage of "Targets_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Targets_CreateOrUpdate.json + // this example is just showing the usage of "Target_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(); @@ -97,22 +97,12 @@ public async Task Update_CreateUpdateATargetThatExtendsAVirtualMachineResource() string parentProviderNamespace = "Microsoft.Compute"; string parentResourceType = "virtualMachines"; string parentResourceName = "exampleVM"; - string targetName = "Microsoft-Agent"; + string targetName = "Microsoft-VirtualMachine"; ResourceIdentifier chaosTargetResourceId = ChaosTargetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName); ChaosTargetResource chaosTarget = client.GetChaosTargetResource(chaosTargetResourceId); // invoke the operation - ChaosTargetData data = new ChaosTargetData(new Dictionary - { - ["identities"] = BinaryData.FromObjectAsJson(new object[] - { -new -{ -type = "CertificateSubjectIssuer", -subject = "CN=example.subject", -} - }) - }); + ChaosTargetData data = new ChaosTargetData(new Dictionary()); ArmOperation lro = await chaosTarget.UpdateAsync(WaitUntil.Completed, data); ChaosTargetResource result = lro.Value; diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 659f1e05c1ae..47b334796e03 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -20,8 +20,8 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetChaosExperiments_ListAllExperimentsInASubscription() { - // Generated from example definition: specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListExperimentsInASubscription.json - // this example is just showing the usage of "Experiments_ListAll" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-01-01/Experiments_ListAll.json + // this example is just showing the usage of "Experiment_ListAll" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -35,8 +35,7 @@ public async Task GetChaosExperiments_ListAllExperimentsInASubscription() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - string continuationToken = null; - await foreach (ChaosExperimentResource item in subscriptionResource.GetChaosExperimentsAsync(continuationToken: continuationToken)) + await foreach (ChaosExperimentResource item in subscriptionResource.GetChaosExperimentsAsync()) { // 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 diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ArmChaosModelFactory.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ArmChaosModelFactory.cs index f2fa4c15a7b2..0ce8924e5b52 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ArmChaosModelFactory.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ArmChaosModelFactory.cs @@ -42,12 +42,33 @@ public static ChaosCapabilityData ChaosCapabilityData(ResourceIdentifier id = nu serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The properties of the target resource. + /// Azure resource location. + /// A new instance for mocking. + public static ChaosTargetData ChaosTargetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary properties = null, AzureLocation? location = null) + { + properties ??= new Dictionary(); + + return new ChaosTargetData( + id, + name, + resourceType, + systemData, + properties, + location, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// Location of the Capability Type resource. /// String of the Publisher that this Capability Type extends. /// String of the Target Type that this Capability Type extends. /// Localized string of the display name. @@ -57,19 +78,20 @@ public static ChaosCapabilityData ChaosCapabilityData(ResourceIdentifier id = nu /// String of the kind of this Capability Type. /// Control plane actions necessary to execute capability type. /// Data plane actions necessary to execute capability type. + /// Required Azure Role Definition Ids to execute capability type. /// Runtime properties of this Capability Type. - /// A new instance for mocking. - public static ChaosCapabilityTypeData ChaosCapabilityTypeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, string publisher = null, string targetType = null, string displayName = null, string description = null, string parametersSchema = null, string urn = null, string kind = null, IEnumerable azureRbacActions = null, IEnumerable azureRbacDataActions = null, string runtimeKind = null) + /// A new instance for mocking. + public static ChaosCapabilityMetadataData ChaosCapabilityMetadataData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string publisher = null, string targetType = null, string displayName = null, string description = null, string parametersSchema = null, string urn = null, string kind = null, IEnumerable azureRbacActions = null, IEnumerable azureRbacDataActions = null, IEnumerable requiredAzureRoleDefinitionIds = null, string runtimeKind = null) { azureRbacActions ??= new List(); azureRbacDataActions ??= new List(); + requiredAzureRoleDefinitionIds ??= new List(); - return new ChaosCapabilityTypeData( + return new ChaosCapabilityMetadataData( id, name, resourceType, systemData, - location, publisher, targetType, displayName, @@ -79,7 +101,8 @@ public static ChaosCapabilityTypeData ChaosCapabilityTypeData(ResourceIdentifier kind, azureRbacActions?.ToList(), azureRbacDataActions?.ToList(), - runtimeKind != null ? new ChaosCapabilityTypeRuntimeProperties(runtimeKind, serializedAdditionalRawData: null) : null, + requiredAzureRoleDefinitionIds?.ToList(), + runtimeKind != null ? new ChaosCapabilityMetadataRuntimeProperties(runtimeKind, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } @@ -90,7 +113,7 @@ public static ChaosCapabilityTypeData ChaosCapabilityTypeData(ResourceIdentifier /// The systemData. /// The tags. /// The location. - /// The identity of the experiment resource. Current supported identity types: None, SystemAssigned, UserAssigned. + /// The managed service identities assigned to this resource. /// Most recent provisioning state for the given experiment resource. /// List of steps. /// @@ -167,7 +190,7 @@ public static ExperimentExecutionDetails ExperimentExecutionDetails(ResourceIden stoppedOn, failureReason, lastActionOn, - runInformationSteps != null ? new ChaosExperimentRunInformation(runInformationSteps?.ToList(), serializedAdditionalRawData: null) : null, + runInformationSteps != null ? new ExperimentExecutionDetailsPropertiesRunInformation(runInformationSteps?.ToList(), serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } @@ -246,54 +269,30 @@ public static ExperimentExecutionActionTargetDetailsError ExperimentExecutionAct return new ExperimentExecutionActionTargetDetailsError(code, message, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// Location of the Target Type resource. /// Localized string of the display name. /// Localized string of the description. /// URL to retrieve JSON schema of the Target Type properties. /// List of resource types this Target Type can extend. - /// A new instance for mocking. - public static ChaosTargetTypeData ChaosTargetTypeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, string displayName = null, string description = null, string propertiesSchema = null, IEnumerable resourceTypes = null) + /// A new instance for mocking. + public static ChaosTargetMetadataData ChaosTargetMetadataData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string displayName = null, string description = null, string propertiesSchema = null, IEnumerable resourceTypes = null) { resourceTypes ??= new List(); - return new ChaosTargetTypeData( + return new ChaosTargetMetadataData( id, name, resourceType, systemData, - location, displayName, description, propertiesSchema, resourceTypes?.ToList(), serializedAdditionalRawData: null); } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// Location of the target resource. - /// The properties of the target resource. - /// A new instance for mocking. - public static ChaosTargetData ChaosTargetData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, AzureLocation? location = null, IDictionary properties = null) - { - properties ??= new Dictionary(); - - return new ChaosTargetData( - id, - name, - resourceType, - systemData, - location, - properties, - serializedAdditionalRawData: null); - } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityCollection.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityCollection.cs index b73a8a81d6ae..c25cf5372772 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityCollection.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityCollection.cs @@ -61,11 +61,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Capabilities_CreateOrUpdate + /// Capability_CreateOrUpdate /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -112,11 +112,11 @@ public virtual async Task> CreateOrUpdateA /// /// /// Operation Id - /// Capabilities_CreateOrUpdate + /// Capability_CreateOrUpdate /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -163,11 +163,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Operation Id - /// Capabilities_Get + /// Capability_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -208,11 +208,11 @@ public virtual async Task> GetAsync(string cap /// /// /// Operation Id - /// Capabilities_Get + /// Capability_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -245,7 +245,7 @@ public virtual Response Get(string capabilityName, Canc } /// - /// Get a list of Capability resources that extend a Target resource.. + /// Get a list of Capability resources that extend a Target resource. /// /// /// Request Path @@ -253,11 +253,11 @@ public virtual Response Get(string capabilityName, Canc /// /// /// Operation Id - /// Capabilities_List + /// Capability_List /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -276,7 +276,7 @@ public virtual AsyncPageable GetAllAsync(string continu } /// - /// Get a list of Capability resources that extend a Target resource.. + /// Get a list of Capability resources that extend a Target resource. /// /// /// Request Path @@ -284,11 +284,11 @@ public virtual AsyncPageable GetAllAsync(string continu /// /// /// Operation Id - /// Capabilities_List + /// Capability_List /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -315,11 +315,11 @@ public virtual Pageable GetAll(string continuationToken /// /// /// Operation Id - /// Capabilities_Get + /// Capability_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -358,11 +358,11 @@ public virtual async Task> ExistsAsync(string capabilityName, Can /// /// /// Operation Id - /// Capabilities_Get + /// Capability_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -401,11 +401,11 @@ public virtual Response Exists(string capabilityName, CancellationToken ca /// /// /// Operation Id - /// Capabilities_Get + /// Capability_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -446,11 +446,11 @@ public virtual async Task> GetIfExists /// /// /// Operation Id - /// Capabilities_Get + /// Capability_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeCollection.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataCollection.cs similarity index 55% rename from sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeCollection.cs rename to sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataCollection.cs index 1005bbe677fc..fe3a1d958b2c 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeCollection.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataCollection.cs @@ -18,28 +18,28 @@ namespace Azure.ResourceManager.Chaos { /// - /// 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 GetChaosCapabilityTypes method from an instance of . + /// 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 GetChaosCapabilityMetadata method from an instance of . /// - public partial class ChaosCapabilityTypeCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class ChaosCapabilityMetadataCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _chaosCapabilityTypeCapabilityTypesClientDiagnostics; - private readonly CapabilityTypesRestOperations _chaosCapabilityTypeCapabilityTypesRestClient; + private readonly ClientDiagnostics _chaosCapabilityMetadataCapabilityTypesClientDiagnostics; + private readonly CapabilityTypesRestOperations _chaosCapabilityMetadataCapabilityTypesRestClient; - /// Initializes a new instance of the class for mocking. - protected ChaosCapabilityTypeCollection() + /// Initializes a new instance of the class for mocking. + protected ChaosCapabilityMetadataCollection() { } - /// Initializes a new instance of the class. + /// 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 ChaosCapabilityTypeCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ChaosCapabilityMetadataCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _chaosCapabilityTypeCapabilityTypesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Chaos", ChaosCapabilityTypeResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ChaosCapabilityTypeResource.ResourceType, out string chaosCapabilityTypeCapabilityTypesApiVersion); - _chaosCapabilityTypeCapabilityTypesRestClient = new CapabilityTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, chaosCapabilityTypeCapabilityTypesApiVersion); + _chaosCapabilityMetadataCapabilityTypesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Chaos", ChaosCapabilityMetadataResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ChaosCapabilityMetadataResource.ResourceType, out string chaosCapabilityMetadataCapabilityTypesApiVersion); + _chaosCapabilityMetadataCapabilityTypesRestClient = new CapabilityTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, chaosCapabilityMetadataCapabilityTypesApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -47,8 +47,8 @@ internal ChaosCapabilityTypeCollection(ArmClient client, ResourceIdentifier id) internal static void ValidateResourceId(ResourceIdentifier id) { - if (id.ResourceType != ChaosTargetTypeResource.ResourceType) - throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ChaosTargetTypeResource.ResourceType), nameof(id)); + if (id.ResourceType != ChaosTargetMetadataResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ChaosTargetMetadataResource.ResourceType), nameof(id)); } /// @@ -56,19 +56,19 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} /// /// /// Operation Id - /// CapabilityTypes_Get + /// CapabilityType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -76,18 +76,18 @@ internal static void ValidateResourceId(ResourceIdentifier 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 capabilityTypeName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string capabilityTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(capabilityTypeName, nameof(capabilityTypeName)); - using var scope = _chaosCapabilityTypeCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityTypeCollection.Get"); + using var scope = _chaosCapabilityMetadataCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityMetadataCollection.Get"); scope.Start(); try { - var response = await _chaosCapabilityTypeCapabilityTypesRestClient.GetAsync(Id.SubscriptionId, Id.Parent.Name, Id.Name, capabilityTypeName, cancellationToken).ConfigureAwait(false); + var response = await _chaosCapabilityMetadataCapabilityTypesRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, capabilityTypeName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ChaosCapabilityTypeResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ChaosCapabilityMetadataResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -101,19 +101,19 @@ public virtual async Task> GetAsync(string /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} /// /// /// Operation Id - /// CapabilityTypes_Get + /// CapabilityType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -121,18 +121,18 @@ public virtual async Task> GetAsync(string /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string capabilityTypeName, CancellationToken cancellationToken = default) + public virtual Response Get(string capabilityTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(capabilityTypeName, nameof(capabilityTypeName)); - using var scope = _chaosCapabilityTypeCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityTypeCollection.Get"); + using var scope = _chaosCapabilityMetadataCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityMetadataCollection.Get"); scope.Start(); try { - var response = _chaosCapabilityTypeCapabilityTypesRestClient.Get(Id.SubscriptionId, Id.Parent.Name, Id.Name, capabilityTypeName, cancellationToken); + var response = _chaosCapabilityMetadataCapabilityTypesRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, capabilityTypeName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ChaosCapabilityTypeResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ChaosCapabilityMetadataResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -146,30 +146,30 @@ public virtual Response Get(string capabilityTypeNa /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes /// /// /// Operation Id - /// CapabilityTypes_List + /// CapabilityType_List /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// String that sets the continuation token. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string continuationToken = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string continuationToken = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _chaosCapabilityTypeCapabilityTypesRestClient.CreateListRequest(Id.SubscriptionId, Id.Parent.Name, Id.Name, continuationToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _chaosCapabilityTypeCapabilityTypesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.Parent.Name, Id.Name, continuationToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ChaosCapabilityTypeResource(Client, ChaosCapabilityTypeData.DeserializeChaosCapabilityTypeData(e)), _chaosCapabilityTypeCapabilityTypesClientDiagnostics, Pipeline, "ChaosCapabilityTypeCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _chaosCapabilityMetadataCapabilityTypesRestClient.CreateListRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _chaosCapabilityMetadataCapabilityTypesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ChaosCapabilityMetadataResource(Client, ChaosCapabilityMetadataData.DeserializeChaosCapabilityMetadataData(e)), _chaosCapabilityMetadataCapabilityTypesClientDiagnostics, Pipeline, "ChaosCapabilityMetadataCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -177,30 +177,30 @@ public virtual AsyncPageable GetAllAsync(string con /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes /// /// /// Operation Id - /// CapabilityTypes_List + /// CapabilityType_List /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// String that sets the continuation token. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string continuationToken = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string continuationToken = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _chaosCapabilityTypeCapabilityTypesRestClient.CreateListRequest(Id.SubscriptionId, Id.Parent.Name, Id.Name, continuationToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _chaosCapabilityTypeCapabilityTypesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.Parent.Name, Id.Name, continuationToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ChaosCapabilityTypeResource(Client, ChaosCapabilityTypeData.DeserializeChaosCapabilityTypeData(e)), _chaosCapabilityTypeCapabilityTypesClientDiagnostics, Pipeline, "ChaosCapabilityTypeCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _chaosCapabilityMetadataCapabilityTypesRestClient.CreateListRequest(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _chaosCapabilityMetadataCapabilityTypesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ChaosCapabilityMetadataResource(Client, ChaosCapabilityMetadataData.DeserializeChaosCapabilityMetadataData(e)), _chaosCapabilityMetadataCapabilityTypesClientDiagnostics, Pipeline, "ChaosCapabilityMetadataCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -208,19 +208,19 @@ public virtual Pageable GetAll(string continuationT /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} /// /// /// Operation Id - /// CapabilityTypes_Get + /// CapabilityType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -232,11 +232,11 @@ public virtual async Task> ExistsAsync(string capabilityTypeName, { Argument.AssertNotNullOrEmpty(capabilityTypeName, nameof(capabilityTypeName)); - using var scope = _chaosCapabilityTypeCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityTypeCollection.Exists"); + using var scope = _chaosCapabilityMetadataCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityMetadataCollection.Exists"); scope.Start(); try { - var response = await _chaosCapabilityTypeCapabilityTypesRestClient.GetAsync(Id.SubscriptionId, Id.Parent.Name, Id.Name, capabilityTypeName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _chaosCapabilityMetadataCapabilityTypesRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, capabilityTypeName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -251,19 +251,19 @@ public virtual async Task> ExistsAsync(string capabilityTypeName, /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} /// /// /// Operation Id - /// CapabilityTypes_Get + /// CapabilityType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -275,11 +275,11 @@ public virtual Response Exists(string capabilityTypeName, CancellationToke { Argument.AssertNotNullOrEmpty(capabilityTypeName, nameof(capabilityTypeName)); - using var scope = _chaosCapabilityTypeCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityTypeCollection.Exists"); + using var scope = _chaosCapabilityMetadataCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityMetadataCollection.Exists"); scope.Start(); try { - var response = _chaosCapabilityTypeCapabilityTypesRestClient.Get(Id.SubscriptionId, Id.Parent.Name, Id.Name, capabilityTypeName, cancellationToken: cancellationToken); + var response = _chaosCapabilityMetadataCapabilityTypesRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, capabilityTypeName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -294,19 +294,19 @@ public virtual Response Exists(string capabilityTypeName, CancellationToke /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} /// /// /// Operation Id - /// CapabilityTypes_Get + /// CapabilityType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -314,18 +314,18 @@ public virtual Response Exists(string capabilityTypeName, CancellationToke /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string capabilityTypeName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string capabilityTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(capabilityTypeName, nameof(capabilityTypeName)); - using var scope = _chaosCapabilityTypeCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityTypeCollection.GetIfExists"); + using var scope = _chaosCapabilityMetadataCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityMetadataCollection.GetIfExists"); scope.Start(); try { - var response = await _chaosCapabilityTypeCapabilityTypesRestClient.GetAsync(Id.SubscriptionId, Id.Parent.Name, Id.Name, capabilityTypeName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _chaosCapabilityMetadataCapabilityTypesRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, capabilityTypeName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ChaosCapabilityTypeResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ChaosCapabilityMetadataResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -339,19 +339,19 @@ public virtual async Task> GetIfEx /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} /// /// /// Operation Id - /// CapabilityTypes_Get + /// CapabilityType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -359,18 +359,18 @@ public virtual async Task> GetIfEx /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string capabilityTypeName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string capabilityTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(capabilityTypeName, nameof(capabilityTypeName)); - using var scope = _chaosCapabilityTypeCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityTypeCollection.GetIfExists"); + using var scope = _chaosCapabilityMetadataCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityMetadataCollection.GetIfExists"); scope.Start(); try { - var response = _chaosCapabilityTypeCapabilityTypesRestClient.Get(Id.SubscriptionId, Id.Parent.Name, Id.Name, capabilityTypeName, cancellationToken: cancellationToken); + var response = _chaosCapabilityMetadataCapabilityTypesRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, capabilityTypeName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ChaosCapabilityTypeResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ChaosCapabilityMetadataResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -379,7 +379,7 @@ public virtual NullableResponse GetIfExists(string } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -389,7 +389,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeData.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataData.Serialization.cs similarity index 74% rename from sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeData.Serialization.cs rename to sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataData.Serialization.cs index 396988642ce6..1b60af4011b6 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeData.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataData.Serialization.cs @@ -15,11 +15,11 @@ namespace Azure.ResourceManager.Chaos { - public partial class ChaosCapabilityTypeData : IUtf8JsonSerializable, IJsonModel + public partial class ChaosCapabilityMetadataData : 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); @@ -30,18 +30,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade /// 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ChaosCapabilityTypeData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChaosCapabilityMetadataData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Publisher)) @@ -79,7 +74,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("kind"u8); writer.WriteStringValue(Kind); } - if (Optional.IsCollectionDefined(AzureRbacActions)) + if (options.Format != "W" && Optional.IsCollectionDefined(AzureRbacActions)) { writer.WritePropertyName("azureRbacActions"u8); writer.WriteStartArray(); @@ -89,7 +84,7 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } - if (Optional.IsCollectionDefined(AzureRbacDataActions)) + if (options.Format != "W" && Optional.IsCollectionDefined(AzureRbacDataActions)) { writer.WritePropertyName("azureRbacDataActions"u8); writer.WriteStartArray(); @@ -99,7 +94,17 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } - if (Optional.IsDefined(RuntimeProperties)) + if (options.Format != "W" && Optional.IsCollectionDefined(RequiredAzureRoleDefinitionIds)) + { + writer.WritePropertyName("requiredAzureRoleDefinitionIds"u8); + writer.WriteStartArray(); + foreach (var item in RequiredAzureRoleDefinitionIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(RuntimeProperties)) { writer.WritePropertyName("runtimeProperties"u8); writer.WriteObjectValue(RuntimeProperties, options); @@ -107,19 +112,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - ChaosCapabilityTypeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChaosCapabilityMetadataData 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(ChaosCapabilityTypeData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChaosCapabilityMetadataData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChaosCapabilityTypeData(document.RootElement, options); + return DeserializeChaosCapabilityMetadataData(document.RootElement, options); } - internal static ChaosCapabilityTypeData DeserializeChaosCapabilityTypeData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChaosCapabilityMetadataData DeserializeChaosCapabilityMetadataData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -127,7 +132,6 @@ internal static ChaosCapabilityTypeData DeserializeChaosCapabilityTypeData(JsonE { return null; } - AzureLocation? location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -139,22 +143,14 @@ internal static ChaosCapabilityTypeData DeserializeChaosCapabilityTypeData(JsonE string parametersSchema = default; string urn = default; string kind = default; - IList azureRbacActions = default; - IList azureRbacDataActions = default; - ChaosCapabilityTypeRuntimeProperties runtimeProperties = default; + IReadOnlyList azureRbacActions = default; + IReadOnlyList azureRbacDataActions = default; + IReadOnlyList requiredAzureRoleDefinitionIds = default; + ChaosCapabilityMetadataRuntimeProperties runtimeProperties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -251,13 +247,27 @@ internal static ChaosCapabilityTypeData DeserializeChaosCapabilityTypeData(JsonE azureRbacDataActions = array; continue; } + if (property0.NameEquals("requiredAzureRoleDefinitionIds"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredAzureRoleDefinitionIds = array; + continue; + } if (property0.NameEquals("runtimeProperties"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } - runtimeProperties = ChaosCapabilityTypeRuntimeProperties.DeserializeChaosCapabilityTypeRuntimeProperties(property0.Value, options); + runtimeProperties = ChaosCapabilityMetadataRuntimeProperties.DeserializeChaosCapabilityMetadataRuntimeProperties(property0.Value, options); continue; } } @@ -269,12 +279,11 @@ internal static ChaosCapabilityTypeData DeserializeChaosCapabilityTypeData(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new ChaosCapabilityTypeData( + return new ChaosCapabilityMetadataData( id, name, type, systemData, - location, publisher, targetType, displayName, @@ -284,39 +293,40 @@ internal static ChaosCapabilityTypeData DeserializeChaosCapabilityTypeData(JsonE kind, azureRbacActions ?? new ChangeTrackingList(), azureRbacDataActions ?? new ChangeTrackingList(), + requiredAzureRoleDefinitionIds ?? new ChangeTrackingList(), runtimeProperties, 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(ChaosCapabilityTypeData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChaosCapabilityMetadataData)} does not support writing '{options.Format}' format."); } } - ChaosCapabilityTypeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChaosCapabilityMetadataData 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 DeserializeChaosCapabilityTypeData(document.RootElement, options); + return DeserializeChaosCapabilityMetadataData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ChaosCapabilityTypeData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChaosCapabilityMetadataData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeData.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataData.cs similarity index 77% rename from sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeData.cs rename to sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataData.cs index 49406ca45c99..557f1f4c38fa 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeData.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataData.cs @@ -14,10 +14,10 @@ namespace Azure.ResourceManager.Chaos { /// - /// A class representing the ChaosCapabilityType data model. + /// A class representing the ChaosCapabilityMetadata data model. /// Model that represents a Capability Type resource. /// - public partial class ChaosCapabilityTypeData : ResourceData + public partial class ChaosCapabilityMetadataData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -51,19 +51,19 @@ public partial class ChaosCapabilityTypeData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ChaosCapabilityTypeData() + /// Initializes a new instance of . + internal ChaosCapabilityMetadataData() { AzureRbacActions = new ChangeTrackingList(); AzureRbacDataActions = new ChangeTrackingList(); + RequiredAzureRoleDefinitionIds = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// Location of the Capability Type resource. /// String of the Publisher that this Capability Type extends. /// String of the Target Type that this Capability Type extends. /// Localized string of the display name. @@ -73,11 +73,11 @@ public ChaosCapabilityTypeData() /// String of the kind of this Capability Type. /// Control plane actions necessary to execute capability type. /// Data plane actions necessary to execute capability type. + /// Required Azure Role Definition Ids to execute capability type. /// Runtime properties of this Capability Type. /// Keeps track of any properties unknown to the library. - internal ChaosCapabilityTypeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, string publisher, string targetType, string displayName, string description, string parametersSchema, string urn, string kind, IList azureRbacActions, IList azureRbacDataActions, ChaosCapabilityTypeRuntimeProperties runtimeProperties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ChaosCapabilityMetadataData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string publisher, string targetType, string displayName, string description, string parametersSchema, string urn, string kind, IReadOnlyList azureRbacActions, IReadOnlyList azureRbacDataActions, IReadOnlyList requiredAzureRoleDefinitionIds, ChaosCapabilityMetadataRuntimeProperties runtimeProperties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - Location = location; Publisher = publisher; TargetType = targetType; DisplayName = displayName; @@ -87,12 +87,11 @@ internal ChaosCapabilityTypeData(ResourceIdentifier id, string name, ResourceTyp Kind = kind; AzureRbacActions = azureRbacActions; AzureRbacDataActions = azureRbacDataActions; + RequiredAzureRoleDefinitionIds = requiredAzureRoleDefinitionIds; RuntimeProperties = runtimeProperties; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Location of the Capability Type resource. - public AzureLocation? Location { get; set; } /// String of the Publisher that this Capability Type extends. public string Publisher { get; } /// String of the Target Type that this Capability Type extends. @@ -108,15 +107,17 @@ internal ChaosCapabilityTypeData(ResourceIdentifier id, string name, ResourceTyp /// String of the kind of this Capability Type. public string Kind { get; } /// Control plane actions necessary to execute capability type. - public IList AzureRbacActions { get; } + public IReadOnlyList AzureRbacActions { get; } /// Data plane actions necessary to execute capability type. - public IList AzureRbacDataActions { get; } + public IReadOnlyList AzureRbacDataActions { get; } + /// Required Azure Role Definition Ids to execute capability type. + public IReadOnlyList RequiredAzureRoleDefinitionIds { get; } /// Runtime properties of this Capability Type. - internal ChaosCapabilityTypeRuntimeProperties RuntimeProperties { get; set; } + internal ChaosCapabilityMetadataRuntimeProperties RuntimeProperties { get; } /// String of the kind of the resource's action type (continuous or discrete). public string RuntimeKind { - get => RuntimeProperties is null ? default : RuntimeProperties.Kind; + get => RuntimeProperties?.Kind; } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataResource.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataResource.Serialization.cs new file mode 100644 index 000000000000..1ee2853c9211 --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataResource.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.Chaos +{ + public partial class ChaosCapabilityMetadataResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ChaosCapabilityMetadataData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ChaosCapabilityMetadataData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataResource.cs similarity index 57% rename from sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeResource.cs rename to sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataResource.cs index 877344366abd..02322d532ae1 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityMetadataResource.cs @@ -15,53 +15,53 @@ namespace Azure.ResourceManager.Chaos { /// - /// A Class representing a ChaosCapabilityType 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 GetChaosCapabilityTypeResource method. - /// Otherwise you can get one from its parent resource using the GetChaosCapabilityType method. + /// A Class representing a ChaosCapabilityMetadata 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 GetChaosCapabilityMetadataResource method. + /// Otherwise you can get one from its parent resource using the GetChaosCapabilityMetadata method. /// - public partial class ChaosCapabilityTypeResource : ArmResource + public partial class ChaosCapabilityMetadataResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. - /// The locationName. + /// The location. /// The targetTypeName. /// The capabilityTypeName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string locationName, string targetTypeName, string capabilityTypeName) + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string targetTypeName, string capabilityTypeName) { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName}"; + var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _chaosCapabilityTypeCapabilityTypesClientDiagnostics; - private readonly CapabilityTypesRestOperations _chaosCapabilityTypeCapabilityTypesRestClient; - private readonly ChaosCapabilityTypeData _data; + private readonly ClientDiagnostics _chaosCapabilityMetadataCapabilityTypesClientDiagnostics; + private readonly CapabilityTypesRestOperations _chaosCapabilityMetadataCapabilityTypesRestClient; + private readonly ChaosCapabilityMetadataData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.Chaos/locations/targetTypes/capabilityTypes"; - /// Initializes a new instance of the class for mocking. - protected ChaosCapabilityTypeResource() + /// Initializes a new instance of the class for mocking. + protected ChaosCapabilityMetadataResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal ChaosCapabilityTypeResource(ArmClient client, ChaosCapabilityTypeData data) : this(client, data.Id) + internal ChaosCapabilityMetadataResource(ArmClient client, ChaosCapabilityMetadataData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// 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 ChaosCapabilityTypeResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ChaosCapabilityMetadataResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _chaosCapabilityTypeCapabilityTypesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Chaos", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string chaosCapabilityTypeCapabilityTypesApiVersion); - _chaosCapabilityTypeCapabilityTypesRestClient = new CapabilityTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, chaosCapabilityTypeCapabilityTypesApiVersion); + _chaosCapabilityMetadataCapabilityTypesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Chaos", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string chaosCapabilityMetadataCapabilityTypesApiVersion); + _chaosCapabilityMetadataCapabilityTypesRestClient = new CapabilityTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, chaosCapabilityMetadataCapabilityTypesApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -72,7 +72,7 @@ internal ChaosCapabilityTypeResource(ArmClient client, ResourceIdentifier id) : /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual ChaosCapabilityTypeData Data + public virtual ChaosCapabilityMetadataData Data { get { @@ -93,33 +93,33 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} /// /// /// Operation Id - /// CapabilityTypes_Get + /// CapabilityType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _chaosCapabilityTypeCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityTypeResource.Get"); + using var scope = _chaosCapabilityMetadataCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityMetadataResource.Get"); scope.Start(); try { - var response = await _chaosCapabilityTypeCapabilityTypesRestClient.GetAsync(Id.SubscriptionId, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _chaosCapabilityMetadataCapabilityTypesRestClient.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 ChaosCapabilityTypeResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ChaosCapabilityMetadataResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -133,33 +133,33 @@ public virtual async Task> GetAsync(Cancel /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} /// /// /// Operation Id - /// CapabilityTypes_Get + /// CapabilityType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _chaosCapabilityTypeCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityTypeResource.Get"); + using var scope = _chaosCapabilityMetadataCapabilityTypesClientDiagnostics.CreateScope("ChaosCapabilityMetadataResource.Get"); scope.Start(); try { - var response = _chaosCapabilityTypeCapabilityTypesRestClient.Get(Id.SubscriptionId, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var response = _chaosCapabilityMetadataCapabilityTypesRestClient.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 ChaosCapabilityTypeResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ChaosCapabilityMetadataResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityResource.cs index da53379c4265..b0ba8eca88a1 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityResource.cs @@ -101,11 +101,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Capabilities_Get + /// Capability_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -141,11 +141,11 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Operation Id - /// Capabilities_Get + /// Capability_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -181,11 +181,11 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Operation Id - /// Capabilities_Delete + /// Capability_Delete /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -225,11 +225,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// Capabilities_Delete + /// Capability_Delete /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -269,11 +269,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// Capabilities_CreateOrUpdate + /// Capability_CreateOrUpdate /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -317,11 +317,11 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Operation Id - /// Capabilities_CreateOrUpdate + /// Capability_CreateOrUpdate /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeResource.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeResource.Serialization.cs deleted file mode 100644 index 25c93c27f130..000000000000 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosCapabilityTypeResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.Chaos -{ - public partial class ChaosCapabilityTypeResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ChaosCapabilityTypeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ChaosCapabilityTypeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentCollection.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentCollection.cs index 91bea9958379..8c25f4df9be6 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentCollection.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentCollection.cs @@ -61,11 +61,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Experiments_CreateOrUpdate + /// Experiment_CreateOrUpdate /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -110,11 +110,11 @@ public virtual async Task> CreateOrUpdateA /// /// /// Operation Id - /// Experiments_CreateOrUpdate + /// Experiment_CreateOrUpdate /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -159,11 +159,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil wa /// /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -204,11 +204,11 @@ public virtual async Task> GetAsync(string exp /// /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -249,11 +249,11 @@ public virtual Response Get(string experimentName, Canc /// /// /// Operation Id - /// Experiments_List + /// Experiment_List /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -281,11 +281,11 @@ public virtual AsyncPageable GetAllAsync(bool? running /// /// /// Operation Id - /// Experiments_List + /// Experiment_List /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -313,11 +313,11 @@ public virtual Pageable GetAll(bool? running = null, st /// /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -356,11 +356,11 @@ public virtual async Task> ExistsAsync(string experimentName, Can /// /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -399,11 +399,11 @@ public virtual Response Exists(string experimentName, CancellationToken ca /// /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -444,11 +444,11 @@ public virtual async Task> GetIfExists /// /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentData.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentData.Serialization.cs index 46ffdff55318..0b83ad03a0a3 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentData.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentData.Serialization.cs @@ -40,7 +40,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); @@ -106,7 +107,8 @@ internal static ChaosExperimentData DeserializeChaosExperimentData(JsonElement e { continue; } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); continue; } if (property.NameEquals("tags"u8)) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentData.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentData.cs index 30ac010e6fb2..e2402ffae9af 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentData.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentData.cs @@ -77,7 +77,7 @@ public ChaosExperimentData(AzureLocation location, IEnumerable The systemData. /// The tags. /// The location. - /// The identity of the experiment resource. Current supported identity types: None, SystemAssigned, UserAssigned. + /// The managed service identities assigned to this resource. /// Most recent provisioning state for the given experiment resource. /// List of steps. /// @@ -100,7 +100,7 @@ internal ChaosExperimentData() { } - /// The identity of the experiment resource. Current supported identity types: None, SystemAssigned, UserAssigned. + /// The managed service identities assigned to this resource. public ManagedServiceIdentity Identity { get; set; } /// Most recent provisioning state for the given experiment resource. public ChaosProvisioningState? ProvisioningState { get; } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentExecutionCollection.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentExecutionCollection.cs index 848dc6937986..f4047907b1fe 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentExecutionCollection.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentExecutionCollection.cs @@ -24,8 +24,8 @@ namespace Azure.ResourceManager.Chaos /// public partial class ChaosExperimentExecutionCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _chaosExperimentExecutionExperimentsClientDiagnostics; - private readonly ExperimentsRestOperations _chaosExperimentExecutionExperimentsRestClient; + private readonly ClientDiagnostics _chaosExperimentExecutionExperimentExecutionsClientDiagnostics; + private readonly ExperimentExecutionsRestOperations _chaosExperimentExecutionExperimentExecutionsRestClient; /// Initializes a new instance of the class for mocking. protected ChaosExperimentExecutionCollection() @@ -37,9 +37,9 @@ protected ChaosExperimentExecutionCollection() /// The identifier of the parent resource that is the target of operations. internal ChaosExperimentExecutionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) { - _chaosExperimentExecutionExperimentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Chaos", ChaosExperimentExecutionResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ChaosExperimentExecutionResource.ResourceType, out string chaosExperimentExecutionExperimentsApiVersion); - _chaosExperimentExecutionExperimentsRestClient = new ExperimentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, chaosExperimentExecutionExperimentsApiVersion); + _chaosExperimentExecutionExperimentExecutionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Chaos", ChaosExperimentExecutionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ChaosExperimentExecutionResource.ResourceType, out string chaosExperimentExecutionExperimentExecutionsApiVersion); + _chaosExperimentExecutionExperimentExecutionsRestClient = new ExperimentExecutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, chaosExperimentExecutionExperimentExecutionsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -60,11 +60,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Experiments_GetExecution + /// ExperimentExecution_GetExecution /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -80,11 +80,11 @@ public virtual async Task> GetAsync(s { Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); - using var scope = _chaosExperimentExecutionExperimentsClientDiagnostics.CreateScope("ChaosExperimentExecutionCollection.Get"); + using var scope = _chaosExperimentExecutionExperimentExecutionsClientDiagnostics.CreateScope("ChaosExperimentExecutionCollection.Get"); scope.Start(); try { - var response = await _chaosExperimentExecutionExperimentsRestClient.GetExecutionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, executionId, cancellationToken).ConfigureAwait(false); + var response = await _chaosExperimentExecutionExperimentExecutionsRestClient.GetExecutionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, executionId, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ChaosExperimentExecutionResource(Client, response.Value), response.GetRawResponse()); @@ -105,11 +105,11 @@ public virtual async Task> GetAsync(s /// /// /// Operation Id - /// Experiments_GetExecution + /// ExperimentExecution_GetExecution /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -125,11 +125,11 @@ public virtual Response Get(string executionId { Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); - using var scope = _chaosExperimentExecutionExperimentsClientDiagnostics.CreateScope("ChaosExperimentExecutionCollection.Get"); + using var scope = _chaosExperimentExecutionExperimentExecutionsClientDiagnostics.CreateScope("ChaosExperimentExecutionCollection.Get"); scope.Start(); try { - var response = _chaosExperimentExecutionExperimentsRestClient.GetExecution(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, executionId, cancellationToken); + var response = _chaosExperimentExecutionExperimentExecutionsRestClient.GetExecution(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, executionId, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ChaosExperimentExecutionResource(Client, response.Value), response.GetRawResponse()); @@ -150,11 +150,11 @@ public virtual Response Get(string executionId /// /// /// Operation Id - /// Experiments_ListAllExecutions + /// ExperimentExecution_ListAllExecutions /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -166,9 +166,9 @@ public virtual Response Get(string executionId /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _chaosExperimentExecutionExperimentsRestClient.CreateListAllExecutionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _chaosExperimentExecutionExperimentsRestClient.CreateListAllExecutionsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ChaosExperimentExecutionResource(Client, ChaosExperimentExecutionData.DeserializeChaosExperimentExecutionData(e)), _chaosExperimentExecutionExperimentsClientDiagnostics, Pipeline, "ChaosExperimentExecutionCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _chaosExperimentExecutionExperimentExecutionsRestClient.CreateListAllExecutionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _chaosExperimentExecutionExperimentExecutionsRestClient.CreateListAllExecutionsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ChaosExperimentExecutionResource(Client, ChaosExperimentExecutionData.DeserializeChaosExperimentExecutionData(e)), _chaosExperimentExecutionExperimentExecutionsClientDiagnostics, Pipeline, "ChaosExperimentExecutionCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -180,11 +180,11 @@ public virtual AsyncPageable GetAllAsync(Cance /// /// /// Operation Id - /// Experiments_ListAllExecutions + /// ExperimentExecution_ListAllExecutions /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -196,9 +196,9 @@ 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) => _chaosExperimentExecutionExperimentsRestClient.CreateListAllExecutionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _chaosExperimentExecutionExperimentsRestClient.CreateListAllExecutionsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ChaosExperimentExecutionResource(Client, ChaosExperimentExecutionData.DeserializeChaosExperimentExecutionData(e)), _chaosExperimentExecutionExperimentsClientDiagnostics, Pipeline, "ChaosExperimentExecutionCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _chaosExperimentExecutionExperimentExecutionsRestClient.CreateListAllExecutionsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _chaosExperimentExecutionExperimentExecutionsRestClient.CreateListAllExecutionsNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ChaosExperimentExecutionResource(Client, ChaosExperimentExecutionData.DeserializeChaosExperimentExecutionData(e)), _chaosExperimentExecutionExperimentExecutionsClientDiagnostics, Pipeline, "ChaosExperimentExecutionCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -210,11 +210,11 @@ public virtual Pageable GetAll(CancellationTok /// /// /// Operation Id - /// Experiments_GetExecution + /// ExperimentExecution_GetExecution /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -230,11 +230,11 @@ public virtual async Task> ExistsAsync(string executionId, Cancel { Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); - using var scope = _chaosExperimentExecutionExperimentsClientDiagnostics.CreateScope("ChaosExperimentExecutionCollection.Exists"); + using var scope = _chaosExperimentExecutionExperimentExecutionsClientDiagnostics.CreateScope("ChaosExperimentExecutionCollection.Exists"); scope.Start(); try { - var response = await _chaosExperimentExecutionExperimentsRestClient.GetExecutionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, executionId, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _chaosExperimentExecutionExperimentExecutionsRestClient.GetExecutionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, executionId, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -253,11 +253,11 @@ public virtual async Task> ExistsAsync(string executionId, Cancel /// /// /// Operation Id - /// Experiments_GetExecution + /// ExperimentExecution_GetExecution /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -273,11 +273,11 @@ public virtual Response Exists(string executionId, CancellationToken cance { Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); - using var scope = _chaosExperimentExecutionExperimentsClientDiagnostics.CreateScope("ChaosExperimentExecutionCollection.Exists"); + using var scope = _chaosExperimentExecutionExperimentExecutionsClientDiagnostics.CreateScope("ChaosExperimentExecutionCollection.Exists"); scope.Start(); try { - var response = _chaosExperimentExecutionExperimentsRestClient.GetExecution(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, executionId, cancellationToken: cancellationToken); + var response = _chaosExperimentExecutionExperimentExecutionsRestClient.GetExecution(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, executionId, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -296,11 +296,11 @@ public virtual Response Exists(string executionId, CancellationToken cance /// /// /// Operation Id - /// Experiments_GetExecution + /// ExperimentExecution_GetExecution /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -316,11 +316,11 @@ public virtual async Task> Ge { Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); - using var scope = _chaosExperimentExecutionExperimentsClientDiagnostics.CreateScope("ChaosExperimentExecutionCollection.GetIfExists"); + using var scope = _chaosExperimentExecutionExperimentExecutionsClientDiagnostics.CreateScope("ChaosExperimentExecutionCollection.GetIfExists"); scope.Start(); try { - var response = await _chaosExperimentExecutionExperimentsRestClient.GetExecutionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, executionId, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _chaosExperimentExecutionExperimentExecutionsRestClient.GetExecutionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, executionId, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new ChaosExperimentExecutionResource(Client, response.Value), response.GetRawResponse()); @@ -341,11 +341,11 @@ public virtual async Task> Ge /// /// /// Operation Id - /// Experiments_GetExecution + /// ExperimentExecution_GetExecution /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -361,11 +361,11 @@ public virtual NullableResponse GetIfExists(st { Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); - using var scope = _chaosExperimentExecutionExperimentsClientDiagnostics.CreateScope("ChaosExperimentExecutionCollection.GetIfExists"); + using var scope = _chaosExperimentExecutionExperimentExecutionsClientDiagnostics.CreateScope("ChaosExperimentExecutionCollection.GetIfExists"); scope.Start(); try { - var response = _chaosExperimentExecutionExperimentsRestClient.GetExecution(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, executionId, cancellationToken: cancellationToken); + var response = _chaosExperimentExecutionExperimentExecutionsRestClient.GetExecution(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, executionId, cancellationToken: cancellationToken); if (response.Value == null) return new NoValueResponse(response.GetRawResponse()); return Response.FromValue(new ChaosExperimentExecutionResource(Client, response.Value), response.GetRawResponse()); diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentExecutionResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentExecutionResource.cs index 14a6815a39e8..19d1c0440d38 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentExecutionResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentExecutionResource.cs @@ -34,8 +34,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _chaosExperimentExecutionExperimentsClientDiagnostics; - private readonly ExperimentsRestOperations _chaosExperimentExecutionExperimentsRestClient; + private readonly ClientDiagnostics _chaosExperimentExecutionExperimentExecutionsClientDiagnostics; + private readonly ExperimentExecutionsRestOperations _chaosExperimentExecutionExperimentExecutionsRestClient; private readonly ChaosExperimentExecutionData _data; /// Gets the resource type for the operations. @@ -60,9 +60,9 @@ internal ChaosExperimentExecutionResource(ArmClient client, ChaosExperimentExecu /// The identifier of the resource that is the target of operations. internal ChaosExperimentExecutionResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _chaosExperimentExecutionExperimentsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Chaos", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string chaosExperimentExecutionExperimentsApiVersion); - _chaosExperimentExecutionExperimentsRestClient = new ExperimentsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, chaosExperimentExecutionExperimentsApiVersion); + _chaosExperimentExecutionExperimentExecutionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Chaos", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string chaosExperimentExecutionExperimentExecutionsApiVersion); + _chaosExperimentExecutionExperimentExecutionsRestClient = new ExperimentExecutionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, chaosExperimentExecutionExperimentExecutionsApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -98,11 +98,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Experiments_GetExecution + /// ExperimentExecution_GetExecution /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -113,11 +113,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// The cancellation token to use. public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _chaosExperimentExecutionExperimentsClientDiagnostics.CreateScope("ChaosExperimentExecutionResource.Get"); + using var scope = _chaosExperimentExecutionExperimentExecutionsClientDiagnostics.CreateScope("ChaosExperimentExecutionResource.Get"); scope.Start(); try { - var response = await _chaosExperimentExecutionExperimentsRestClient.GetExecutionAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _chaosExperimentExecutionExperimentExecutionsRestClient.GetExecutionAsync(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 ChaosExperimentExecutionResource(Client, response.Value), response.GetRawResponse()); @@ -138,11 +138,11 @@ public virtual async Task> GetAsync(C /// /// /// Operation Id - /// Experiments_GetExecution + /// ExperimentExecution_GetExecution /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -153,11 +153,11 @@ public virtual async Task> GetAsync(C /// The cancellation token to use. public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _chaosExperimentExecutionExperimentsClientDiagnostics.CreateScope("ChaosExperimentExecutionResource.Get"); + using var scope = _chaosExperimentExecutionExperimentExecutionsClientDiagnostics.CreateScope("ChaosExperimentExecutionResource.Get"); scope.Start(); try { - var response = _chaosExperimentExecutionExperimentsRestClient.GetExecution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _chaosExperimentExecutionExperimentExecutionsRestClient.GetExecution(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); return Response.FromValue(new ChaosExperimentExecutionResource(Client, response.Value), response.GetRawResponse()); @@ -178,11 +178,11 @@ public virtual Response Get(CancellationToken /// /// /// Operation Id - /// Experiments_ExecutionDetails + /// ExperimentExecutions_ExecutionDetails /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -193,11 +193,11 @@ public virtual Response Get(CancellationToken /// The cancellation token to use. public virtual async Task> ExecutionDetailsAsync(CancellationToken cancellationToken = default) { - using var scope = _chaosExperimentExecutionExperimentsClientDiagnostics.CreateScope("ChaosExperimentExecutionResource.ExecutionDetails"); + using var scope = _chaosExperimentExecutionExperimentExecutionsClientDiagnostics.CreateScope("ChaosExperimentExecutionResource.ExecutionDetails"); scope.Start(); try { - var response = await _chaosExperimentExecutionExperimentsRestClient.ExecutionDetailsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _chaosExperimentExecutionExperimentExecutionsRestClient.ExecutionDetailsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -216,11 +216,11 @@ public virtual async Task> ExecutionDetails /// /// /// Operation Id - /// Experiments_ExecutionDetails + /// ExperimentExecutions_ExecutionDetails /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -231,11 +231,11 @@ public virtual async Task> ExecutionDetails /// The cancellation token to use. public virtual Response ExecutionDetails(CancellationToken cancellationToken = default) { - using var scope = _chaosExperimentExecutionExperimentsClientDiagnostics.CreateScope("ChaosExperimentExecutionResource.ExecutionDetails"); + using var scope = _chaosExperimentExecutionExperimentExecutionsClientDiagnostics.CreateScope("ChaosExperimentExecutionResource.ExecutionDetails"); scope.Start(); try { - var response = _chaosExperimentExecutionExperimentsRestClient.ExecutionDetails(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var response = _chaosExperimentExecutionExperimentExecutionsRestClient.ExecutionDetails(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); return response; } catch (Exception e) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentResource.cs index 92b67311b6a2..340108ba95fc 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosExperimentResource.cs @@ -106,11 +106,11 @@ public virtual ChaosExperimentExecutionCollection GetChaosExperimentExecutions() /// /// /// Operation Id - /// Experiments_GetExecution + /// ExperimentExecution_GetExecution /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -137,11 +137,11 @@ public virtual async Task> GetChaosEx /// /// /// Operation Id - /// Experiments_GetExecution + /// ExperimentExecution_GetExecution /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -168,11 +168,11 @@ public virtual Response GetChaosExperimentExec /// /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -208,11 +208,11 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -248,11 +248,11 @@ public virtual Response Get(CancellationToken cancellat /// /// /// Operation Id - /// Experiments_Delete + /// Experiment_Delete /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -290,11 +290,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// Experiments_Delete + /// Experiment_Delete /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -332,11 +332,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// Experiments_Update + /// Experiment_Update /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -378,11 +378,11 @@ public virtual async Task> UpdateAsync(Wai /// /// /// Operation Id - /// Experiments_Update + /// Experiment_Update /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -428,7 +428,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil, /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -470,7 +470,7 @@ public virtual async Task CancelAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -512,7 +512,7 @@ public virtual ArmOperation Cancel(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -554,7 +554,7 @@ public virtual async Task StartAsync(WaitUntil waitUntil, Cancella /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -592,11 +592,11 @@ public virtual ArmOperation Start(WaitUntil waitUntil, CancellationToken cancell /// /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -654,11 +654,11 @@ public virtual async Task> AddTagAsync(string /// /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -716,11 +716,11 @@ public virtual Response AddTag(string key, string value /// /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -773,11 +773,11 @@ public virtual async Task> SetTagsAsync(IDicti /// /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -830,11 +830,11 @@ public virtual Response SetTags(IDictionary /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -890,11 +890,11 @@ public virtual async Task> RemoveTagAsync(stri /// /// /// Operation Id - /// Experiments_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetCollection.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetCollection.cs index 41c6b9a09e22..6d0b4d09b6d2 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetCollection.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetCollection.cs @@ -39,9 +39,9 @@ protected ChaosTargetCollection() /// 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. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// , or is null. /// , or is an empty string, and was expected to be non-empty. internal ChaosTargetCollection(ArmClient client, ResourceIdentifier id, string parentProviderNamespace, string parentResourceType, string parentResourceName) : base(client, id) @@ -72,11 +72,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// Targets_CreateOrUpdate + /// Target_CreateOrUpdate /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -123,11 +123,11 @@ public virtual async Task> CreateOrUpdateAsync /// /// /// Operation Id - /// Targets_CreateOrUpdate + /// Target_CreateOrUpdate /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -174,11 +174,11 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil waitUn /// /// /// Operation Id - /// Targets_Get + /// Target_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -219,11 +219,11 @@ public virtual async Task> GetAsync(string targetN /// /// /// Operation Id - /// Targets_Get + /// Target_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -264,11 +264,11 @@ public virtual Response Get(string targetName, Cancellation /// /// /// Operation Id - /// Targets_List + /// Target_List /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -295,11 +295,11 @@ public virtual AsyncPageable GetAllAsync(string continuatio /// /// /// Operation Id - /// Targets_List + /// Target_List /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -326,11 +326,11 @@ public virtual Pageable GetAll(string continuationToken = n /// /// /// Operation Id - /// Targets_Get + /// Target_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -369,11 +369,11 @@ public virtual async Task> ExistsAsync(string targetName, Cancell /// /// /// Operation Id - /// Targets_Get + /// Target_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -412,11 +412,11 @@ public virtual Response Exists(string targetName, CancellationToken cancel /// /// /// Operation Id - /// Targets_Get + /// Target_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -457,11 +457,11 @@ public virtual async Task> GetIfExistsAsyn /// /// /// Operation Id - /// Targets_Get + /// Target_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetData.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetData.Serialization.cs index 570e886044b6..383c5631ccd1 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetData.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetData.Serialization.cs @@ -36,11 +36,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); foreach (var item in Properties) @@ -61,6 +56,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri #endif } writer.WriteEndObject(); + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } } ChaosTargetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -83,8 +83,8 @@ internal static ChaosTargetData DeserializeChaosTargetData(JsonElement element, { return null; } - AzureLocation? location = default; IDictionary properties = default; + AzureLocation? location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -93,15 +93,6 @@ internal static ChaosTargetData DeserializeChaosTargetData(JsonElement element, Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } if (property.NameEquals("properties"u8)) { Dictionary dictionary = new Dictionary(); @@ -119,6 +110,15 @@ internal static ChaosTargetData DeserializeChaosTargetData(JsonElement element, properties = dictionary; continue; } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -154,8 +154,8 @@ internal static ChaosTargetData DeserializeChaosTargetData(JsonElement element, name, type, systemData, - location, properties, + location, serializedAdditionalRawData); } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetData.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetData.cs index 9e51cab934dc..cafed2e2c713 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetData.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetData.cs @@ -65,13 +65,13 @@ public ChaosTargetData(IDictionary properties) /// The name. /// The resourceType. /// The systemData. - /// Location of the target resource. /// The properties of the target resource. + /// Azure resource location. /// Keeps track of any properties unknown to the library. - internal ChaosTargetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, IDictionary properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ChaosTargetData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary properties, AzureLocation? location, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - Location = location; Properties = properties; + Location = location; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -80,8 +80,6 @@ internal ChaosTargetData() { } - /// Location of the target resource. - public AzureLocation? Location { get; set; } /// /// The properties of the target resource. /// @@ -113,5 +111,7 @@ internal ChaosTargetData() /// /// public IDictionary Properties { get; } + /// Azure resource location. + public AzureLocation? Location { get; set; } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeCollection.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataCollection.cs similarity index 57% rename from sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeCollection.cs rename to sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataCollection.cs index 63263576854c..a1e6ee98a0e6 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeCollection.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataCollection.cs @@ -19,33 +19,31 @@ namespace Azure.ResourceManager.Chaos { /// - /// 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 GetChaosTargetTypes method from an instance of . + /// 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 GetChaosTargetMetadata method from an instance of . /// - public partial class ChaosTargetTypeCollection : ArmCollection, IEnumerable, IAsyncEnumerable + public partial class ChaosTargetMetadataCollection : ArmCollection, IEnumerable, IAsyncEnumerable { - private readonly ClientDiagnostics _chaosTargetTypeTargetTypesClientDiagnostics; - private readonly TargetTypesRestOperations _chaosTargetTypeTargetTypesRestClient; - private readonly string _locationName; + private readonly ClientDiagnostics _chaosTargetMetadataTargetTypesClientDiagnostics; + private readonly TargetTypesRestOperations _chaosTargetMetadataTargetTypesRestClient; + private readonly AzureLocation _location; - /// Initializes a new instance of the class for mocking. - protected ChaosTargetTypeCollection() + /// Initializes a new instance of the class for mocking. + protected ChaosTargetMetadataCollection() { } - /// Initializes a new instance of the class. + /// 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. - /// String that represents a Location resource name. - /// is null. - /// is an empty string, and was expected to be non-empty. - internal ChaosTargetTypeCollection(ArmClient client, ResourceIdentifier id, string locationName) : base(client, id) + /// The name of the Azure region. + internal ChaosTargetMetadataCollection(ArmClient client, ResourceIdentifier id, AzureLocation location) : base(client, id) { - _locationName = locationName; - _chaosTargetTypeTargetTypesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Chaos", ChaosTargetTypeResource.ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ChaosTargetTypeResource.ResourceType, out string chaosTargetTypeTargetTypesApiVersion); - _chaosTargetTypeTargetTypesRestClient = new TargetTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, chaosTargetTypeTargetTypesApiVersion); + _location = location; + _chaosTargetMetadataTargetTypesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Chaos", ChaosTargetMetadataResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ChaosTargetMetadataResource.ResourceType, out string chaosTargetMetadataTargetTypesApiVersion); + _chaosTargetMetadataTargetTypesRestClient = new TargetTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, chaosTargetMetadataTargetTypesApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -62,19 +60,19 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName} /// /// /// Operation Id - /// TargetTypes_Get + /// TargetType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -82,18 +80,18 @@ internal static void ValidateResourceId(ResourceIdentifier 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 targetTypeName, CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(string targetTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - using var scope = _chaosTargetTypeTargetTypesClientDiagnostics.CreateScope("ChaosTargetTypeCollection.Get"); + using var scope = _chaosTargetMetadataTargetTypesClientDiagnostics.CreateScope("ChaosTargetMetadataCollection.Get"); scope.Start(); try { - var response = await _chaosTargetTypeTargetTypesRestClient.GetAsync(Id.SubscriptionId, _locationName, targetTypeName, cancellationToken).ConfigureAwait(false); + var response = await _chaosTargetMetadataTargetTypesRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), targetTypeName, cancellationToken).ConfigureAwait(false); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ChaosTargetTypeResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ChaosTargetMetadataResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -107,19 +105,19 @@ public virtual async Task> GetAsync(string tar /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName} /// /// /// Operation Id - /// TargetTypes_Get + /// TargetType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -127,18 +125,18 @@ public virtual async Task> GetAsync(string tar /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual Response Get(string targetTypeName, CancellationToken cancellationToken = default) + public virtual Response Get(string targetTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - using var scope = _chaosTargetTypeTargetTypesClientDiagnostics.CreateScope("ChaosTargetTypeCollection.Get"); + using var scope = _chaosTargetMetadataTargetTypesClientDiagnostics.CreateScope("ChaosTargetMetadataCollection.Get"); scope.Start(); try { - var response = _chaosTargetTypeTargetTypesRestClient.Get(Id.SubscriptionId, _locationName, targetTypeName, cancellationToken); + var response = _chaosTargetMetadataTargetTypesRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), targetTypeName, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ChaosTargetTypeResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ChaosTargetMetadataResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -152,30 +150,30 @@ public virtual Response Get(string targetTypeName, Canc /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes /// /// /// Operation Id - /// TargetTypes_List + /// TargetType_List /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// String that sets the continuation token. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetAllAsync(string continuationToken = null, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string continuationToken = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _chaosTargetTypeTargetTypesRestClient.CreateListRequest(Id.SubscriptionId, _locationName, continuationToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _chaosTargetTypeTargetTypesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, _locationName, continuationToken); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ChaosTargetTypeResource(Client, ChaosTargetTypeData.DeserializeChaosTargetTypeData(e)), _chaosTargetTypeTargetTypesClientDiagnostics, Pipeline, "ChaosTargetTypeCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _chaosTargetMetadataTargetTypesRestClient.CreateListRequest(Id.SubscriptionId, new AzureLocation(_location), continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _chaosTargetMetadataTargetTypesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ChaosTargetMetadataResource(Client, ChaosTargetMetadataData.DeserializeChaosTargetMetadataData(e)), _chaosTargetMetadataTargetTypesClientDiagnostics, Pipeline, "ChaosTargetMetadataCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -183,30 +181,30 @@ public virtual AsyncPageable GetAllAsync(string continu /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes /// /// /// Operation Id - /// TargetTypes_List + /// TargetType_List /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// String that sets the continuation token. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetAll(string continuationToken = null, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string continuationToken = null, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _chaosTargetTypeTargetTypesRestClient.CreateListRequest(Id.SubscriptionId, _locationName, continuationToken); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _chaosTargetTypeTargetTypesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, _locationName, continuationToken); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ChaosTargetTypeResource(Client, ChaosTargetTypeData.DeserializeChaosTargetTypeData(e)), _chaosTargetTypeTargetTypesClientDiagnostics, Pipeline, "ChaosTargetTypeCollection.GetAll", "value", "nextLink", cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => _chaosTargetMetadataTargetTypesRestClient.CreateListRequest(Id.SubscriptionId, new AzureLocation(_location), continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _chaosTargetMetadataTargetTypesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, new AzureLocation(_location), continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ChaosTargetMetadataResource(Client, ChaosTargetMetadataData.DeserializeChaosTargetMetadataData(e)), _chaosTargetMetadataTargetTypesClientDiagnostics, Pipeline, "ChaosTargetMetadataCollection.GetAll", "value", "nextLink", cancellationToken); } /// @@ -214,19 +212,19 @@ public virtual Pageable GetAll(string continuationToken /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName} /// /// /// Operation Id - /// TargetTypes_Get + /// TargetType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -238,11 +236,11 @@ public virtual async Task> ExistsAsync(string targetTypeName, Can { Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - using var scope = _chaosTargetTypeTargetTypesClientDiagnostics.CreateScope("ChaosTargetTypeCollection.Exists"); + using var scope = _chaosTargetMetadataTargetTypesClientDiagnostics.CreateScope("ChaosTargetMetadataCollection.Exists"); scope.Start(); try { - var response = await _chaosTargetTypeTargetTypesRestClient.GetAsync(Id.SubscriptionId, _locationName, targetTypeName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _chaosTargetMetadataTargetTypesRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), targetTypeName, cancellationToken: cancellationToken).ConfigureAwait(false); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -257,19 +255,19 @@ public virtual async Task> ExistsAsync(string targetTypeName, Can /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName} /// /// /// Operation Id - /// TargetTypes_Get + /// TargetType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -281,11 +279,11 @@ public virtual Response Exists(string targetTypeName, CancellationToken ca { Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - using var scope = _chaosTargetTypeTargetTypesClientDiagnostics.CreateScope("ChaosTargetTypeCollection.Exists"); + using var scope = _chaosTargetMetadataTargetTypesClientDiagnostics.CreateScope("ChaosTargetMetadataCollection.Exists"); scope.Start(); try { - var response = _chaosTargetTypeTargetTypesRestClient.Get(Id.SubscriptionId, _locationName, targetTypeName, cancellationToken: cancellationToken); + var response = _chaosTargetMetadataTargetTypesRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), targetTypeName, cancellationToken: cancellationToken); return Response.FromValue(response.Value != null, response.GetRawResponse()); } catch (Exception e) @@ -300,19 +298,19 @@ public virtual Response Exists(string targetTypeName, CancellationToken ca /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName} /// /// /// Operation Id - /// TargetTypes_Get + /// TargetType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -320,18 +318,18 @@ public virtual Response Exists(string targetTypeName, CancellationToken ca /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual async Task> GetIfExistsAsync(string targetTypeName, CancellationToken cancellationToken = default) + public virtual async Task> GetIfExistsAsync(string targetTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - using var scope = _chaosTargetTypeTargetTypesClientDiagnostics.CreateScope("ChaosTargetTypeCollection.GetIfExists"); + using var scope = _chaosTargetMetadataTargetTypesClientDiagnostics.CreateScope("ChaosTargetMetadataCollection.GetIfExists"); scope.Start(); try { - var response = await _chaosTargetTypeTargetTypesRestClient.GetAsync(Id.SubscriptionId, _locationName, targetTypeName, cancellationToken: cancellationToken).ConfigureAwait(false); + var response = await _chaosTargetMetadataTargetTypesRestClient.GetAsync(Id.SubscriptionId, new AzureLocation(_location), targetTypeName, cancellationToken: cancellationToken).ConfigureAwait(false); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ChaosTargetTypeResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ChaosTargetMetadataResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -345,19 +343,19 @@ public virtual async Task> GetIfExists /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName} /// /// /// Operation Id - /// TargetTypes_Get + /// TargetType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -365,18 +363,18 @@ public virtual async Task> GetIfExists /// The cancellation token to use. /// is an empty string, and was expected to be non-empty. /// is null. - public virtual NullableResponse GetIfExists(string targetTypeName, CancellationToken cancellationToken = default) + public virtual NullableResponse GetIfExists(string targetTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - using var scope = _chaosTargetTypeTargetTypesClientDiagnostics.CreateScope("ChaosTargetTypeCollection.GetIfExists"); + using var scope = _chaosTargetMetadataTargetTypesClientDiagnostics.CreateScope("ChaosTargetMetadataCollection.GetIfExists"); scope.Start(); try { - var response = _chaosTargetTypeTargetTypesRestClient.Get(Id.SubscriptionId, _locationName, targetTypeName, cancellationToken: cancellationToken); + var response = _chaosTargetMetadataTargetTypesRestClient.Get(Id.SubscriptionId, new AzureLocation(_location), targetTypeName, cancellationToken: cancellationToken); if (response.Value == null) - return new NoValueResponse(response.GetRawResponse()); - return Response.FromValue(new ChaosTargetTypeResource(Client, response.Value), response.GetRawResponse()); + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ChaosTargetMetadataResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -385,7 +383,7 @@ public virtual NullableResponse GetIfExists(string targ } } - IEnumerator IEnumerable.GetEnumerator() + IEnumerator IEnumerable.GetEnumerator() { return GetAll().GetEnumerator(); } @@ -395,7 +393,7 @@ IEnumerator IEnumerable.GetEnumerator() return GetAll().GetEnumerator(); } - IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) { return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeData.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataData.Serialization.cs similarity index 75% rename from sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeData.Serialization.cs rename to sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataData.Serialization.cs index b45df780c51c..f263b7dd893a 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeData.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataData.Serialization.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.Chaos { - public partial class ChaosTargetTypeData : IUtf8JsonSerializable, IJsonModel + public partial class ChaosTargetMetadataData : 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); @@ -29,18 +29,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri /// 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; + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") { - throw new FormatException($"The model {nameof(ChaosTargetTypeData)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChaosTargetMetadataData)} does not support writing '{format}' format."); } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(DisplayName)) @@ -71,19 +66,19 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteEndObject(); } - ChaosTargetTypeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChaosTargetMetadataData 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(ChaosTargetTypeData)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChaosTargetMetadataData)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChaosTargetTypeData(document.RootElement, options); + return DeserializeChaosTargetMetadataData(document.RootElement, options); } - internal static ChaosTargetTypeData DeserializeChaosTargetTypeData(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChaosTargetMetadataData DeserializeChaosTargetMetadataData(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -91,7 +86,6 @@ internal static ChaosTargetTypeData DeserializeChaosTargetTypeData(JsonElement e { return null; } - AzureLocation? location = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -104,15 +98,6 @@ internal static ChaosTargetTypeData DeserializeChaosTargetTypeData(JsonElement e Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("location"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - location = new AzureLocation(property.Value.GetString()); - continue; - } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -184,12 +169,11 @@ internal static ChaosTargetTypeData DeserializeChaosTargetTypeData(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new ChaosTargetTypeData( + return new ChaosTargetMetadataData( id, name, type, systemData, - location, displayName, description, propertiesSchema, @@ -197,35 +181,35 @@ internal static ChaosTargetTypeData DeserializeChaosTargetTypeData(JsonElement e 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(ChaosTargetTypeData)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChaosTargetMetadataData)} does not support writing '{options.Format}' format."); } } - ChaosTargetTypeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChaosTargetMetadataData 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 DeserializeChaosTargetTypeData(document.RootElement, options); + return DeserializeChaosTargetMetadataData(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ChaosTargetTypeData)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChaosTargetMetadataData)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeData.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataData.cs similarity index 80% rename from sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeData.cs rename to sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataData.cs index 06ead5634ed9..c67f4459ff28 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeData.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataData.cs @@ -13,10 +13,10 @@ namespace Azure.ResourceManager.Chaos { /// - /// A class representing the ChaosTargetType data model. + /// A class representing the ChaosTargetMetadata data model. /// Model that represents a Target Type resource. /// - public partial class ChaosTargetTypeData : ResourceData + public partial class ChaosTargetMetadataData : ResourceData { /// /// Keeps track of any properties unknown to the library. @@ -50,26 +50,24 @@ public partial class ChaosTargetTypeData : ResourceData /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ChaosTargetTypeData() + /// Initializes a new instance of . + internal ChaosTargetMetadataData() { ResourceTypes = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// Location of the Target Type resource. /// Localized string of the display name. /// Localized string of the description. /// URL to retrieve JSON schema of the Target Type properties. /// List of resource types this Target Type can extend. /// Keeps track of any properties unknown to the library. - internal ChaosTargetTypeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, AzureLocation? location, string displayName, string description, string propertiesSchema, IReadOnlyList resourceTypes, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ChaosTargetMetadataData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string displayName, string description, string propertiesSchema, IReadOnlyList resourceTypes, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - Location = location; DisplayName = displayName; Description = description; PropertiesSchema = propertiesSchema; @@ -77,8 +75,6 @@ internal ChaosTargetTypeData(ResourceIdentifier id, string name, ResourceType re _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Location of the Target Type resource. - public AzureLocation? Location { get; set; } /// Localized string of the display name. public string DisplayName { get; } /// Localized string of the description. diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataResource.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataResource.Serialization.cs new file mode 100644 index 000000000000..31a6d54b1529 --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataResource.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.Chaos +{ + public partial class ChaosTargetMetadataResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ChaosTargetMetadataData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ChaosTargetMetadataData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataResource.cs similarity index 59% rename from sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeResource.cs rename to sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataResource.cs index 74d0bf07fc2f..3dbe95a40c81 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetMetadataResource.cs @@ -16,52 +16,52 @@ namespace Azure.ResourceManager.Chaos { /// - /// A Class representing a ChaosTargetType 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 GetChaosTargetTypeResource method. - /// Otherwise you can get one from its parent resource using the GetChaosTargetType method. + /// A Class representing a ChaosTargetMetadata 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 GetChaosTargetMetadataResource method. + /// Otherwise you can get one from its parent resource using the GetChaosTargetMetadata method. /// - public partial class ChaosTargetTypeResource : ArmResource + public partial class ChaosTargetMetadataResource : ArmResource { - /// Generate the resource identifier of a instance. + /// Generate the resource identifier of a instance. /// The subscriptionId. - /// The locationName. + /// The location. /// The targetTypeName. - public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string locationName, string targetTypeName) + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, AzureLocation location, string targetTypeName) { - var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}"; + var resourceId = $"/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}"; return new ResourceIdentifier(resourceId); } - private readonly ClientDiagnostics _chaosTargetTypeTargetTypesClientDiagnostics; - private readonly TargetTypesRestOperations _chaosTargetTypeTargetTypesRestClient; - private readonly ChaosTargetTypeData _data; + private readonly ClientDiagnostics _chaosTargetMetadataTargetTypesClientDiagnostics; + private readonly TargetTypesRestOperations _chaosTargetMetadataTargetTypesRestClient; + private readonly ChaosTargetMetadataData _data; /// Gets the resource type for the operations. public static readonly ResourceType ResourceType = "Microsoft.Chaos/locations/targetTypes"; - /// Initializes a new instance of the class for mocking. - protected ChaosTargetTypeResource() + /// Initializes a new instance of the class for mocking. + protected ChaosTargetMetadataResource() { } - /// Initializes a new instance of the class. + /// Initializes a new instance of the class. /// The client parameters to use in these operations. /// The resource that is the target of operations. - internal ChaosTargetTypeResource(ArmClient client, ChaosTargetTypeData data) : this(client, data.Id) + internal ChaosTargetMetadataResource(ArmClient client, ChaosTargetMetadataData data) : this(client, data.Id) { HasData = true; _data = data; } - /// Initializes a new instance of the class. + /// 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 ChaosTargetTypeResource(ArmClient client, ResourceIdentifier id) : base(client, id) + internal ChaosTargetMetadataResource(ArmClient client, ResourceIdentifier id) : base(client, id) { - _chaosTargetTypeTargetTypesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Chaos", ResourceType.Namespace, Diagnostics); - TryGetApiVersion(ResourceType, out string chaosTargetTypeTargetTypesApiVersion); - _chaosTargetTypeTargetTypesRestClient = new TargetTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, chaosTargetTypeTargetTypesApiVersion); + _chaosTargetMetadataTargetTypesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Chaos", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string chaosTargetMetadataTargetTypesApiVersion); + _chaosTargetMetadataTargetTypesRestClient = new TargetTypesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, chaosTargetMetadataTargetTypesApiVersion); #if DEBUG ValidateResourceId(Id); #endif @@ -72,7 +72,7 @@ internal ChaosTargetTypeResource(ArmClient client, ResourceIdentifier id) : base /// Gets the data representing this Feature. /// Throws if there is no data loaded in the current instance. - public virtual ChaosTargetTypeData Data + public virtual ChaosTargetMetadataData Data { get { @@ -88,11 +88,11 @@ 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 ChaosCapabilityTypeResources in the ChaosTargetType. - /// An object representing collection of ChaosCapabilityTypeResources and their operations over a ChaosCapabilityTypeResource. - public virtual ChaosCapabilityTypeCollection GetChaosCapabilityTypes() + /// Gets a collection of ChaosCapabilityMetadataResources in the ChaosTargetMetadata. + /// An object representing collection of ChaosCapabilityMetadataResources and their operations over a ChaosCapabilityMetadataResource. + public virtual ChaosCapabilityMetadataCollection GetAllChaosCapabilityMetadata() { - return GetCachedClient(client => new ChaosCapabilityTypeCollection(client, Id)); + return GetCachedClient(client => new ChaosCapabilityMetadataCollection(client, Id)); } /// @@ -100,19 +100,19 @@ public virtual ChaosCapabilityTypeCollection GetChaosCapabilityTypes() /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} /// /// /// Operation Id - /// CapabilityTypes_Get + /// CapabilityType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -121,9 +121,9 @@ public virtual ChaosCapabilityTypeCollection GetChaosCapabilityTypes() /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetChaosCapabilityTypeAsync(string capabilityTypeName, CancellationToken cancellationToken = default) + public virtual async Task> GetChaosCapabilityMetadataAsync(string capabilityTypeName, CancellationToken cancellationToken = default) { - return await GetChaosCapabilityTypes().GetAsync(capabilityTypeName, cancellationToken).ConfigureAwait(false); + return await GetAllChaosCapabilityMetadata().GetAsync(capabilityTypeName, cancellationToken).ConfigureAwait(false); } /// @@ -131,19 +131,19 @@ public virtual async Task> GetChaosCapabil /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName} /// /// /// Operation Id - /// CapabilityTypes_Get + /// CapabilityType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// @@ -152,9 +152,9 @@ public virtual async Task> GetChaosCapabil /// is null. /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetChaosCapabilityType(string capabilityTypeName, CancellationToken cancellationToken = default) + public virtual Response GetChaosCapabilityMetadata(string capabilityTypeName, CancellationToken cancellationToken = default) { - return GetChaosCapabilityTypes().Get(capabilityTypeName, cancellationToken); + return GetAllChaosCapabilityMetadata().Get(capabilityTypeName, cancellationToken); } /// @@ -162,33 +162,33 @@ public virtual Response GetChaosCapabilityType(stri /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName} /// /// /// Operation Id - /// TargetTypes_Get + /// TargetType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) { - using var scope = _chaosTargetTypeTargetTypesClientDiagnostics.CreateScope("ChaosTargetTypeResource.Get"); + using var scope = _chaosTargetMetadataTargetTypesClientDiagnostics.CreateScope("ChaosTargetMetadataResource.Get"); scope.Start(); try { - var response = await _chaosTargetTypeTargetTypesRestClient.GetAsync(Id.SubscriptionId, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _chaosTargetMetadataTargetTypesRestClient.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 ChaosTargetTypeResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ChaosTargetMetadataResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { @@ -202,33 +202,33 @@ public virtual async Task> GetAsync(Cancellati /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName} /// /// /// Operation Id - /// TargetTypes_Get + /// TargetType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// The cancellation token to use. - public virtual Response Get(CancellationToken cancellationToken = default) + public virtual Response Get(CancellationToken cancellationToken = default) { - using var scope = _chaosTargetTypeTargetTypesClientDiagnostics.CreateScope("ChaosTargetTypeResource.Get"); + using var scope = _chaosTargetMetadataTargetTypesClientDiagnostics.CreateScope("ChaosTargetMetadataResource.Get"); scope.Start(); try { - var response = _chaosTargetTypeTargetTypesRestClient.Get(Id.SubscriptionId, Id.Parent.Name, Id.Name, cancellationToken); + var response = _chaosTargetMetadataTargetTypesRestClient.Get(Id.SubscriptionId, new AzureLocation(Id.Parent.Name), Id.Name, cancellationToken); if (response.Value == null) throw new RequestFailedException(response.GetRawResponse()); - return Response.FromValue(new ChaosTargetTypeResource(Client, response.Value), response.GetRawResponse()); + return Response.FromValue(new ChaosTargetMetadataResource(Client, response.Value), response.GetRawResponse()); } catch (Exception e) { diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetResource.cs index fd196112c23d..7795432c2d56 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetResource.cs @@ -108,11 +108,11 @@ public virtual ChaosCapabilityCollection GetChaosCapabilities() /// /// /// Operation Id - /// Capabilities_Get + /// Capability_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -139,11 +139,11 @@ public virtual async Task> GetChaosCapabilityA /// /// /// Operation Id - /// Capabilities_Get + /// Capability_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -170,11 +170,11 @@ public virtual Response GetChaosCapability(string capab /// /// /// Operation Id - /// Targets_Get + /// Target_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -210,11 +210,11 @@ public virtual async Task> GetAsync(CancellationTo /// /// /// Operation Id - /// Targets_Get + /// Target_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -250,11 +250,11 @@ public virtual Response Get(CancellationToken cancellationT /// /// /// Operation Id - /// Targets_Delete + /// Target_Delete /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -294,11 +294,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// Targets_Delete + /// Target_Delete /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -338,11 +338,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// Targets_CreateOrUpdate + /// Target_CreateOrUpdate /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -386,11 +386,11 @@ public virtual async Task> UpdateAsync(WaitUnt /// /// /// Operation Id - /// Targets_CreateOrUpdate + /// Target_CreateOrUpdate /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeResource.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeResource.Serialization.cs deleted file mode 100644 index b4764a06077d..000000000000 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/ChaosTargetTypeResource.Serialization.cs +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.ClientModel.Primitives; -using System.Text.Json; - -namespace Azure.ResourceManager.Chaos -{ - public partial class ChaosTargetTypeResource : IJsonModel - { - void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); - - ChaosTargetTypeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); - - BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); - - ChaosTargetTypeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); - - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); - } -} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosExtensions.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosExtensions.cs index 6df34434c17d..bde87645dcfa 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosExtensions.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/ChaosExtensions.cs @@ -52,313 +52,312 @@ public static ChaosCapabilityResource GetChaosCapabilityResource(this ArmClient } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static ChaosCapabilityTypeResource GetChaosCapabilityTypeResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ChaosTargetResource GetChaosTargetResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableChaosArmClient(client).GetChaosCapabilityTypeResource(id); + return GetMockableChaosArmClient(client).GetChaosTargetResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static ChaosExperimentResource GetChaosExperimentResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ChaosCapabilityMetadataResource GetChaosCapabilityMetadataResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableChaosArmClient(client).GetChaosExperimentResource(id); + return GetMockableChaosArmClient(client).GetChaosCapabilityMetadataResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static ChaosExperimentExecutionResource GetChaosExperimentExecutionResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ChaosExperimentResource GetChaosExperimentResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableChaosArmClient(client).GetChaosExperimentExecutionResource(id); + return GetMockableChaosArmClient(client).GetChaosExperimentResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static ChaosTargetTypeResource GetChaosTargetTypeResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ChaosExperimentExecutionResource GetChaosExperimentExecutionResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableChaosArmClient(client).GetChaosTargetTypeResource(id); + return GetMockableChaosArmClient(client).GetChaosExperimentExecutionResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static ChaosTargetResource GetChaosTargetResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ChaosTargetMetadataResource GetChaosTargetMetadataResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableChaosArmClient(client).GetChaosTargetResource(id); + return GetMockableChaosArmClient(client).GetChaosTargetMetadataResource(id); } /// - /// Gets a collection of ChaosExperimentResources in the ResourceGroupResource. + /// Gets a collection of ChaosTargetResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// is null. - /// An object representing collection of ChaosExperimentResources and their operations over a ChaosExperimentResource. - public static ChaosExperimentCollection GetChaosExperiments(this ResourceGroupResource resourceGroupResource) + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// An object representing collection of ChaosTargetResources and their operations over a ChaosTargetResource. + public static ChaosTargetCollection GetChaosTargets(this ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableChaosResourceGroupResource(resourceGroupResource).GetChaosExperiments(); + return GetMockableChaosResourceGroupResource(resourceGroupResource).GetChaosTargets(parentProviderNamespace, parentResourceType, parentResourceName); } /// - /// Get a Experiment resource. + /// Get a Target resource that extends a tracked regional resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName} /// /// /// Operation Id - /// Experiments_Get + /// Target_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// String that represents a Experiment resource name. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. + /// String that represents a Target resource name. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetChaosExperimentAsync(this ResourceGroupResource resourceGroupResource, string experimentName, CancellationToken cancellationToken = default) + public static async Task> GetChaosTargetAsync(this ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableChaosResourceGroupResource(resourceGroupResource).GetChaosExperimentAsync(experimentName, cancellationToken).ConfigureAwait(false); + return await GetMockableChaosResourceGroupResource(resourceGroupResource).GetChaosTargetAsync(parentProviderNamespace, parentResourceType, parentResourceName, targetName, cancellationToken).ConfigureAwait(false); } /// - /// Get a Experiment resource. + /// Get a Target resource that extends a tracked regional resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName} /// /// /// Operation Id - /// Experiments_Get + /// Target_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// String that represents a Experiment resource name. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. + /// String that represents a Target resource name. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetChaosExperiment(this ResourceGroupResource resourceGroupResource, string experimentName, CancellationToken cancellationToken = default) + public static Response GetChaosTarget(this ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableChaosResourceGroupResource(resourceGroupResource).GetChaosExperiment(experimentName, cancellationToken); + return GetMockableChaosResourceGroupResource(resourceGroupResource).GetChaosTarget(parentProviderNamespace, parentResourceType, parentResourceName, targetName, cancellationToken); } /// - /// Gets a collection of ChaosTargetResources in the ResourceGroupResource. + /// Gets a collection of ChaosExperimentResources in the ResourceGroupResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// An object representing collection of ChaosTargetResources and their operations over a ChaosTargetResource. - public static ChaosTargetCollection GetChaosTargets(this ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName) + /// is null. + /// An object representing collection of ChaosExperimentResources and their operations over a ChaosExperimentResource. + public static ChaosExperimentCollection GetChaosExperiments(this ResourceGroupResource resourceGroupResource) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableChaosResourceGroupResource(resourceGroupResource).GetChaosTargets(parentProviderNamespace, parentResourceType, parentResourceName); + return GetMockableChaosResourceGroupResource(resourceGroupResource).GetChaosExperiments(); } /// - /// Get a Target resource that extends a tracked regional resource. + /// Get a Experiment resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName} /// /// /// Operation Id - /// Targets_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. - /// String that represents a Target resource name. + /// String that represents a Experiment resource name. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetChaosTargetAsync(this ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) + public static async Task> GetChaosExperimentAsync(this ResourceGroupResource resourceGroupResource, string experimentName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return await GetMockableChaosResourceGroupResource(resourceGroupResource).GetChaosTargetAsync(parentProviderNamespace, parentResourceType, parentResourceName, targetName, cancellationToken).ConfigureAwait(false); + return await GetMockableChaosResourceGroupResource(resourceGroupResource).GetChaosExperimentAsync(experimentName, cancellationToken).ConfigureAwait(false); } /// - /// Get a Target resource that extends a tracked regional resource. + /// Get a Experiment resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName} /// /// /// Operation Id - /// Targets_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. - /// String that represents a Target resource name. + /// String that represents a Experiment resource name. /// The cancellation token to use. - /// , , , or is null. - /// , , or is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetChaosTarget(this ResourceGroupResource resourceGroupResource, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) + public static Response GetChaosExperiment(this ResourceGroupResource resourceGroupResource, string experimentName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); - return GetMockableChaosResourceGroupResource(resourceGroupResource).GetChaosTarget(parentProviderNamespace, parentResourceType, parentResourceName, targetName, cancellationToken); + return GetMockableChaosResourceGroupResource(resourceGroupResource).GetChaosExperiment(experimentName, cancellationToken); } /// - /// Gets a collection of ChaosTargetTypeResources in the SubscriptionResource. + /// Gets a collection of ChaosTargetMetadataResources in the SubscriptionResource. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// String that represents a Location resource name. - /// or is null. - /// is an empty string, and was expected to be non-empty. - /// An object representing collection of ChaosTargetTypeResources and their operations over a ChaosTargetTypeResource. - public static ChaosTargetTypeCollection GetChaosTargetTypes(this SubscriptionResource subscriptionResource, string locationName) + /// The name of the Azure region. + /// is null. + /// An object representing collection of ChaosTargetMetadataResources and their operations over a ChaosTargetMetadataResource. + public static ChaosTargetMetadataCollection GetAllChaosTargetMetadata(this SubscriptionResource subscriptionResource, AzureLocation location) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableChaosSubscriptionResource(subscriptionResource).GetChaosTargetTypes(locationName); + return GetMockableChaosSubscriptionResource(subscriptionResource).GetAllChaosTargetMetadata(location); } /// @@ -366,38 +365,38 @@ public static ChaosTargetTypeCollection GetChaosTargetTypes(this SubscriptionRes /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName} /// /// /// Operation Id - /// TargetTypes_Get + /// TargetType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// String that represents a Location resource name. + /// The name of the Azure region. /// String that represents a Target Type resource name. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static async Task> GetChaosTargetTypeAsync(this SubscriptionResource subscriptionResource, string locationName, string targetTypeName, CancellationToken cancellationToken = default) + public static async Task> GetChaosTargetMetadataAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string targetTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableChaosSubscriptionResource(subscriptionResource).GetChaosTargetTypeAsync(locationName, targetTypeName, cancellationToken).ConfigureAwait(false); + return await GetMockableChaosSubscriptionResource(subscriptionResource).GetChaosTargetMetadataAsync(location, targetTypeName, cancellationToken).ConfigureAwait(false); } /// @@ -405,38 +404,38 @@ public static async Task> GetChaosTargetTypeAs /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName} /// /// /// Operation Id - /// TargetTypes_Get + /// TargetType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// String that represents a Location resource name. + /// The name of the Azure region. /// String that represents a Target Type resource name. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. + /// or is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public static Response GetChaosTargetType(this SubscriptionResource subscriptionResource, string locationName, string targetTypeName, CancellationToken cancellationToken = default) + public static Response GetChaosTargetMetadata(this SubscriptionResource subscriptionResource, AzureLocation location, string targetTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableChaosSubscriptionResource(subscriptionResource).GetChaosTargetType(locationName, targetTypeName, cancellationToken); + return GetMockableChaosSubscriptionResource(subscriptionResource).GetChaosTargetMetadata(location, targetTypeName, cancellationToken); } /// @@ -448,11 +447,11 @@ public static Response GetChaosTargetType(this Subscrip /// /// /// Operation Id - /// Experiments_ListAll + /// Experiment_ListAll /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -486,11 +485,11 @@ public static AsyncPageable GetChaosExperimentsAsync(th /// /// /// Operation Id - /// Experiments_ListAll + /// Experiment_ListAll /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/MockableChaosArmClient.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/MockableChaosArmClient.cs index 0605d4649369..6322b0fa68f5 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/MockableChaosArmClient.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/MockableChaosArmClient.cs @@ -47,15 +47,27 @@ public virtual ChaosCapabilityResource GetChaosCapabilityResource(ResourceIdenti } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ChaosTargetResource GetChaosTargetResource(ResourceIdentifier id) + { + ChaosTargetResource.ValidateResourceId(id); + return new ChaosTargetResource(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 ChaosCapabilityTypeResource GetChaosCapabilityTypeResource(ResourceIdentifier id) + /// Returns a object. + public virtual ChaosCapabilityMetadataResource GetChaosCapabilityMetadataResource(ResourceIdentifier id) { - ChaosCapabilityTypeResource.ValidateResourceId(id); - return new ChaosCapabilityTypeResource(Client, id); + ChaosCapabilityMetadataResource.ValidateResourceId(id); + return new ChaosCapabilityMetadataResource(Client, id); } /// @@ -83,27 +95,15 @@ public virtual ChaosExperimentExecutionResource GetChaosExperimentExecutionResou } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// The resource ID of the resource to get. - /// Returns a object. - public virtual ChaosTargetTypeResource GetChaosTargetTypeResource(ResourceIdentifier id) + /// Returns a object. + public virtual ChaosTargetMetadataResource GetChaosTargetMetadataResource(ResourceIdentifier id) { - ChaosTargetTypeResource.ValidateResourceId(id); - return new ChaosTargetTypeResource(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 ChaosTargetResource GetChaosTargetResource(ResourceIdentifier id) - { - ChaosTargetResource.ValidateResourceId(id); - return new ChaosTargetResource(Client, id); + ChaosTargetMetadataResource.ValidateResourceId(id); + return new ChaosTargetMetadataResource(Client, id); } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/MockableChaosResourceGroupResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/MockableChaosResourceGroupResource.cs index ea97f0f6ec2d..17138759e7c2 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/MockableChaosResourceGroupResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/MockableChaosResourceGroupResource.cs @@ -33,153 +33,153 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of ChaosExperimentResources in the ResourceGroupResource. - /// An object representing collection of ChaosExperimentResources and their operations over a ChaosExperimentResource. - public virtual ChaosExperimentCollection GetChaosExperiments() + /// Gets a collection of ChaosTargetResources in the ResourceGroupResource. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + /// An object representing collection of ChaosTargetResources and their operations over a ChaosTargetResource. + public virtual ChaosTargetCollection GetChaosTargets(string parentProviderNamespace, string parentResourceType, string parentResourceName) { - return GetCachedClient(client => new ChaosExperimentCollection(client, Id)); + return new ChaosTargetCollection(Client, Id, parentProviderNamespace, parentResourceType, parentResourceName); } /// - /// Get a Experiment resource. + /// Get a Target resource that extends a tracked regional resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName} /// /// /// Operation Id - /// Experiments_Get + /// Target_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// - /// String that represents a Experiment resource name. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. + /// String that represents a Target resource name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetChaosExperimentAsync(string experimentName, CancellationToken cancellationToken = default) + public virtual async Task> GetChaosTargetAsync(string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) { - return await GetChaosExperiments().GetAsync(experimentName, cancellationToken).ConfigureAwait(false); + return await GetChaosTargets(parentProviderNamespace, parentResourceType, parentResourceName).GetAsync(targetName, cancellationToken).ConfigureAwait(false); } /// - /// Get a Experiment resource. + /// Get a Target resource that extends a tracked regional resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName} /// /// /// Operation Id - /// Experiments_Get + /// Target_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// - /// String that represents a Experiment resource name. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. + /// String that represents a Target resource name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetChaosExperiment(string experimentName, CancellationToken cancellationToken = default) + public virtual Response GetChaosTarget(string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) { - return GetChaosExperiments().Get(experimentName, cancellationToken); + return GetChaosTargets(parentProviderNamespace, parentResourceType, parentResourceName).Get(targetName, cancellationToken); } - /// Gets a collection of ChaosTargetResources in the ResourceGroupResource. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - /// An object representing collection of ChaosTargetResources and their operations over a ChaosTargetResource. - public virtual ChaosTargetCollection GetChaosTargets(string parentProviderNamespace, string parentResourceType, string parentResourceName) + /// Gets a collection of ChaosExperimentResources in the ResourceGroupResource. + /// An object representing collection of ChaosExperimentResources and their operations over a ChaosExperimentResource. + public virtual ChaosExperimentCollection GetChaosExperiments() { - return new ChaosTargetCollection(Client, Id, parentProviderNamespace, parentResourceType, parentResourceName); + return GetCachedClient(client => new ChaosExperimentCollection(client, Id)); } /// - /// Get a Target resource that extends a tracked regional resource. + /// Get a Experiment resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName} /// /// /// Operation Id - /// Targets_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. - /// String that represents a Target resource name. + /// String that represents a Experiment resource name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetChaosTargetAsync(string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) + public virtual async Task> GetChaosExperimentAsync(string experimentName, CancellationToken cancellationToken = default) { - return await GetChaosTargets(parentProviderNamespace, parentResourceType, parentResourceName).GetAsync(targetName, cancellationToken).ConfigureAwait(false); + return await GetChaosExperiments().GetAsync(experimentName, cancellationToken).ConfigureAwait(false); } /// - /// Get a Target resource that extends a tracked regional resource. + /// Get a Experiment resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName} /// /// /// Operation Id - /// Targets_Get + /// Experiment_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. - /// String that represents a Target resource name. + /// String that represents a Experiment resource name. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetChaosTarget(string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) + public virtual Response GetChaosExperiment(string experimentName, CancellationToken cancellationToken = default) { - return GetChaosTargets(parentProviderNamespace, parentResourceType, parentResourceName).Get(targetName, cancellationToken); + return GetChaosExperiments().Get(experimentName, cancellationToken); } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/MockableChaosSubscriptionResource.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/MockableChaosSubscriptionResource.cs index ec7ef4720e5b..3611fc123099 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/MockableChaosSubscriptionResource.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Extensions/MockableChaosSubscriptionResource.cs @@ -41,14 +41,12 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } - /// Gets a collection of ChaosTargetTypeResources in the SubscriptionResource. - /// String that represents a Location resource name. - /// is null. - /// is an empty string, and was expected to be non-empty. - /// An object representing collection of ChaosTargetTypeResources and their operations over a ChaosTargetTypeResource. - public virtual ChaosTargetTypeCollection GetChaosTargetTypes(string locationName) + /// Gets a collection of ChaosTargetMetadataResources in the SubscriptionResource. + /// The name of the Azure region. + /// An object representing collection of ChaosTargetMetadataResources and their operations over a ChaosTargetMetadataResource. + public virtual ChaosTargetMetadataCollection GetAllChaosTargetMetadata(AzureLocation location) { - return new ChaosTargetTypeCollection(Client, Id, locationName); + return new ChaosTargetMetadataCollection(Client, Id, location); } /// @@ -56,31 +54,31 @@ public virtual ChaosTargetTypeCollection GetChaosTargetTypes(string locationName /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName} /// /// /// Operation Id - /// TargetTypes_Get + /// TargetType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// - /// String that represents a Location resource name. + /// The name of the Azure region. /// String that represents a Target Type resource name. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetChaosTargetTypeAsync(string locationName, string targetTypeName, CancellationToken cancellationToken = default) + public virtual async Task> GetChaosTargetMetadataAsync(AzureLocation location, string targetTypeName, CancellationToken cancellationToken = default) { - return await GetChaosTargetTypes(locationName).GetAsync(targetTypeName, cancellationToken).ConfigureAwait(false); + return await GetAllChaosTargetMetadata(location).GetAsync(targetTypeName, cancellationToken).ConfigureAwait(false); } /// @@ -88,31 +86,31 @@ public virtual async Task> GetChaosTargetTypeA /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName} + /// /subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName} /// /// /// Operation Id - /// TargetTypes_Get + /// TargetType_Get /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource - /// + /// /// /// /// - /// String that represents a Location resource name. + /// The name of the Azure region. /// String that represents a Target Type resource name. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetChaosTargetType(string locationName, string targetTypeName, CancellationToken cancellationToken = default) + public virtual Response GetChaosTargetMetadata(AzureLocation location, string targetTypeName, CancellationToken cancellationToken = default) { - return GetChaosTargetTypes(locationName).Get(targetTypeName, cancellationToken); + return GetAllChaosTargetMetadata(location).Get(targetTypeName, cancellationToken); } /// @@ -124,11 +122,11 @@ public virtual Response GetChaosTargetType(string locat /// /// /// Operation Id - /// Experiments_ListAll + /// Experiment_ListAll /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource @@ -156,11 +154,11 @@ public virtual AsyncPageable GetChaosExperimentsAsync(b /// /// /// Operation Id - /// Experiments_ListAll + /// Experiment_ListAll /// /// /// Default Api Version - /// 2024-01-01 + /// 2025-01-01 /// /// /// Resource diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityListResult.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityListResult.Serialization.cs index 5b615772ec94..54219141d5ee 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityListResult.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityListResult.Serialization.cs @@ -34,27 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(CapabilityListResult)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { - if (NextLink != null) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - else - { - writer.WriteNull("nextLink"); - } + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -94,17 +84,13 @@ internal static CapabilityListResult DeserializeCapabilityListResult(JsonElement return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -117,10 +103,9 @@ internal static CapabilityListResult DeserializeCapabilityListResult(JsonElement { if (property.Value.ValueKind == JsonValueKind.Null) { - nextLink = null; continue; } - nextLink = property.Value.GetString(); + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -129,7 +114,7 @@ internal static CapabilityListResult DeserializeCapabilityListResult(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new CapabilityListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new CapabilityListResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityListResult.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityListResult.cs index 3d1affab8bc4..8663d8094d2b 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityListResult.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityListResult.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Chaos.Models { @@ -46,25 +47,34 @@ internal partial class CapabilityListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal CapabilityListResult() + /// The Capability items on this page. + /// is null. + internal CapabilityListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// List of Capability resources. - /// URL to retrieve the next page of Capability resources. + /// The Capability items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal CapabilityListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal CapabilityListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Capability resources. + /// Initializes a new instance of for deserialization. + internal CapabilityListResult() + { + } + + /// The Capability items on this page. public IReadOnlyList Value { get; } - /// URL to retrieve the next page of Capability resources. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityTypeListResult.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityTypeListResult.Serialization.cs index 5f5e60101edd..f0d9749ee535 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityTypeListResult.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityTypeListResult.Serialization.cs @@ -34,27 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(CapabilityTypeListResult)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { - if (NextLink != null) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - else - { - writer.WriteNull("nextLink"); - } + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -93,22 +83,18 @@ internal static CapabilityTypeListResult DeserializeCapabilityTypeListResult(Jso { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ChaosCapabilityTypeData.DeserializeChaosCapabilityTypeData(item, options)); + array.Add(ChaosCapabilityMetadataData.DeserializeChaosCapabilityMetadataData(item, options)); } value = array; continue; @@ -117,10 +103,9 @@ internal static CapabilityTypeListResult DeserializeCapabilityTypeListResult(Jso { if (property.Value.ValueKind == JsonValueKind.Null) { - nextLink = null; continue; } - nextLink = property.Value.GetString(); + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -129,7 +114,7 @@ internal static CapabilityTypeListResult DeserializeCapabilityTypeListResult(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new CapabilityTypeListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new CapabilityTypeListResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityTypeListResult.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityTypeListResult.cs index 9b4c71caee5b..7fb5e466a932 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityTypeListResult.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/CapabilityTypeListResult.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Chaos.Models { @@ -46,25 +47,34 @@ internal partial class CapabilityTypeListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal CapabilityTypeListResult() + /// The CapabilityType items on this page. + /// is null. + internal CapabilityTypeListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// List of Capability Type resources. - /// URL to retrieve the next page of Capability Type resources. + /// The CapabilityType items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal CapabilityTypeListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal CapabilityTypeListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Capability Type resources. - public IReadOnlyList Value { get; } - /// URL to retrieve the next page of Capability Type resources. - public string NextLink { get; } + /// Initializes a new instance of for deserialization. + internal CapabilityTypeListResult() + { + } + + /// The CapabilityType items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosCapabilityTypeRuntimeProperties.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosCapabilityMetadataRuntimeProperties.Serialization.cs similarity index 62% rename from sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosCapabilityTypeRuntimeProperties.Serialization.cs rename to sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosCapabilityMetadataRuntimeProperties.Serialization.cs index d27031332572..d8e606165516 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosCapabilityTypeRuntimeProperties.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosCapabilityMetadataRuntimeProperties.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.Chaos.Models { - internal partial class ChaosCapabilityTypeRuntimeProperties : IUtf8JsonSerializable, IJsonModel + internal partial class ChaosCapabilityMetadataRuntimeProperties : 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,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter write /// 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(ChaosCapabilityTypeRuntimeProperties)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ChaosCapabilityMetadataRuntimeProperties)} does not support writing '{format}' format."); } if (options.Format != "W" && Optional.IsDefined(Kind)) @@ -56,19 +56,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ChaosCapabilityTypeRuntimeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ChaosCapabilityMetadataRuntimeProperties 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(ChaosCapabilityTypeRuntimeProperties)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ChaosCapabilityMetadataRuntimeProperties)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChaosCapabilityTypeRuntimeProperties(document.RootElement, options); + return DeserializeChaosCapabilityMetadataRuntimeProperties(document.RootElement, options); } - internal static ChaosCapabilityTypeRuntimeProperties DeserializeChaosCapabilityTypeRuntimeProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static ChaosCapabilityMetadataRuntimeProperties DeserializeChaosCapabilityMetadataRuntimeProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -92,38 +92,38 @@ internal static ChaosCapabilityTypeRuntimeProperties DeserializeChaosCapabilityT } } serializedAdditionalRawData = rawDataDictionary; - return new ChaosCapabilityTypeRuntimeProperties(kind, serializedAdditionalRawData); + return new ChaosCapabilityMetadataRuntimeProperties(kind, 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(ChaosCapabilityTypeRuntimeProperties)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChaosCapabilityMetadataRuntimeProperties)} does not support writing '{options.Format}' format."); } } - ChaosCapabilityTypeRuntimeProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ChaosCapabilityMetadataRuntimeProperties 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 DeserializeChaosCapabilityTypeRuntimeProperties(document.RootElement, options); + return DeserializeChaosCapabilityMetadataRuntimeProperties(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ChaosCapabilityTypeRuntimeProperties)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ChaosCapabilityMetadataRuntimeProperties)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosCapabilityTypeRuntimeProperties.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosCapabilityMetadataRuntimeProperties.cs similarity index 86% rename from sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosCapabilityTypeRuntimeProperties.cs rename to sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosCapabilityMetadataRuntimeProperties.cs index 45896c61ad66..886bdaa20f89 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosCapabilityTypeRuntimeProperties.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosCapabilityMetadataRuntimeProperties.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Chaos.Models { /// Runtime properties of this Capability Type. - internal partial class ChaosCapabilityTypeRuntimeProperties + internal partial class ChaosCapabilityMetadataRuntimeProperties { /// /// Keeps track of any properties unknown to the library. @@ -45,15 +45,15 @@ internal partial class ChaosCapabilityTypeRuntimeProperties /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - public ChaosCapabilityTypeRuntimeProperties() + /// Initializes a new instance of . + internal ChaosCapabilityMetadataRuntimeProperties() { } - /// Initializes a new instance of . + /// Initializes a new instance of . /// String of the kind of the resource's action type (continuous or discrete). /// Keeps track of any properties unknown to the library. - internal ChaosCapabilityTypeRuntimeProperties(string kind, IDictionary serializedAdditionalRawData) + internal ChaosCapabilityMetadataRuntimeProperties(string kind, IDictionary serializedAdditionalRawData) { Kind = kind; _serializedAdditionalRawData = serializedAdditionalRawData; diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosContinuousAction.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosContinuousAction.Serialization.cs index c6fd2c8ed1d0..360b3faa42ca 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosContinuousAction.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosContinuousAction.Serialization.cs @@ -71,8 +71,8 @@ internal static ChaosContinuousAction DeserializeChaosContinuousAction(JsonEleme TimeSpan duration = default; IList parameters = default; string selectorId = default; - string type = default; string name = default; + ExperimentActionType type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -97,14 +97,14 @@ internal static ChaosContinuousAction DeserializeChaosContinuousAction(JsonEleme selectorId = property.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (property.NameEquals("name"u8)) { - type = property.Value.GetString(); + name = property.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (property.NameEquals("type"u8)) { - name = property.Value.GetString(); + type = new ExperimentActionType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -114,8 +114,8 @@ internal static ChaosContinuousAction DeserializeChaosContinuousAction(JsonEleme } serializedAdditionalRawData = rawDataDictionary; return new ChaosContinuousAction( - type, name, + type, serializedAdditionalRawData, duration, parameters, diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosContinuousAction.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosContinuousAction.cs index 4b80d544efbb..8f85fd804c92 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosContinuousAction.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosContinuousAction.cs @@ -29,22 +29,22 @@ public ChaosContinuousAction(string name, TimeSpan duration, IEnumerable Initializes a new instance of . - /// Enum that discriminates between action models. /// String that represents a Capability URN. + /// Chaos experiment action discriminator type. /// Keeps track of any properties unknown to the library. /// ISO8601 formatted string that represents a duration. /// List of key value pairs. /// String that represents a selector. - internal ChaosContinuousAction(string actionType, string name, IDictionary serializedAdditionalRawData, TimeSpan duration, IList parameters, string selectorId) : base(actionType, name, serializedAdditionalRawData) + internal ChaosContinuousAction(string name, ExperimentActionType type, IDictionary serializedAdditionalRawData, TimeSpan duration, IList parameters, string selectorId) : base(name, type, serializedAdditionalRawData) { Duration = duration; Parameters = parameters; SelectorId = selectorId; - ActionType = actionType ?? "continuous"; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDelayAction.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDelayAction.Serialization.cs index ce26348b55a6..9248dd6b9108 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDelayAction.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDelayAction.Serialization.cs @@ -60,8 +60,8 @@ internal static ChaosDelayAction DeserializeChaosDelayAction(JsonElement element return null; } TimeSpan duration = default; - string type = default; string name = default; + ExperimentActionType type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -71,14 +71,14 @@ internal static ChaosDelayAction DeserializeChaosDelayAction(JsonElement element duration = property.Value.GetTimeSpan("P"); continue; } - if (property.NameEquals("type"u8)) + if (property.NameEquals("name"u8)) { - type = property.Value.GetString(); + name = property.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (property.NameEquals("type"u8)) { - name = property.Value.GetString(); + type = new ExperimentActionType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -87,7 +87,7 @@ internal static ChaosDelayAction DeserializeChaosDelayAction(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new ChaosDelayAction(type, name, serializedAdditionalRawData, duration); + return new ChaosDelayAction(name, type, serializedAdditionalRawData, duration); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDelayAction.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDelayAction.cs index ea17fa0f5331..2ce6c694aee4 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDelayAction.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDelayAction.cs @@ -22,18 +22,18 @@ public ChaosDelayAction(string name, TimeSpan duration) : base(name) Argument.AssertNotNull(name, nameof(name)); Duration = duration; - ActionType = "delay"; + Type = ExperimentActionType.Delay; } /// Initializes a new instance of . - /// Enum that discriminates between action models. /// String that represents a Capability URN. + /// Chaos experiment action discriminator type. /// Keeps track of any properties unknown to the library. /// ISO8601 formatted string that represents a duration. - internal ChaosDelayAction(string actionType, string name, IDictionary serializedAdditionalRawData, TimeSpan duration) : base(actionType, name, serializedAdditionalRawData) + internal ChaosDelayAction(string name, ExperimentActionType type, IDictionary serializedAdditionalRawData, TimeSpan duration) : base(name, type, serializedAdditionalRawData) { Duration = duration; - ActionType = actionType ?? "delay"; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDiscreteAction.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDiscreteAction.Serialization.cs index 8c3137ea854c..64ae5ab4e6f9 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDiscreteAction.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDiscreteAction.Serialization.cs @@ -68,8 +68,8 @@ internal static ChaosDiscreteAction DeserializeChaosDiscreteAction(JsonElement e } IList parameters = default; string selectorId = default; - string type = default; string name = default; + ExperimentActionType type = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -89,14 +89,14 @@ internal static ChaosDiscreteAction DeserializeChaosDiscreteAction(JsonElement e selectorId = property.Value.GetString(); continue; } - if (property.NameEquals("type"u8)) + if (property.NameEquals("name"u8)) { - type = property.Value.GetString(); + name = property.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (property.NameEquals("type"u8)) { - name = property.Value.GetString(); + type = new ExperimentActionType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -105,7 +105,7 @@ internal static ChaosDiscreteAction DeserializeChaosDiscreteAction(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new ChaosDiscreteAction(type, name, serializedAdditionalRawData, parameters, selectorId); + return new ChaosDiscreteAction(name, type, serializedAdditionalRawData, parameters, selectorId); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDiscreteAction.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDiscreteAction.cs index dd58016a3ba4..41584a95e7f0 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDiscreteAction.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosDiscreteAction.cs @@ -27,20 +27,20 @@ public ChaosDiscreteAction(string name, IEnumerable parameter Parameters = parameters.ToList(); SelectorId = selectorId; - ActionType = "discrete"; + Type = ExperimentActionType.Discrete; } /// Initializes a new instance of . - /// Enum that discriminates between action models. /// String that represents a Capability URN. + /// Chaos experiment action discriminator type. /// Keeps track of any properties unknown to the library. /// List of key value pairs. /// String that represents a selector. - internal ChaosDiscreteAction(string actionType, string name, IDictionary serializedAdditionalRawData, IList parameters, string selectorId) : base(actionType, name, serializedAdditionalRawData) + internal ChaosDiscreteAction(string name, ExperimentActionType type, IDictionary serializedAdditionalRawData, IList parameters, string selectorId) : base(name, type, serializedAdditionalRawData) { Parameters = parameters; SelectorId = selectorId; - ActionType = actionType ?? "discrete"; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentAction.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentAction.Serialization.cs index dda84ff126ef..1f402c3a7c44 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentAction.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentAction.Serialization.cs @@ -34,10 +34,10 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ChaosExperimentAction)} does not support writing '{format}' format."); } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ActionType); writer.WritePropertyName("name"u8); writer.WriteStringValue(Name); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentAction.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentAction.cs index 871b7bacb9a3..99a5875b2715 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentAction.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentAction.cs @@ -60,13 +60,13 @@ protected ChaosExperimentAction(string name) } /// Initializes a new instance of . - /// Enum that discriminates between action models. /// String that represents a Capability URN. + /// Chaos experiment action discriminator type. /// Keeps track of any properties unknown to the library. - internal ChaosExperimentAction(string actionType, string name, IDictionary serializedAdditionalRawData) + internal ChaosExperimentAction(string name, ExperimentActionType type, IDictionary serializedAdditionalRawData) { - ActionType = actionType; Name = name; + Type = type; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -75,9 +75,9 @@ internal ChaosExperimentAction() { } - /// Enum that discriminates between action models. - internal string ActionType { get; set; } /// String that represents a Capability URN. public string Name { get; set; } + /// Chaos experiment action discriminator type. + internal ExperimentActionType Type { get; set; } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentPatch.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentPatch.Serialization.cs index cb8bd40b8ba2..c53e297eb20b 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentPatch.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentPatch.Serialization.cs @@ -35,11 +35,6 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ChaosExperimentPatch)} does not support writing '{format}' format."); } - if (Optional.IsDefined(Identity)) - { - writer.WritePropertyName("identity"u8); - JsonSerializer.Serialize(writer, Identity); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -51,6 +46,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WriteEndObject(); } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -88,21 +89,12 @@ internal static ChaosExperimentPatch DeserializeChaosExperimentPatch(JsonElement { return null; } - ManagedServiceIdentity identity = default; IDictionary tags = default; + ManagedServiceIdentity identity = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("identity"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - identity = JsonSerializer.Deserialize(property.Value.GetRawText()); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -117,13 +109,23 @@ internal static ChaosExperimentPatch DeserializeChaosExperimentPatch(JsonElement tags = dictionary; continue; } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new ChaosExperimentPatch(identity, tags ?? new ChangeTrackingDictionary(), serializedAdditionalRawData); + return new ChaosExperimentPatch(tags ?? new ChangeTrackingDictionary(), identity, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentPatch.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentPatch.cs index a8fb90c2ab0c..846cb33923a0 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentPatch.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentPatch.cs @@ -53,19 +53,19 @@ public ChaosExperimentPatch() } /// Initializes a new instance of . - /// The identity of the experiment resource. Current supported identity types: None, SystemAssigned, UserAssigned. - /// The tags of the experiment resource. + /// Resource tags. + /// The managed service identities assigned to this resource. /// Keeps track of any properties unknown to the library. - internal ChaosExperimentPatch(ManagedServiceIdentity identity, IDictionary tags, IDictionary serializedAdditionalRawData) + internal ChaosExperimentPatch(IDictionary tags, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) { - Identity = identity; Tags = tags; + Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The identity of the experiment resource. Current supported identity types: None, SystemAssigned, UserAssigned. - public ManagedServiceIdentity Identity { get; set; } - /// The tags of the experiment resource. + /// Resource tags. public IDictionary Tags { get; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosProvisioningState.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosProvisioningState.cs index f8ef3ce34f24..0d287769171a 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosProvisioningState.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosProvisioningState.cs @@ -29,17 +29,17 @@ public ChaosProvisioningState(string value) private const string UpdatingValue = "Updating"; private const string DeletingValue = "Deleting"; - /// Succeeded. + /// Resource has been created. public static ChaosProvisioningState Succeeded { get; } = new ChaosProvisioningState(SucceededValue); - /// Failed. + /// Resource creation failed. public static ChaosProvisioningState Failed { get; } = new ChaosProvisioningState(FailedValue); - /// Canceled. + /// Resource creation was canceled. public static ChaosProvisioningState Canceled { get; } = new ChaosProvisioningState(CanceledValue); - /// Creating. + /// Initial creation in progress. public static ChaosProvisioningState Creating { get; } = new ChaosProvisioningState(CreatingValue); - /// Updating. + /// Update in progress. public static ChaosProvisioningState Updating { get; } = new ChaosProvisioningState(UpdatingValue); - /// Deleting. + /// Deletion in progress. public static ChaosProvisioningState Deleting { get; } = new ChaosProvisioningState(DeletingValue); /// Determines if two values are the same. public static bool operator ==(ChaosProvisioningState left, ChaosProvisioningState right) => left.Equals(right); diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetFilter.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetFilter.Serialization.cs index 958477d3297a..9b5aa5405670 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetFilter.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetFilter.Serialization.cs @@ -35,7 +35,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("type"u8); - writer.WriteStringValue(FilterType.ToString()); + writer.WriteStringValue(Type.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetFilter.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetFilter.cs index 5cd0a74914d1..f4537e1899f6 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetFilter.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetFilter.cs @@ -55,15 +55,15 @@ protected ChaosTargetFilter() } /// Initializes a new instance of . - /// Enum that discriminates between filter types. Currently only `Simple` type is supported. + /// Chaos target filter discriminator type. /// Keeps track of any properties unknown to the library. - internal ChaosTargetFilter(FilterType filterType, IDictionary serializedAdditionalRawData) + internal ChaosTargetFilter(FilterType type, IDictionary serializedAdditionalRawData) { - FilterType = filterType; + Type = type; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Enum that discriminates between filter types. Currently only `Simple` type is supported. - internal FilterType FilterType { get; set; } + /// Chaos target filter discriminator type. + internal FilterType Type { get; set; } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetListSelector.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetListSelector.Serialization.cs index 051bc84cb3dd..d517e392253b 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetListSelector.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetListSelector.Serialization.cs @@ -42,18 +42,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(item, options); } writer.WriteEndArray(); - foreach (var item in AdditionalProperties) - { - 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 - } } ChaosTargetListSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -77,11 +65,11 @@ internal static ChaosTargetListSelector DeserializeChaosTargetListSelector(JsonE return null; } IList targets = default; - SelectorType type = default; string id = default; + SelectorType type = default; ChaosTargetFilter filter = default; - IDictionary additionalProperties = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("targets"u8)) @@ -94,14 +82,14 @@ internal static ChaosTargetListSelector DeserializeChaosTargetListSelector(JsonE targets = array; continue; } - if (property.NameEquals("type"u8)) + if (property.NameEquals("id"u8)) { - type = new SelectorType(property.Value.GetString()); + id = property.Value.GetString(); continue; } - if (property.NameEquals("id"u8)) + if (property.NameEquals("type"u8)) { - id = property.Value.GetString(); + type = new SelectorType(property.Value.GetString()); continue; } if (property.NameEquals("filter"u8)) @@ -113,10 +101,13 @@ internal static ChaosTargetListSelector DeserializeChaosTargetListSelector(JsonE filter = ChaosTargetFilter.DeserializeChaosTargetFilter(property.Value, options); continue; } - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } } - additionalProperties = additionalPropertiesDictionary; - return new ChaosTargetListSelector(type, id, filter, additionalProperties, targets); + serializedAdditionalRawData = rawDataDictionary; + return new ChaosTargetListSelector(id, type, filter, serializedAdditionalRawData, targets); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetListSelector.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetListSelector.cs index 1a2b17c666d9..35c146aa1e45 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetListSelector.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetListSelector.cs @@ -24,23 +24,23 @@ public ChaosTargetListSelector(string id, IEnumerable targ Argument.AssertNotNull(targets, nameof(targets)); Targets = targets.ToList(); - SelectorType = SelectorType.List; + Type = SelectorType.List; } /// Initializes a new instance of . - /// Enum of the selector type. /// String of the selector ID. + /// Chaos target selector discriminator type. /// /// Model that represents available filter types that can be applied to a targets list. /// 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 . /// - /// Additional Properties. + /// Keeps track of any properties unknown to the library. /// List of Target references. - internal ChaosTargetListSelector(SelectorType selectorType, string id, ChaosTargetFilter filter, IDictionary additionalProperties, IList targets) : base(selectorType, id, filter, additionalProperties) + internal ChaosTargetListSelector(string id, SelectorType type, ChaosTargetFilter filter, IDictionary serializedAdditionalRawData, IList targets) : base(id, type, filter, serializedAdditionalRawData) { Targets = targets; - SelectorType = selectorType; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetQuerySelector.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetQuerySelector.Serialization.cs index dd87000eae0d..b37f56b4c41b 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetQuerySelector.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetQuerySelector.Serialization.cs @@ -44,18 +44,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WriteStringValue(item); } writer.WriteEndArray(); - foreach (var item in AdditionalProperties) - { - 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 - } } ChaosTargetQuerySelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -80,11 +68,11 @@ internal static ChaosTargetQuerySelector DeserializeChaosTargetQuerySelector(Jso } string queryString = default; IList subscriptionIds = default; - SelectorType type = default; string id = default; + SelectorType type = default; ChaosTargetFilter filter = default; - IDictionary additionalProperties = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("queryString"u8)) @@ -102,14 +90,14 @@ internal static ChaosTargetQuerySelector DeserializeChaosTargetQuerySelector(Jso subscriptionIds = array; continue; } - if (property.NameEquals("type"u8)) + if (property.NameEquals("id"u8)) { - type = new SelectorType(property.Value.GetString()); + id = property.Value.GetString(); continue; } - if (property.NameEquals("id"u8)) + if (property.NameEquals("type"u8)) { - id = property.Value.GetString(); + type = new SelectorType(property.Value.GetString()); continue; } if (property.NameEquals("filter"u8)) @@ -121,14 +109,17 @@ internal static ChaosTargetQuerySelector DeserializeChaosTargetQuerySelector(Jso filter = ChaosTargetFilter.DeserializeChaosTargetFilter(property.Value, options); continue; } - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } } - additionalProperties = additionalPropertiesDictionary; + serializedAdditionalRawData = rawDataDictionary; return new ChaosTargetQuerySelector( - type, id, + type, filter, - additionalProperties, + serializedAdditionalRawData, queryString, subscriptionIds); } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetQuerySelector.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetQuerySelector.cs index 9adbfcf934b9..076c8159ac88 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetQuerySelector.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetQuerySelector.cs @@ -27,25 +27,25 @@ public ChaosTargetQuerySelector(string id, string queryString, IEnumerable Initializes a new instance of . - /// Enum of the selector type. /// String of the selector ID. + /// Chaos target selector discriminator type. /// /// Model that represents available filter types that can be applied to a targets list. /// 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 . /// - /// Additional Properties. + /// Keeps track of any properties unknown to the library. /// Azure Resource Graph (ARG) Query Language query for target resources. /// Subscription id list to scope resource query. - internal ChaosTargetQuerySelector(SelectorType selectorType, string id, ChaosTargetFilter filter, IDictionary additionalProperties, string queryString, IList subscriptionIds) : base(selectorType, id, filter, additionalProperties) + internal ChaosTargetQuerySelector(string id, SelectorType type, ChaosTargetFilter filter, IDictionary serializedAdditionalRawData, string queryString, IList subscriptionIds) : base(id, type, filter, serializedAdditionalRawData) { QueryString = queryString; SubscriptionIds = subscriptionIds; - SelectorType = selectorType; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetReferenceType.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetReferenceType.cs index 81c7ef271f28..50a0babae37e 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetReferenceType.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetReferenceType.cs @@ -24,7 +24,7 @@ public ChaosTargetReferenceType(string value) private const string ChaosTargetValue = "ChaosTarget"; - /// ChaosTarget. + /// Chaos target reference type. public static ChaosTargetReferenceType ChaosTarget { get; } = new ChaosTargetReferenceType(ChaosTargetValue); /// Determines if two values are the same. public static bool operator ==(ChaosTargetReferenceType left, ChaosTargetReferenceType right) => left.Equals(right); diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetSelector.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetSelector.Serialization.cs index 213037e05d54..bc6178354395 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetSelector.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetSelector.Serialization.cs @@ -34,26 +34,29 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ChaosTargetSelector)} does not support writing '{format}' format."); } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(SelectorType.ToString()); writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); if (Optional.IsDefined(Filter)) { writer.WritePropertyName("filter"u8); writer.WriteObjectValue(Filter, options); } - foreach (var item in AdditionalProperties) + if (options.Format != "W" && _serializedAdditionalRawData != null) { - writer.WritePropertyName(item.Key); + foreach (var 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); - } + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } #endif + } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetSelector.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetSelector.cs index cf3f0d44eb2c..68db92619368 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetSelector.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetSelector.cs @@ -17,6 +17,38 @@ namespace Azure.ResourceManager.Chaos.Models /// public abstract partial class ChaosTargetSelector { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 . /// String of the selector ID. /// is null. @@ -25,24 +57,23 @@ protected ChaosTargetSelector(string id) Argument.AssertNotNull(id, nameof(id)); Id = id; - AdditionalProperties = new ChangeTrackingDictionary(); } /// Initializes a new instance of . - /// Enum of the selector type. /// String of the selector ID. + /// Chaos target selector discriminator type. /// /// Model that represents available filter types that can be applied to a targets list. /// 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 . /// - /// Additional Properties. - internal ChaosTargetSelector(SelectorType selectorType, string id, ChaosTargetFilter filter, IDictionary additionalProperties) + /// Keeps track of any properties unknown to the library. + internal ChaosTargetSelector(string id, SelectorType type, ChaosTargetFilter filter, IDictionary serializedAdditionalRawData) { - SelectorType = selectorType; Id = id; + Type = type; Filter = filter; - AdditionalProperties = additionalProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; } /// Initializes a new instance of for deserialization. @@ -50,46 +81,15 @@ internal ChaosTargetSelector() { } - /// Enum of the selector type. - internal SelectorType SelectorType { get; set; } /// String of the selector ID. public string Id { get; set; } + /// Chaos target selector discriminator type. + internal SelectorType Type { get; set; } /// /// Model that represents available filter types that can be applied to a targets list. /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include . /// public ChaosTargetFilter Filter { get; set; } - /// - /// Additional Properties - /// - /// To assign an object to the value of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IDictionary AdditionalProperties { get; } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetSimpleFilter.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetSimpleFilter.cs index 2372226568c2..51cd20742491 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetSimpleFilter.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosTargetSimpleFilter.cs @@ -16,17 +16,17 @@ public partial class ChaosTargetSimpleFilter : ChaosTargetFilter /// Initializes a new instance of . public ChaosTargetSimpleFilter() { - FilterType = FilterType.Simple; + Type = FilterType.Simple; } /// Initializes a new instance of . - /// Enum that discriminates between filter types. Currently only `Simple` type is supported. + /// Chaos target filter discriminator type. /// Keeps track of any properties unknown to the library. /// Model that represents the Simple filter parameters. - internal ChaosTargetSimpleFilter(FilterType filterType, IDictionary serializedAdditionalRawData, ChaosTargetSimpleFilterParameters parameters) : base(filterType, serializedAdditionalRawData) + internal ChaosTargetSimpleFilter(FilterType type, IDictionary serializedAdditionalRawData, ChaosTargetSimpleFilterParameters parameters) : base(type, serializedAdditionalRawData) { Parameters = parameters; - FilterType = filterType; + Type = type; } /// Model that represents the Simple filter parameters. diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentActionType.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentActionType.cs new file mode 100644 index 000000000000..5aed7336cbe8 --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentActionType.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.Chaos.Models +{ + /// Enum union of Chaos experiment action types. + internal readonly partial struct ExperimentActionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ExperimentActionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DelayValue = "delay"; + private const string DiscreteValue = "discrete"; + private const string ContinuousValue = "continuous"; + + /// delay. + public static ExperimentActionType Delay { get; } = new ExperimentActionType(DelayValue); + /// discrete. + public static ExperimentActionType Discrete { get; } = new ExperimentActionType(DiscreteValue); + /// continuous. + public static ExperimentActionType Continuous { get; } = new ExperimentActionType(ContinuousValue); + /// Determines if two values are the same. + public static bool operator ==(ExperimentActionType left, ExperimentActionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ExperimentActionType left, ExperimentActionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ExperimentActionType(string value) => new ExperimentActionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ExperimentActionType other && Equals(other); + /// + public bool Equals(ExperimentActionType 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/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionActionTargetDetailsProperties.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionActionTargetDetailsProperties.Serialization.cs index 6a36d95e1153..e40b0f27ef8a 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionActionTargetDetailsProperties.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionActionTargetDetailsProperties.Serialization.cs @@ -46,39 +46,18 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } if (options.Format != "W" && Optional.IsDefined(TargetFailedOn)) { - if (TargetFailedOn != null) - { - writer.WritePropertyName("targetFailedTime"u8); - writer.WriteStringValue(TargetFailedOn.Value, "O"); - } - else - { - writer.WriteNull("targetFailedTime"); - } + writer.WritePropertyName("targetFailedTime"u8); + writer.WriteStringValue(TargetFailedOn.Value, "O"); } if (options.Format != "W" && Optional.IsDefined(TargetCompletedOn)) { - if (TargetCompletedOn != null) - { - writer.WritePropertyName("targetCompletedTime"u8); - writer.WriteStringValue(TargetCompletedOn.Value, "O"); - } - else - { - writer.WriteNull("targetCompletedTime"); - } + writer.WritePropertyName("targetCompletedTime"u8); + writer.WriteStringValue(TargetCompletedOn.Value, "O"); } if (options.Format != "W" && Optional.IsDefined(Error)) { - if (Error != null) - { - writer.WritePropertyName("error"u8); - writer.WriteObjectValue(Error, options); - } - else - { - writer.WriteNull("error"); - } + writer.WritePropertyName("error"u8); + writer.WriteObjectValue(Error, options); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -140,7 +119,6 @@ internal static ExperimentExecutionActionTargetDetailsProperties DeserializeExpe { if (property.Value.ValueKind == JsonValueKind.Null) { - targetFailedTime = null; continue; } targetFailedTime = property.Value.GetDateTimeOffset("O"); @@ -150,7 +128,6 @@ internal static ExperimentExecutionActionTargetDetailsProperties DeserializeExpe { if (property.Value.ValueKind == JsonValueKind.Null) { - targetCompletedTime = null; continue; } targetCompletedTime = property.Value.GetDateTimeOffset("O"); @@ -160,7 +137,6 @@ internal static ExperimentExecutionActionTargetDetailsProperties DeserializeExpe { if (property.Value.ValueKind == JsonValueKind.Null) { - error = null; continue; } error = ExperimentExecutionActionTargetDetailsError.DeserializeExperimentExecutionActionTargetDetailsError(property.Value, options); diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetails.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetails.Serialization.cs index 03689b50351f..0cb7b490e69f 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetails.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetails.Serialization.cs @@ -100,7 +100,7 @@ internal static ExperimentExecutionDetails DeserializeExperimentExecutionDetails DateTimeOffset? stoppedAt = default; string failureReason = default; DateTimeOffset? lastActionAt = default; - ChaosExperimentRunInformation runInformation = default; + ExperimentExecutionDetailsPropertiesRunInformation runInformation = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -181,7 +181,7 @@ internal static ExperimentExecutionDetails DeserializeExperimentExecutionDetails { continue; } - runInformation = ChaosExperimentRunInformation.DeserializeChaosExperimentRunInformation(property0.Value, options); + runInformation = ExperimentExecutionDetailsPropertiesRunInformation.DeserializeExperimentExecutionDetailsPropertiesRunInformation(property0.Value, options); continue; } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetails.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetails.cs index 45df3088540d..a060d158b0a2 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetails.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetails.cs @@ -64,7 +64,7 @@ internal ExperimentExecutionDetails() /// String that represents the last action date time. /// The information of the experiment run. /// Keeps track of any properties unknown to the library. - internal ExperimentExecutionDetails(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string status, DateTimeOffset? startedOn, DateTimeOffset? stoppedOn, string failureReason, DateTimeOffset? lastActionOn, ChaosExperimentRunInformation runInformation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ExperimentExecutionDetails(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string status, DateTimeOffset? startedOn, DateTimeOffset? stoppedOn, string failureReason, DateTimeOffset? lastActionOn, ExperimentExecutionDetailsPropertiesRunInformation runInformation, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { Status = status; StartedOn = startedOn; @@ -86,7 +86,7 @@ internal ExperimentExecutionDetails(ResourceIdentifier id, string name, Resource /// String that represents the last action date time. public DateTimeOffset? LastActionOn { get; } /// The information of the experiment run. - internal ChaosExperimentRunInformation RunInformation { get; } + internal ExperimentExecutionDetailsPropertiesRunInformation RunInformation { get; } /// The steps of the experiment run. public IReadOnlyList RunInformationSteps { diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentRunInformation.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetailsPropertiesRunInformation.Serialization.cs similarity index 61% rename from sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentRunInformation.Serialization.cs rename to sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetailsPropertiesRunInformation.Serialization.cs index 94aa43822f6f..9e8190d2ef62 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentRunInformation.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetailsPropertiesRunInformation.Serialization.cs @@ -13,11 +13,11 @@ namespace Azure.ResourceManager.Chaos.Models { - internal partial class ChaosExperimentRunInformation : IUtf8JsonSerializable, IJsonModel + internal partial class ExperimentExecutionDetailsPropertiesRunInformation : 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,10 +28,10 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode /// 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(ChaosExperimentRunInformation)} does not support writing '{format}' format."); + throw new FormatException($"The model {nameof(ExperimentExecutionDetailsPropertiesRunInformation)} does not support writing '{format}' format."); } if (options.Format != "W" && Optional.IsCollectionDefined(Steps)) @@ -61,19 +61,19 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } } - ChaosExperimentRunInformation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + ExperimentExecutionDetailsPropertiesRunInformation 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(ChaosExperimentRunInformation)} does not support reading '{format}' format."); + throw new FormatException($"The model {nameof(ExperimentExecutionDetailsPropertiesRunInformation)} does not support reading '{format}' format."); } using JsonDocument document = JsonDocument.ParseValue(ref reader); - return DeserializeChaosExperimentRunInformation(document.RootElement, options); + return DeserializeExperimentExecutionDetailsPropertiesRunInformation(document.RootElement, options); } - internal static ChaosExperimentRunInformation DeserializeChaosExperimentRunInformation(JsonElement element, ModelReaderWriterOptions options = null) + internal static ExperimentExecutionDetailsPropertiesRunInformation DeserializeExperimentExecutionDetailsPropertiesRunInformation(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -106,38 +106,38 @@ internal static ChaosExperimentRunInformation DeserializeChaosExperimentRunInfor } } serializedAdditionalRawData = rawDataDictionary; - return new ChaosExperimentRunInformation(steps ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new ExperimentExecutionDetailsPropertiesRunInformation(steps ?? new ChangeTrackingList(), 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(ChaosExperimentRunInformation)} does not support writing '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExperimentExecutionDetailsPropertiesRunInformation)} does not support writing '{options.Format}' format."); } } - ChaosExperimentRunInformation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + ExperimentExecutionDetailsPropertiesRunInformation 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 DeserializeChaosExperimentRunInformation(document.RootElement, options); + return DeserializeExperimentExecutionDetailsPropertiesRunInformation(document.RootElement, options); } default: - throw new FormatException($"The model {nameof(ChaosExperimentRunInformation)} does not support reading '{options.Format}' format."); + throw new FormatException($"The model {nameof(ExperimentExecutionDetailsPropertiesRunInformation)} does not support reading '{options.Format}' format."); } } - string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentRunInformation.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetailsPropertiesRunInformation.cs similarity index 79% rename from sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentRunInformation.cs rename to sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetailsPropertiesRunInformation.cs index 52edf055a4aa..b392c35caef2 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ChaosExperimentRunInformation.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionDetailsPropertiesRunInformation.cs @@ -11,7 +11,7 @@ namespace Azure.ResourceManager.Chaos.Models { /// The information of the experiment run. - internal partial class ChaosExperimentRunInformation + internal partial class ExperimentExecutionDetailsPropertiesRunInformation { /// /// Keeps track of any properties unknown to the library. @@ -45,16 +45,16 @@ internal partial class ChaosExperimentRunInformation /// private IDictionary _serializedAdditionalRawData; - /// Initializes a new instance of . - internal ChaosExperimentRunInformation() + /// Initializes a new instance of . + internal ExperimentExecutionDetailsPropertiesRunInformation() { Steps = new ChangeTrackingList(); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The steps of the experiment run. /// Keeps track of any properties unknown to the library. - internal ChaosExperimentRunInformation(IReadOnlyList steps, IDictionary serializedAdditionalRawData) + internal ExperimentExecutionDetailsPropertiesRunInformation(IReadOnlyList steps, IDictionary serializedAdditionalRawData) { Steps = steps; _serializedAdditionalRawData = serializedAdditionalRawData; diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionListResult.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionListResult.Serialization.cs index d27906d6134e..3a5201562a80 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionListResult.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionListResult.Serialization.cs @@ -34,27 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ExperimentExecutionListResult)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { - if (NextLink != null) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - else - { - writer.WriteNull("nextLink"); - } + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -94,17 +84,13 @@ internal static ExperimentExecutionListResult DeserializeExperimentExecutionList return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -117,10 +103,9 @@ internal static ExperimentExecutionListResult DeserializeExperimentExecutionList { if (property.Value.ValueKind == JsonValueKind.Null) { - nextLink = null; continue; } - nextLink = property.Value.GetString(); + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -129,7 +114,7 @@ internal static ExperimentExecutionListResult DeserializeExperimentExecutionList } } serializedAdditionalRawData = rawDataDictionary; - return new ExperimentExecutionListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ExperimentExecutionListResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionListResult.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionListResult.cs index fe29314a41fc..c59c503d63f5 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionListResult.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentExecutionListResult.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Chaos.Models { @@ -46,25 +47,34 @@ internal partial class ExperimentExecutionListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ExperimentExecutionListResult() + /// The ExperimentExecution items on this page. + /// is null. + internal ExperimentExecutionListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// List of Experiment executions. - /// URL to retrieve the next page of Experiment executions. + /// The ExperimentExecution items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ExperimentExecutionListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ExperimentExecutionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Experiment executions. + /// Initializes a new instance of for deserialization. + internal ExperimentExecutionListResult() + { + } + + /// The ExperimentExecution items on this page. public IReadOnlyList Value { get; } - /// URL to retrieve the next page of Experiment executions. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentListResult.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentListResult.Serialization.cs index 91a7e00a7ae5..33188d419b52 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentListResult.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentListResult.Serialization.cs @@ -34,27 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ExperimentListResult)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { - if (NextLink != null) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - else - { - writer.WriteNull("nextLink"); - } + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -94,17 +84,13 @@ internal static ExperimentListResult DeserializeExperimentListResult(JsonElement return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -117,10 +103,9 @@ internal static ExperimentListResult DeserializeExperimentListResult(JsonElement { if (property.Value.ValueKind == JsonValueKind.Null) { - nextLink = null; continue; } - nextLink = property.Value.GetString(); + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -129,7 +114,7 @@ internal static ExperimentListResult DeserializeExperimentListResult(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new ExperimentListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ExperimentListResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentListResult.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentListResult.cs index a7c9302f6139..a18da4b92a73 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentListResult.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/ExperimentListResult.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Chaos.Models { @@ -46,25 +47,34 @@ internal partial class ExperimentListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ExperimentListResult() + /// The Experiment items on this page. + /// is null. + internal ExperimentListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// List of Experiment resources. - /// URL to retrieve the next page of Experiment resources. + /// The Experiment items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ExperimentListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ExperimentListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Experiment resources. + /// Initializes a new instance of for deserialization. + internal ExperimentListResult() + { + } + + /// The Experiment items on this page. public IReadOnlyList Value { get; } - /// URL to retrieve the next page of Experiment resources. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/FilterType.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/FilterType.cs index f9a091902add..3365bde9cc3f 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/FilterType.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/FilterType.cs @@ -24,7 +24,7 @@ public FilterType(string value) private const string SimpleValue = "Simple"; - /// Simple. + /// Simple filter type. public static FilterType Simple { get; } = new FilterType(SimpleValue); /// Determines if two values are the same. public static bool operator ==(FilterType left, FilterType right) => left.Equals(right); diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/SelectorType.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/SelectorType.cs index 84b72e919ab0..2868c1263f83 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/SelectorType.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/SelectorType.cs @@ -25,9 +25,9 @@ public SelectorType(string value) private const string ListValue = "List"; private const string QueryValue = "Query"; - /// List. + /// List selector type. public static SelectorType List { get; } = new SelectorType(ListValue); - /// Query. + /// Query selector type. public static SelectorType Query { get; } = new SelectorType(QueryValue); /// Determines if two values are the same. public static bool operator ==(SelectorType left, SelectorType right) => left.Equals(right); diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetListResult.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetListResult.Serialization.cs index 879fcac1a57c..af16bb9a1849 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetListResult.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetListResult.Serialization.cs @@ -34,27 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(TargetListResult)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { - if (NextLink != null) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - else - { - writer.WriteNull("nextLink"); - } + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -94,17 +84,13 @@ internal static TargetListResult DeserializeTargetListResult(JsonElement element return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -117,10 +103,9 @@ internal static TargetListResult DeserializeTargetListResult(JsonElement element { if (property.Value.ValueKind == JsonValueKind.Null) { - nextLink = null; continue; } - nextLink = property.Value.GetString(); + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -129,7 +114,7 @@ internal static TargetListResult DeserializeTargetListResult(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new TargetListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new TargetListResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetListResult.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetListResult.cs index 1c040a897709..2fe2a5663e92 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetListResult.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetListResult.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Chaos.Models { @@ -46,25 +47,34 @@ internal partial class TargetListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal TargetListResult() + /// The Target items on this page. + /// is null. + internal TargetListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// List of Target resources. - /// URL to retrieve the next page of Target resources. + /// The Target items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal TargetListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal TargetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Target resources. + /// Initializes a new instance of for deserialization. + internal TargetListResult() + { + } + + /// The Target items on this page. public IReadOnlyList Value { get; } - /// URL to retrieve the next page of Target resources. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetTypeListResult.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetTypeListResult.Serialization.cs index 8a57145ae0ad..f486684fa0e6 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetTypeListResult.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetTypeListResult.Serialization.cs @@ -34,27 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(TargetTypeListResult)} does not support writing '{format}' format."); } - if (options.Format != "W" && Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { - if (NextLink != null) - { - writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); - } - else - { - writer.WriteNull("nextLink"); - } + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -93,22 +83,18 @@ internal static TargetTypeListResult DeserializeTargetTypeListResult(JsonElement { return null; } - IReadOnlyList value = default; - string nextLink = default; + IReadOnlyList value = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(ChaosTargetTypeData.DeserializeChaosTargetTypeData(item, options)); + array.Add(ChaosTargetMetadataData.DeserializeChaosTargetMetadataData(item, options)); } value = array; continue; @@ -117,10 +103,9 @@ internal static TargetTypeListResult DeserializeTargetTypeListResult(JsonElement { if (property.Value.ValueKind == JsonValueKind.Null) { - nextLink = null; continue; } - nextLink = property.Value.GetString(); + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -129,7 +114,7 @@ internal static TargetTypeListResult DeserializeTargetTypeListResult(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new TargetTypeListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new TargetTypeListResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetTypeListResult.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetTypeListResult.cs index 1863c988c988..d3d4e5fbcbbf 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetTypeListResult.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/TargetTypeListResult.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.Chaos.Models { @@ -46,25 +47,34 @@ internal partial class TargetTypeListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal TargetTypeListResult() + /// The TargetType items on this page. + /// is null. + internal TargetTypeListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// List of Target Type resources. - /// URL to retrieve the next page of Target Type resources. + /// The TargetType items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal TargetTypeListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal TargetTypeListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Target Type resources. - public IReadOnlyList Value { get; } - /// URL to retrieve the next page of Target Type resources. - public string NextLink { get; } + /// Initializes a new instance of for deserialization. + internal TargetTypeListResult() + { + } + + /// The TargetType items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosExperimentAction.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosExperimentAction.Serialization.cs index 1f0c462cb65e..79f5ee8f0023 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosExperimentAction.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosExperimentAction.Serialization.cs @@ -57,20 +57,20 @@ internal static UnknownChaosExperimentAction DeserializeUnknownChaosExperimentAc { return null; } - string type = "Unknown"; string name = default; + ExperimentActionType type = "Unknown"; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("type"u8)) + if (property.NameEquals("name"u8)) { - type = property.Value.GetString(); + name = property.Value.GetString(); continue; } - if (property.NameEquals("name"u8)) + if (property.NameEquals("type"u8)) { - name = property.Value.GetString(); + type = new ExperimentActionType(property.Value.GetString()); continue; } if (options.Format != "W") @@ -79,7 +79,7 @@ internal static UnknownChaosExperimentAction DeserializeUnknownChaosExperimentAc } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownChaosExperimentAction(type, name, serializedAdditionalRawData); + return new UnknownChaosExperimentAction(name, type, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosExperimentAction.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosExperimentAction.cs index 9e3a5a856551..27cc978ac20a 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosExperimentAction.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosExperimentAction.cs @@ -14,12 +14,12 @@ namespace Azure.ResourceManager.Chaos.Models internal partial class UnknownChaosExperimentAction : ChaosExperimentAction { /// Initializes a new instance of . - /// Enum that discriminates between action models. /// String that represents a Capability URN. + /// Chaos experiment action discriminator type. /// Keeps track of any properties unknown to the library. - internal UnknownChaosExperimentAction(string actionType, string name, IDictionary serializedAdditionalRawData) : base(actionType, name, serializedAdditionalRawData) + internal UnknownChaosExperimentAction(string name, ExperimentActionType type, IDictionary serializedAdditionalRawData) : base(name, type, serializedAdditionalRawData) { - ActionType = actionType ?? "Unknown"; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosTargetFilter.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosTargetFilter.cs index ed8c681a41a7..d9b50cd4a292 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosTargetFilter.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosTargetFilter.cs @@ -14,11 +14,11 @@ namespace Azure.ResourceManager.Chaos.Models internal partial class UnknownChaosTargetFilter : ChaosTargetFilter { /// Initializes a new instance of . - /// Enum that discriminates between filter types. Currently only `Simple` type is supported. + /// Chaos target filter discriminator type. /// Keeps track of any properties unknown to the library. - internal UnknownChaosTargetFilter(FilterType filterType, IDictionary serializedAdditionalRawData) : base(filterType, serializedAdditionalRawData) + internal UnknownChaosTargetFilter(FilterType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) { - FilterType = filterType; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosTargetSelector.Serialization.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosTargetSelector.Serialization.cs index cd919821aa2d..815ff2ad9ecd 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosTargetSelector.Serialization.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosTargetSelector.Serialization.cs @@ -35,18 +35,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - foreach (var item in AdditionalProperties) - { - 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 - } } ChaosTargetSelector IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) @@ -69,21 +57,21 @@ internal static UnknownChaosTargetSelector DeserializeUnknownChaosTargetSelector { return null; } - SelectorType type = "Unknown"; string id = default; + SelectorType type = "Unknown"; ChaosTargetFilter filter = default; - IDictionary additionalProperties = default; - Dictionary additionalPropertiesDictionary = new Dictionary(); + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("type"u8)) + if (property.NameEquals("id"u8)) { - type = new SelectorType(property.Value.GetString()); + id = property.Value.GetString(); continue; } - if (property.NameEquals("id"u8)) + if (property.NameEquals("type"u8)) { - id = property.Value.GetString(); + type = new SelectorType(property.Value.GetString()); continue; } if (property.NameEquals("filter"u8)) @@ -95,10 +83,13 @@ internal static UnknownChaosTargetSelector DeserializeUnknownChaosTargetSelector filter = ChaosTargetFilter.DeserializeChaosTargetFilter(property.Value, options); continue; } - additionalPropertiesDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } } - additionalProperties = additionalPropertiesDictionary; - return new UnknownChaosTargetSelector(type, id, filter, additionalProperties); + serializedAdditionalRawData = rawDataDictionary; + return new UnknownChaosTargetSelector(id, type, filter, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosTargetSelector.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosTargetSelector.cs index ac54ecfda883..14e062c0c70e 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosTargetSelector.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/Models/UnknownChaosTargetSelector.cs @@ -14,17 +14,17 @@ namespace Azure.ResourceManager.Chaos.Models internal partial class UnknownChaosTargetSelector : ChaosTargetSelector { /// Initializes a new instance of . - /// Enum of the selector type. /// String of the selector ID. + /// Chaos target selector discriminator type. /// /// Model that represents available filter types that can be applied to a targets list. /// 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 . /// - /// Additional Properties. - internal UnknownChaosTargetSelector(SelectorType selectorType, string id, ChaosTargetFilter filter, IDictionary additionalProperties) : base(selectorType, id, filter, additionalProperties) + /// Keeps track of any properties unknown to the library. + internal UnknownChaosTargetSelector(string id, SelectorType type, ChaosTargetFilter filter, IDictionary serializedAdditionalRawData) : base(id, type, filter, serializedAdditionalRawData) { - SelectorType = selectorType; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/CapabilitiesRestOperations.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/CapabilitiesRestOperations.cs index f7c0a5037ca9..2628f54532b8 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/CapabilitiesRestOperations.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/CapabilitiesRestOperations.cs @@ -25,18 +25,18 @@ internal partial class CapabilitiesRestOperations /// Initializes a new instance of CapabilitiesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public CapabilitiesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-01-01"; + _apiVersion = apiVersion ?? "2025-01-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string continuationToken) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -52,16 +52,13 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(parentResourceName, true); uri.AppendPath("/providers/Microsoft.Chaos/targets/", false); uri.AppendPath(targetName, true); - uri.AppendPath("/capabilities", false); + uri.AppendPath("/capabilities/", false); + uri.AppendPath(capabilityName, true); uri.AppendQuery("api-version", _apiVersion, true); - if (continuationToken != null) - { - uri.AppendQuery("continuationToken", continuationToken, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string continuationToken) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -80,30 +77,27 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(parentResourceName, true); uri.AppendPath("/providers/Microsoft.Chaos/targets/", false); uri.AppendPath(targetName, true); - uri.AppendPath("/capabilities", false); + uri.AppendPath("/capabilities/", false); + uri.AppendPath(capabilityName, true); uri.AppendQuery("api-version", _apiVersion, true); - if (continuationToken != null) - { - uri.AppendQuery("continuationToken", continuationToken, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Get a list of Capability resources that extend a Target resource.. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// Get a Capability resource that extends a Target resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. - /// String that sets the continuation token. + /// String that represents a Capability resource name. /// The cancellation token to use. - /// , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string continuationToken = null, CancellationToken cancellationToken = default) + /// , , , , , or is null. + /// , , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -111,35 +105,38 @@ public async Task> ListAsync(string subscriptionI Argument.AssertNotNullOrEmpty(parentResourceType, nameof(parentResourceType)); Argument.AssertNotNullOrEmpty(parentResourceName, nameof(parentResourceName)); Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + Argument.AssertNotNullOrEmpty(capabilityName, nameof(capabilityName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, continuationToken); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, capabilityName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - CapabilityListResult value = default; + ChaosCapabilityData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CapabilityListResult.DeserializeCapabilityListResult(document.RootElement); + value = ChaosCapabilityData.DeserializeChaosCapabilityData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((ChaosCapabilityData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a list of Capability resources that extend a Target resource.. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// Get a Capability resource that extends a Target resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. - /// String that sets the continuation token. + /// String that represents a Capability resource name. /// The cancellation token to use. - /// , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string continuationToken = null, CancellationToken cancellationToken = default) + /// , , , , , or is null. + /// , , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -147,24 +144,27 @@ public Response List(string subscriptionId, string resourc Argument.AssertNotNullOrEmpty(parentResourceType, nameof(parentResourceType)); Argument.AssertNotNullOrEmpty(parentResourceName, nameof(parentResourceName)); Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + Argument.AssertNotNullOrEmpty(capabilityName, nameof(capabilityName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, continuationToken); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, capabilityName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - CapabilityListResult value = default; + ChaosCapabilityData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CapabilityListResult.DeserializeCapabilityListResult(document.RootElement); + value = ChaosCapabilityData.DeserializeChaosCapabilityData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((ChaosCapabilityData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName, ChaosCapabilityData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -186,11 +186,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName, ChaosCapabilityData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -210,22 +210,27 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou 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; } - /// Get a Capability resource that extends a Target resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// Create or update a Capability resource that extends a Target resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. /// String that represents a Capability resource name. + /// Capability resource to be created or updated. /// The cancellation token to use. - /// , , , , , or is null. + /// , , , , , , or is null. /// , , , , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName, CancellationToken cancellationToken = default) + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName, ChaosCapabilityData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -234,37 +239,38 @@ public async Task> GetAsync(string subscriptionId, Argument.AssertNotNullOrEmpty(parentResourceName, nameof(parentResourceName)); Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); Argument.AssertNotNullOrEmpty(capabilityName, nameof(capabilityName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, capabilityName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, capabilityName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: + case 201: { ChaosCapabilityData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); value = ChaosCapabilityData.DeserializeChaosCapabilityData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ChaosCapabilityData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a Capability resource that extends a Target resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// Create or update a Capability resource that extends a Target resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. /// String that represents a Capability resource name. + /// Capability resource to be created or updated. /// The cancellation token to use. - /// , , , , , or is null. + /// , , , , , , or is null. /// , , , , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName, ChaosCapabilityData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -273,20 +279,20 @@ public Response Get(string subscriptionId, string resourceG Argument.AssertNotNullOrEmpty(parentResourceName, nameof(parentResourceName)); Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); Argument.AssertNotNullOrEmpty(capabilityName, nameof(capabilityName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, capabilityName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, capabilityName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: + case 201: { ChaosCapabilityData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); value = ChaosCapabilityData.DeserializeChaosCapabilityData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ChaosCapabilityData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -343,11 +349,11 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a Capability that extends a Target resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. /// String that represents a Capability resource name. /// The cancellation token to use. @@ -376,11 +382,11 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Capability that extends a Target resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. /// String that represents a Capability resource name. /// The cancellation token to use. @@ -408,7 +414,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string p } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName, ChaosCapabilityData data) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string continuationToken) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -424,17 +430,20 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(parentResourceName, true); uri.AppendPath("/providers/Microsoft.Chaos/targets/", false); uri.AppendPath(targetName, true); - uri.AppendPath("/capabilities/", false); - uri.AppendPath(capabilityName, true); + uri.AppendPath("/capabilities", false); uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName, ChaosCapabilityData data) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string continuationToken) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -449,32 +458,30 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(parentResourceName, true); uri.AppendPath("/providers/Microsoft.Chaos/targets/", false); uri.AppendPath(targetName, true); - uri.AppendPath("/capabilities/", false); - uri.AppendPath(capabilityName, true); + uri.AppendPath("/capabilities", false); uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, 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 or update a Capability resource that extends a Target resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// Get a list of Capability resources that extend a Target resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. - /// String that represents a Capability resource name. - /// Capability resource to be created or updated. + /// String that sets the continuation token. /// The cancellation token to use. - /// , , , , , , or is null. - /// , , , , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName, ChaosCapabilityData data, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -482,18 +489,16 @@ public async Task> CreateOrUpdateAsync(string subs Argument.AssertNotNullOrEmpty(parentResourceType, nameof(parentResourceType)); Argument.AssertNotNullOrEmpty(parentResourceName, nameof(parentResourceName)); Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); - Argument.AssertNotNullOrEmpty(capabilityName, nameof(capabilityName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, capabilityName, data); + using var message = CreateListRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, continuationToken); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ChaosCapabilityData value = default; + CapabilityListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ChaosCapabilityData.DeserializeChaosCapabilityData(document.RootElement); + value = CapabilityListResult.DeserializeCapabilityListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -501,19 +506,18 @@ public async Task> CreateOrUpdateAsync(string subs } } - /// Create or update a Capability resource that extends a Target resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// Get a list of Capability resources that extend a Target resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. - /// String that represents a Capability resource name. - /// Capability resource to be created or updated. + /// String that sets the continuation token. /// 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 parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string capabilityName, ChaosCapabilityData data, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -521,18 +525,16 @@ public Response CreateOrUpdate(string subscriptionId, strin Argument.AssertNotNullOrEmpty(parentResourceType, nameof(parentResourceType)); Argument.AssertNotNullOrEmpty(parentResourceName, nameof(parentResourceName)); Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); - Argument.AssertNotNullOrEmpty(capabilityName, nameof(capabilityName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, capabilityName, data); + using var message = CreateListRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, continuationToken); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ChaosCapabilityData value = default; + CapabilityListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ChaosCapabilityData.DeserializeChaosCapabilityData(document.RootElement); + value = CapabilityListResult.DeserializeCapabilityListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -562,13 +564,13 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript return message; } - /// Get a list of Capability resources that extend a Target resource.. + /// Get a list of Capability resources that extend a Target resource. /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. /// String that sets the continuation token. /// The cancellation token to use. @@ -600,13 +602,13 @@ public async Task> ListNextPageAsync(string nextL } } - /// Get a list of Capability resources that extend a Target resource.. + /// Get a list of Capability resources that extend a Target resource. /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. /// String that sets the continuation token. /// The cancellation token to use. diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/CapabilityTypesRestOperations.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/CapabilityTypesRestOperations.cs index f4aa7c7a500d..d4190edd82ee 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/CapabilityTypesRestOperations.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/CapabilityTypesRestOperations.cs @@ -25,37 +25,34 @@ internal partial class CapabilityTypesRestOperations /// Initializes a new instance of CapabilityTypesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public CapabilityTypesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-01-01"; + _apiVersion = apiVersion ?? "2025-01-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string locationName, string targetTypeName, string continuationToken) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string targetTypeName, string capabilityTypeName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.Chaos/locations/", false); - uri.AppendPath(locationName, true); + uri.AppendPath(location, true); uri.AppendPath("/targetTypes/", false); uri.AppendPath(targetTypeName, true); - uri.AppendPath("/capabilityTypes", false); + uri.AppendPath("/capabilityTypes/", false); + uri.AppendPath(capabilityTypeName, true); uri.AppendQuery("api-version", _apiVersion, true); - if (continuationToken != null) - { - uri.AppendQuery("continuationToken", continuationToken, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string locationName, string targetTypeName, string continuationToken) + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string targetTypeName, string capabilityTypeName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -65,98 +62,102 @@ internal HttpMessage CreateListRequest(string subscriptionId, string locationNam uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.Chaos/locations/", false); - uri.AppendPath(locationName, true); + uri.AppendPath(location, true); uri.AppendPath("/targetTypes/", false); uri.AppendPath(targetTypeName, true); - uri.AppendPath("/capabilityTypes", false); + uri.AppendPath("/capabilityTypes/", false); + uri.AppendPath(capabilityTypeName, true); uri.AppendQuery("api-version", _apiVersion, true); - if (continuationToken != null) - { - uri.AppendQuery("continuationToken", continuationToken, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Get a list of Capability Type resources for given Target Type and location. - /// GUID that represents an Azure subscription ID. - /// String that represents a Location resource name. + /// Get a Capability Type resource for given Target Type and location. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. /// String that represents a Target Type resource name. - /// String that sets the continuation token. + /// String that represents a Capability Type resource name. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string locationName, string targetTypeName, string continuationToken = null, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, AzureLocation location, string targetTypeName, string capabilityTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); + Argument.AssertNotNullOrEmpty(capabilityTypeName, nameof(capabilityTypeName)); - using var message = CreateListRequest(subscriptionId, locationName, targetTypeName, continuationToken); + using var message = CreateGetRequest(subscriptionId, location, targetTypeName, capabilityTypeName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - CapabilityTypeListResult value = default; + ChaosCapabilityMetadataData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = CapabilityTypeListResult.DeserializeCapabilityTypeListResult(document.RootElement); + value = ChaosCapabilityMetadataData.DeserializeChaosCapabilityMetadataData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((ChaosCapabilityMetadataData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a list of Capability Type resources for given Target Type and location. - /// GUID that represents an Azure subscription ID. - /// String that represents a Location resource name. + /// Get a Capability Type resource for given Target Type and location. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. /// String that represents a Target Type resource name. - /// String that sets the continuation token. + /// String that represents a Capability Type resource name. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string locationName, string targetTypeName, string continuationToken = null, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, AzureLocation location, string targetTypeName, string capabilityTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); + Argument.AssertNotNullOrEmpty(capabilityTypeName, nameof(capabilityTypeName)); - using var message = CreateListRequest(subscriptionId, locationName, targetTypeName, continuationToken); + using var message = CreateGetRequest(subscriptionId, location, targetTypeName, capabilityTypeName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - CapabilityTypeListResult value = default; + ChaosCapabilityMetadataData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = CapabilityTypeListResult.DeserializeCapabilityTypeListResult(document.RootElement); + value = ChaosCapabilityMetadataData.DeserializeChaosCapabilityMetadataData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((ChaosCapabilityMetadataData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string locationName, string targetTypeName, string capabilityTypeName) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, AzureLocation location, string targetTypeName, string continuationToken) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.Chaos/locations/", false); - uri.AppendPath(locationName, true); + uri.AppendPath(location, true); uri.AppendPath("/targetTypes/", false); uri.AppendPath(targetTypeName, true); - uri.AppendPath("/capabilityTypes/", false); - uri.AppendPath(capabilityTypeName, true); + uri.AppendPath("/capabilityTypes", false); uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string locationName, string targetTypeName, string capabilityTypeName) + internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation location, string targetTypeName, string continuationToken) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -166,85 +167,80 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string locationName uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.Chaos/locations/", false); - uri.AppendPath(locationName, true); + uri.AppendPath(location, true); uri.AppendPath("/targetTypes/", false); uri.AppendPath(targetTypeName, true); - uri.AppendPath("/capabilityTypes/", false); - uri.AppendPath(capabilityTypeName, true); + uri.AppendPath("/capabilityTypes", false); uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Get a Capability Type resource for given Target Type and location. - /// GUID that represents an Azure subscription ID. - /// String that represents a Location resource name. + /// Get a list of Capability Type resources for given Target Type and location. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. /// String that represents a Target Type resource name. - /// String that represents a Capability Type resource name. + /// String that sets the continuation token. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string locationName, string targetTypeName, string capabilityTypeName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, AzureLocation location, string targetTypeName, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - Argument.AssertNotNullOrEmpty(capabilityTypeName, nameof(capabilityTypeName)); - using var message = CreateGetRequest(subscriptionId, locationName, targetTypeName, capabilityTypeName); + using var message = CreateListRequest(subscriptionId, location, targetTypeName, continuationToken); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ChaosCapabilityTypeData value = default; + CapabilityTypeListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ChaosCapabilityTypeData.DeserializeChaosCapabilityTypeData(document.RootElement); + value = CapabilityTypeListResult.DeserializeCapabilityTypeListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ChaosCapabilityTypeData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a Capability Type resource for given Target Type and location. - /// GUID that represents an Azure subscription ID. - /// String that represents a Location resource name. + /// Get a list of Capability Type resources for given Target Type and location. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. /// String that represents a Target Type resource name. - /// String that represents a Capability Type resource name. + /// String that sets the continuation token. /// 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 locationName, string targetTypeName, string capabilityTypeName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, AzureLocation location, string targetTypeName, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - Argument.AssertNotNullOrEmpty(capabilityTypeName, nameof(capabilityTypeName)); - using var message = CreateGetRequest(subscriptionId, locationName, targetTypeName, capabilityTypeName); + using var message = CreateListRequest(subscriptionId, location, targetTypeName, continuationToken); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ChaosCapabilityTypeData value = default; + CapabilityTypeListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ChaosCapabilityTypeData.DeserializeChaosCapabilityTypeData(document.RootElement); + value = CapabilityTypeListResult.DeserializeCapabilityTypeListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ChaosCapabilityTypeData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string locationName, string targetTypeName, string continuationToken) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location, string targetTypeName, string continuationToken) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -252,7 +248,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string locationName, string targetTypeName, string continuationToken) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, AzureLocation location, string targetTypeName, string continuationToken) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -268,21 +264,20 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get a list of Capability Type resources for given Target Type and location. /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// String that represents a Location resource name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. /// String that represents a Target Type resource name. /// String that sets the continuation token. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string locationName, string targetTypeName, string continuationToken = null, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, string targetTypeName, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, locationName, targetTypeName, continuationToken); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, location, targetTypeName, continuationToken); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -300,21 +295,20 @@ public async Task> ListNextPageAsync(string n /// Get a list of Capability Type resources for given Target Type and location. /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// String that represents a Location resource name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. /// String that represents a Target Type resource name. /// String that sets the continuation token. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string locationName, string targetTypeName, string continuationToken = null, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, AzureLocation location, string targetTypeName, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, locationName, targetTypeName, continuationToken); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, location, targetTypeName, continuationToken); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/ExperimentExecutionsRestOperations.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/ExperimentExecutionsRestOperations.cs new file mode 100644 index 000000000000..99655adf987d --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/ExperimentExecutionsRestOperations.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.Chaos.Models; + +namespace Azure.ResourceManager.Chaos +{ + internal partial class ExperimentExecutionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ExperimentExecutionsRestOperations. + /// 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 ExperimentExecutionsRestOperations(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-01-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetExecutionRequestUri(string subscriptionId, string resourceGroupName, string experimentName, string executionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); + uri.AppendPath(experimentName, true); + uri.AppendPath("/executions/", false); + uri.AppendPath(executionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetExecutionRequest(string subscriptionId, string resourceGroupName, string experimentName, string executionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); + uri.AppendPath(experimentName, true); + uri.AppendPath("/executions/", false); + uri.AppendPath(executionId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get an execution of an Experiment resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// String that represents a Experiment resource name. + /// GUID that represents a Experiment execution detail. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetExecutionAsync(string subscriptionId, string resourceGroupName, string experimentName, string executionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); + Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); + + using var message = CreateGetExecutionRequest(subscriptionId, resourceGroupName, experimentName, executionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ChaosExperimentExecutionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ChaosExperimentExecutionData.DeserializeChaosExperimentExecutionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ChaosExperimentExecutionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get an execution of an Experiment resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// String that represents a Experiment resource name. + /// GUID that represents a Experiment execution detail. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetExecution(string subscriptionId, string resourceGroupName, string experimentName, string executionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); + Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); + + using var message = CreateGetExecutionRequest(subscriptionId, resourceGroupName, experimentName, executionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ChaosExperimentExecutionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ChaosExperimentExecutionData.DeserializeChaosExperimentExecutionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ChaosExperimentExecutionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListAllExecutionsRequestUri(string subscriptionId, string resourceGroupName, string experimentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); + uri.AppendPath(experimentName, true); + uri.AppendPath("/executions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListAllExecutionsRequest(string subscriptionId, string resourceGroupName, string experimentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); + uri.AppendPath(experimentName, true); + uri.AppendPath("/executions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a list of executions of an Experiment resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// String that represents a Experiment resource name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAllExecutionsAsync(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); + + using var message = CreateListAllExecutionsRequest(subscriptionId, resourceGroupName, experimentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExperimentExecutionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExperimentExecutionListResult.DeserializeExperimentExecutionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a list of executions of an Experiment resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// String that represents a Experiment resource name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListAllExecutions(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); + + using var message = CreateListAllExecutionsRequest(subscriptionId, resourceGroupName, experimentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExperimentExecutionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExperimentExecutionListResult.DeserializeExperimentExecutionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateExecutionDetailsRequestUri(string subscriptionId, string resourceGroupName, string experimentName, string executionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); + uri.AppendPath(experimentName, true); + uri.AppendPath("/executions/", false); + uri.AppendPath(executionId, true); + uri.AppendPath("/getExecutionDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateExecutionDetailsRequest(string subscriptionId, string resourceGroupName, string experimentName, string executionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); + uri.AppendPath(experimentName, true); + uri.AppendPath("/executions/", false); + uri.AppendPath(executionId, true); + uri.AppendPath("/getExecutionDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Execution details of an experiment resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// String that represents a Experiment resource name. + /// GUID that represents a Experiment execution detail. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ExecutionDetailsAsync(string subscriptionId, string resourceGroupName, string experimentName, string executionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); + Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); + + using var message = CreateExecutionDetailsRequest(subscriptionId, resourceGroupName, experimentName, executionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExperimentExecutionDetails value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExperimentExecutionDetails.DeserializeExperimentExecutionDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Execution details of an experiment resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// String that represents a Experiment resource name. + /// GUID that represents a Experiment execution detail. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ExecutionDetails(string subscriptionId, string resourceGroupName, string experimentName, string executionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); + Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); + + using var message = CreateExecutionDetailsRequest(subscriptionId, resourceGroupName, experimentName, executionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExperimentExecutionDetails value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExperimentExecutionDetails.DeserializeExperimentExecutionDetails(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListAllExecutionsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string experimentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListAllExecutionsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string experimentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a list of executions of an Experiment resource. + /// 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. + /// String that represents a Experiment resource name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAllExecutionsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); + + using var message = CreateListAllExecutionsNextPageRequest(nextLink, subscriptionId, resourceGroupName, experimentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ExperimentExecutionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ExperimentExecutionListResult.DeserializeExperimentExecutionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a list of executions of an Experiment resource. + /// 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. + /// String that represents a Experiment resource name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListAllExecutionsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); + + using var message = CreateListAllExecutionsNextPageRequest(nextLink, subscriptionId, resourceGroupName, experimentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ExperimentExecutionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ExperimentExecutionListResult.DeserializeExperimentExecutionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/ExperimentsRestOperations.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/ExperimentsRestOperations.cs index aa2e560ecd73..5fa0261b318c 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/ExperimentsRestOperations.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/ExperimentsRestOperations.cs @@ -25,303 +25,17 @@ internal partial class ExperimentsRestOperations /// Initializes a new instance of ExperimentsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public ExperimentsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-01-01"; + _apiVersion = apiVersion ?? "2025-01-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListAllRequestUri(string subscriptionId, bool? running, string continuationToken) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Chaos/experiments", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (running != null) - { - uri.AppendQuery("running", running.Value, true); - } - if (continuationToken != null) - { - uri.AppendQuery("continuationToken", continuationToken, true); - } - return uri; - } - - internal HttpMessage CreateListAllRequest(string subscriptionId, bool? running, string continuationToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/providers/Microsoft.Chaos/experiments", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (running != null) - { - uri.AppendQuery("running", running.Value, true); - } - if (continuationToken != null) - { - uri.AppendQuery("continuationToken", continuationToken, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of Experiment resources in a subscription. - /// GUID that represents an Azure subscription ID. - /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. - /// String that sets the continuation token. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAllAsync(string subscriptionId, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListAllRequest(subscriptionId, running, continuationToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ExperimentListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ExperimentListResult.DeserializeExperimentListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of Experiment resources in a subscription. - /// GUID that represents an Azure subscription ID. - /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. - /// String that sets the continuation token. - /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response ListAll(string subscriptionId, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - - using var message = CreateListAllRequest(subscriptionId, running, continuationToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ExperimentListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ExperimentListResult.DeserializeExperimentListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, bool? running, string continuationToken) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Chaos/experiments", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (running != null) - { - uri.AppendQuery("running", running.Value, true); - } - if (continuationToken != null) - { - uri.AppendQuery("continuationToken", continuationToken, true); - } - return uri; - } - - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, bool? running, string continuationToken) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Get; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Chaos/experiments", false); - uri.AppendQuery("api-version", _apiVersion, true); - if (running != null) - { - uri.AppendQuery("running", running.Value, true); - } - if (continuationToken != null) - { - uri.AppendQuery("continuationToken", continuationToken, true); - } - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Get a list of Experiment resources in a resource group. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. - /// String that sets the continuation token. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, running, continuationToken); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 200: - { - ExperimentListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ExperimentListResult.DeserializeExperimentListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - /// Get a list of Experiment resources in a resource group. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. - /// String that sets the continuation token. - /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - - using var message = CreateListRequest(subscriptionId, resourceGroupName, running, continuationToken); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 200: - { - ExperimentListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ExperimentListResult.DeserializeExperimentListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string experimentName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); - uri.AppendPath(experimentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string experimentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Delete; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); - uri.AppendPath(experimentName, true); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Delete a Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a Experiment resource name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, experimentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Delete a Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a Experiment resource 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 experimentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, experimentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string experimentName) { var uri = new RawRequestUriBuilder(); @@ -357,8 +71,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get a Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure 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. /// String that represents a Experiment resource name. /// The cancellation token to use. /// , or is null. @@ -388,8 +102,8 @@ public async Task> GetAsync(string subscriptionId, } /// Get a Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure 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. /// String that represents a Experiment resource name. /// The cancellation token to use. /// , or is null. @@ -457,8 +171,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update a Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure 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. /// String that represents a Experiment resource name. /// Experiment resource to be created or updated. /// The cancellation token to use. @@ -484,8 +198,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or update a Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure 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. /// String that represents a Experiment resource name. /// Experiment resource to be created or updated. /// The cancellation token to use. @@ -549,8 +263,8 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// The operation to update an experiment. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure 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. /// String that represents a Experiment resource name. /// Parameters supplied to the Update experiment operation. /// The cancellation token to use. @@ -567,6 +281,7 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: return message.Response; default: @@ -575,8 +290,8 @@ public async Task UpdateAsync(string subscriptionId, string resourceGr } /// The operation to update an experiment. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure 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. /// String that represents a Experiment resource name. /// Parameters supplied to the Update experiment operation. /// The cancellation token to use. @@ -593,6 +308,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string e _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: return message.Response; default: @@ -600,91 +316,7 @@ public Response Update(string subscriptionId, string resourceGroupName, string e } } - internal RequestUriBuilder CreateCancelRequestUri(string subscriptionId, string resourceGroupName, string experimentName) - { - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); - uri.AppendPath(experimentName, true); - uri.AppendPath("/cancel", false); - uri.AppendQuery("api-version", _apiVersion, true); - return uri; - } - - internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceGroupName, string experimentName) - { - var message = _pipeline.CreateMessage(); - var request = message.Request; - request.Method = RequestMethod.Post; - var uri = new RawRequestUriBuilder(); - uri.Reset(_endpoint); - uri.AppendPath("/subscriptions/", false); - uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); - uri.AppendPath(experimentName, true); - uri.AppendPath("/cancel", false); - uri.AppendQuery("api-version", _apiVersion, true); - request.Uri = uri; - request.Headers.Add("Accept", "application/json"); - _userAgent.Apply(message); - return message; - } - - /// Cancel a running Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a Experiment resource name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task CancelAsync(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, experimentName); - await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - /// Cancel a running Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a Experiment resource name. - /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response Cancel(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) - { - Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - - using var message = CreateCancelRequest(subscriptionId, resourceGroupName, experimentName); - _pipeline.Send(message, cancellationToken); - switch (message.Response.Status) - { - case 202: - return message.Response; - default: - throw new RequestFailedException(message.Response); - } - } - - internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string experimentName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string experimentName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -694,16 +326,15 @@ internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string r uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); uri.AppendPath(experimentName, true); - uri.AppendPath("/start", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string experimentName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string experimentName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -712,7 +343,6 @@ internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGr uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); uri.AppendPath(experimentName, true); - uri.AppendPath("/start", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -720,55 +350,57 @@ internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGr return message; } - /// Start a Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. + /// Delete a Experiment resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// String that represents a Experiment resource name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task StartAsync(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - using var message = CreateStartRequest(subscriptionId, resourceGroupName, experimentName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, experimentName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Start a Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. + /// Delete a Experiment resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// String that represents a Experiment resource name. /// The cancellation token to use. /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Start(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - using var message = CreateStartRequest(subscriptionId, resourceGroupName, experimentName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, experimentName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 202: + case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListAllExecutionsRequestUri(string subscriptionId, string resourceGroupName, string experimentName) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, bool? running, string continuationToken) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -776,14 +408,20 @@ internal RequestUriBuilder CreateListAllExecutionsRequestUri(string subscription uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); - uri.AppendPath(experimentName, true); - uri.AppendPath("/executions", false); + uri.AppendPath("/providers/Microsoft.Chaos/experiments", false); uri.AppendQuery("api-version", _apiVersion, true); + if (running != null) + { + uri.AppendQuery("running", running.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } return uri; } - internal HttpMessage CreateListAllExecutionsRequest(string subscriptionId, string resourceGroupName, string experimentName) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, bool? running, string continuationToken) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -794,38 +432,44 @@ internal HttpMessage CreateListAllExecutionsRequest(string subscriptionId, strin uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); - uri.AppendPath(experimentName, true); - uri.AppendPath("/executions", false); + uri.AppendPath("/providers/Microsoft.Chaos/experiments", false); uri.AppendQuery("api-version", _apiVersion, true); + if (running != null) + { + uri.AppendQuery("running", running.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Get a list of executions of an Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a Experiment resource name. + /// Get a list of Experiment resources in a 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. + /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. + /// String that sets the continuation token. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAllExecutionsAsync(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - using var message = CreateListAllExecutionsRequest(subscriptionId, resourceGroupName, experimentName); + using var message = CreateListRequest(subscriptionId, resourceGroupName, running, continuationToken); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ExperimentExecutionListResult value = default; + ExperimentListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ExperimentExecutionListResult.DeserializeExperimentExecutionListResult(document.RootElement); + value = ExperimentListResult.DeserializeExperimentListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -833,28 +477,28 @@ public async Task> ListAllExecutionsAsyn } } - /// Get a list of executions of an Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a Experiment resource name. + /// Get a list of Experiment resources in a 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. + /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. + /// String that sets the continuation token. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListAllExecutions(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - using var message = CreateListAllExecutionsRequest(subscriptionId, resourceGroupName, experimentName); + using var message = CreateListRequest(subscriptionId, resourceGroupName, running, continuationToken); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ExperimentExecutionListResult value = default; + ExperimentListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ExperimentExecutionListResult.DeserializeExperimentExecutionListResult(document.RootElement); + value = ExperimentListResult.DeserializeExperimentListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -862,23 +506,26 @@ public Response ListAllExecutions(string subscrip } } - internal RequestUriBuilder CreateGetExecutionRequestUri(string subscriptionId, string resourceGroupName, string experimentName, string executionId) + internal RequestUriBuilder CreateListAllRequestUri(string subscriptionId, bool? running, string continuationToken) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); - uri.AppendPath(experimentName, true); - uri.AppendPath("/executions/", false); - uri.AppendPath(executionId, true); + uri.AppendPath("/providers/Microsoft.Chaos/experiments", false); uri.AppendQuery("api-version", _apiVersion, true); + if (running != null) + { + uri.AppendQuery("running", running.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } return uri; } - internal HttpMessage CreateGetExecutionRequest(string subscriptionId, string resourceGroupName, string experimentName, string executionId) + internal HttpMessage CreateListAllRequest(string subscriptionId, bool? running, string continuationToken) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -887,86 +534,77 @@ internal HttpMessage CreateGetExecutionRequest(string subscriptionId, string res uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); - uri.AppendPath("/resourceGroups/", false); - uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); - uri.AppendPath(experimentName, true); - uri.AppendPath("/executions/", false); - uri.AppendPath(executionId, true); + uri.AppendPath("/providers/Microsoft.Chaos/experiments", false); uri.AppendQuery("api-version", _apiVersion, true); + if (running != null) + { + uri.AppendQuery("running", running.Value, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Get an execution of an Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a Experiment resource name. - /// GUID that represents a Experiment execution detail. + /// Get a list of Experiment resources in a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. + /// String that sets the continuation token. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetExecutionAsync(string subscriptionId, string resourceGroupName, string experimentName, string executionId, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListAllAsync(string subscriptionId, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); - using var message = CreateGetExecutionRequest(subscriptionId, resourceGroupName, experimentName, executionId); + using var message = CreateListAllRequest(subscriptionId, running, continuationToken); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ChaosExperimentExecutionData value = default; + ExperimentListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ChaosExperimentExecutionData.DeserializeChaosExperimentExecutionData(document.RootElement); + value = ExperimentListResult.DeserializeExperimentListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ChaosExperimentExecutionData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get an execution of an Experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a Experiment resource name. - /// GUID that represents a Experiment execution detail. + /// Get a list of Experiment resources in a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. + /// String that sets the continuation token. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response GetExecution(string subscriptionId, string resourceGroupName, string experimentName, string executionId, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListAll(string subscriptionId, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); - using var message = CreateGetExecutionRequest(subscriptionId, resourceGroupName, experimentName, executionId); + using var message = CreateListAllRequest(subscriptionId, running, continuationToken); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ChaosExperimentExecutionData value = default; + ExperimentListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ChaosExperimentExecutionData.DeserializeChaosExperimentExecutionData(document.RootElement); + value = ExperimentListResult.DeserializeExperimentListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ChaosExperimentExecutionData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateExecutionDetailsRequestUri(string subscriptionId, string resourceGroupName, string experimentName, string executionId) + internal RequestUriBuilder CreateCancelRequestUri(string subscriptionId, string resourceGroupName, string experimentName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -976,14 +614,12 @@ internal RequestUriBuilder CreateExecutionDetailsRequestUri(string subscriptionI uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); uri.AppendPath(experimentName, true); - uri.AppendPath("/executions/", false); - uri.AppendPath(executionId, true); - uri.AppendPath("/getExecutionDetails", false); + uri.AppendPath("/cancel", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateExecutionDetailsRequest(string subscriptionId, string resourceGroupName, string experimentName, string executionId) + internal HttpMessage CreateCancelRequest(string subscriptionId, string resourceGroupName, string experimentName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -996,9 +632,7 @@ internal HttpMessage CreateExecutionDetailsRequest(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); uri.AppendPath(experimentName, true); - uri.AppendPath("/executions/", false); - uri.AppendPath(executionId, true); - uri.AppendPath("/getExecutionDetails", false); + uri.AppendPath("/cancel", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -1006,143 +640,133 @@ internal HttpMessage CreateExecutionDetailsRequest(string subscriptionId, string return message; } - /// Execution details of an experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. + /// Cancel a running Experiment resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// String that represents a Experiment resource name. - /// GUID that represents a Experiment execution detail. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public async Task> ExecutionDetailsAsync(string subscriptionId, string resourceGroupName, string experimentName, string executionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CancelAsync(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); - using var message = CreateExecutionDetailsRequest(subscriptionId, resourceGroupName, experimentName, executionId); + using var message = CreateCancelRequest(subscriptionId, resourceGroupName, experimentName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - ExperimentExecutionDetails value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ExperimentExecutionDetails.DeserializeExperimentExecutionDetails(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Execution details of an experiment resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. + /// Cancel a running Experiment resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// String that represents a Experiment resource name. - /// GUID that represents a Experiment execution detail. /// The cancellation token to use. - /// , , or is null. - /// , , or is an empty string, and was expected to be non-empty. - public Response ExecutionDetails(string subscriptionId, string resourceGroupName, string experimentName, string executionId, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Cancel(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - Argument.AssertNotNullOrEmpty(executionId, nameof(executionId)); - using var message = CreateExecutionDetailsRequest(subscriptionId, resourceGroupName, experimentName, executionId); + using var message = CreateCancelRequest(subscriptionId, resourceGroupName, experimentName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - ExperimentExecutionDetails value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ExperimentExecutionDetails.DeserializeExperimentExecutionDetails(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListAllNextPageRequestUri(string nextLink, string subscriptionId, bool? running, string continuationToken) + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string experimentName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); + uri.AppendPath(experimentName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListAllNextPageRequest(string nextLink, string subscriptionId, bool? running, string continuationToken) + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string experimentName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); - uri.AppendRawNextLink(nextLink, false); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Chaos/experiments/", false); + uri.AppendPath(experimentName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Get a list of Experiment resources in a subscription. - /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. - /// String that sets the continuation token. + /// Start a Experiment resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// String that represents a Experiment resource name. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAllNextPageAsync(string nextLink, string subscriptionId, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task StartAsync(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - using var message = CreateListAllNextPageRequest(nextLink, subscriptionId, running, continuationToken); + using var message = CreateStartRequest(subscriptionId, resourceGroupName, experimentName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - ExperimentListResult value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ExperimentListResult.DeserializeExperimentListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Get a list of Experiment resources in a subscription. - /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. - /// String that sets the continuation token. + /// Start a Experiment resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// String that represents a Experiment resource name. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListAllNextPage(string nextLink, string subscriptionId, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Start(string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - using var message = CreateListAllNextPageRequest(nextLink, subscriptionId, running, continuationToken); + using var message = CreateStartRequest(subscriptionId, resourceGroupName, experimentName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - ExperimentListResult value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ExperimentListResult.DeserializeExperimentListResult(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -1172,8 +796,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get a list of Experiment resources in a resource group. /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure 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. /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. /// String that sets the continuation token. /// The cancellation token to use. @@ -1203,8 +827,8 @@ public async Task> ListNextPageAsync(string nextL /// Get a list of Experiment resources in a resource group. /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure 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. /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. /// String that sets the continuation token. /// The cancellation token to use. @@ -1232,7 +856,7 @@ public Response ListNextPage(string nextLink, string subsc } } - internal RequestUriBuilder CreateListAllExecutionsNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string experimentName) + internal RequestUriBuilder CreateListAllNextPageRequestUri(string nextLink, string subscriptionId, bool? running, string continuationToken) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -1240,7 +864,7 @@ internal RequestUriBuilder CreateListAllExecutionsNextPageRequestUri(string next return uri; } - internal HttpMessage CreateListAllExecutionsNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string experimentName) + internal HttpMessage CreateListAllNextPageRequest(string nextLink, string subscriptionId, bool? running, string continuationToken) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -1254,30 +878,28 @@ internal HttpMessage CreateListAllExecutionsNextPageRequest(string nextLink, str return message; } - /// Get a list of executions of an Experiment resource. + /// Get a list of Experiment resources in a subscription. /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a Experiment resource name. + /// The ID of the target subscription. The value must be an UUID. + /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. + /// String that sets the continuation token. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAllExecutionsNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListAllNextPageAsync(string nextLink, string subscriptionId, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - using var message = CreateListAllExecutionsNextPageRequest(nextLink, subscriptionId, resourceGroupName, experimentName); + using var message = CreateListAllNextPageRequest(nextLink, subscriptionId, running, continuationToken); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ExperimentExecutionListResult value = default; + ExperimentListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ExperimentExecutionListResult.DeserializeExperimentExecutionListResult(document.RootElement); + value = ExperimentListResult.DeserializeExperimentListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -1285,30 +907,28 @@ public async Task> ListAllExecutionsNext } } - /// Get a list of executions of an Experiment resource. + /// Get a list of Experiment resources in a subscription. /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a Experiment resource name. + /// The ID of the target subscription. The value must be an UUID. + /// Optional value that indicates whether to filter results based on if the Experiment is currently running. If null, then the results will not be filtered. + /// String that sets the continuation token. /// The cancellation token to use. - /// , , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListAllExecutionsNextPage(string nextLink, string subscriptionId, string resourceGroupName, string experimentName, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListAllNextPage(string nextLink, string subscriptionId, bool? running = null, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); - Argument.AssertNotNullOrEmpty(experimentName, nameof(experimentName)); - using var message = CreateListAllExecutionsNextPageRequest(nextLink, subscriptionId, resourceGroupName, experimentName); + using var message = CreateListAllNextPageRequest(nextLink, subscriptionId, running, continuationToken); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ExperimentExecutionListResult value = default; + ExperimentListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ExperimentExecutionListResult.DeserializeExperimentExecutionListResult(document.RootElement); + value = ExperimentListResult.DeserializeExperimentListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/TargetTypesRestOperations.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/TargetTypesRestOperations.cs index 8c318492e2fb..21dc338d3db7 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/TargetTypesRestOperations.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/TargetTypesRestOperations.cs @@ -25,35 +25,32 @@ internal partial class TargetTypesRestOperations /// Initializes a new instance of TargetTypesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public TargetTypesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-01-01"; + _apiVersion = apiVersion ?? "2025-01-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string locationName, string continuationToken) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string targetTypeName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.Chaos/locations/", false); - uri.AppendPath(locationName, true); - uri.AppendPath("/targetTypes", false); + uri.AppendPath(location, true); + uri.AppendPath("/targetTypes/", false); + uri.AppendPath(targetTypeName, true); uri.AppendQuery("api-version", _apiVersion, true); - if (continuationToken != null) - { - uri.AppendQuery("continuationToken", continuationToken, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string locationName, string continuationToken) + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string targetTypeName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -63,90 +60,94 @@ internal HttpMessage CreateListRequest(string subscriptionId, string locationNam uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.Chaos/locations/", false); - uri.AppendPath(locationName, true); - uri.AppendPath("/targetTypes", false); + uri.AppendPath(location, true); + uri.AppendPath("/targetTypes/", false); + uri.AppendPath(targetTypeName, true); uri.AppendQuery("api-version", _apiVersion, true); - if (continuationToken != null) - { - uri.AppendQuery("continuationToken", continuationToken, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Get a list of Target Type resources for given location. - /// GUID that represents an Azure subscription ID. - /// String that represents a Location resource name. - /// String that sets the continuation token. + /// Get a Target Type resources for given location. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// String that represents a Target Type resource name. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string locationName, string continuationToken = null, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, AzureLocation location, string targetTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); + Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - using var message = CreateListRequest(subscriptionId, locationName, continuationToken); + using var message = CreateGetRequest(subscriptionId, location, targetTypeName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - TargetTypeListResult value = default; + ChaosTargetMetadataData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = TargetTypeListResult.DeserializeTargetTypeListResult(document.RootElement); + value = ChaosTargetMetadataData.DeserializeChaosTargetMetadataData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((ChaosTargetMetadataData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a list of Target Type resources for given location. - /// GUID that represents an Azure subscription ID. - /// String that represents a Location resource name. - /// String that sets the continuation token. + /// Get a Target Type resources for given location. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// String that represents a Target Type resource name. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string locationName, string continuationToken = null, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, AzureLocation location, string targetTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); + Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - using var message = CreateListRequest(subscriptionId, locationName, continuationToken); + using var message = CreateGetRequest(subscriptionId, location, targetTypeName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - TargetTypeListResult value = default; + ChaosTargetMetadataData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = TargetTypeListResult.DeserializeTargetTypeListResult(document.RootElement); + value = ChaosTargetMetadataData.DeserializeChaosTargetMetadataData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((ChaosTargetMetadataData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string locationName, string targetTypeName) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, AzureLocation location, string continuationToken) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.Chaos/locations/", false); - uri.AppendPath(locationName, true); - uri.AppendPath("/targetTypes/", false); - uri.AppendPath(targetTypeName, true); + uri.AppendPath(location, true); + uri.AppendPath("/targetTypes", false); uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string locationName, string targetTypeName) + internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation location, string continuationToken) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -156,79 +157,74 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string locationName uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.Chaos/locations/", false); - uri.AppendPath(locationName, true); - uri.AppendPath("/targetTypes/", false); - uri.AppendPath(targetTypeName, true); + uri.AppendPath(location, true); + uri.AppendPath("/targetTypes", false); uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Get a Target Type resources for given location. - /// GUID that represents an Azure subscription ID. - /// String that represents a Location resource name. - /// String that represents a Target Type resource name. + /// Get a list of Target Type resources for given location. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// String that sets the continuation token. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string locationName, string targetTypeName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, AzureLocation location, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - using var message = CreateGetRequest(subscriptionId, locationName, targetTypeName); + using var message = CreateListRequest(subscriptionId, location, continuationToken); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ChaosTargetTypeData value = default; + TargetTypeListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ChaosTargetTypeData.DeserializeChaosTargetTypeData(document.RootElement); + value = TargetTypeListResult.DeserializeTargetTypeListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ChaosTargetTypeData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a Target Type resources for given location. - /// GUID that represents an Azure subscription ID. - /// String that represents a Location resource name. - /// String that represents a Target Type resource name. + /// Get a list of Target Type resources for given location. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// String that sets the continuation token. /// 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 locationName, string targetTypeName, CancellationToken cancellationToken = default) + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, AzureLocation location, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - Argument.AssertNotNullOrEmpty(targetTypeName, nameof(targetTypeName)); - using var message = CreateGetRequest(subscriptionId, locationName, targetTypeName); + using var message = CreateListRequest(subscriptionId, location, continuationToken); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ChaosTargetTypeData value = default; + TargetTypeListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ChaosTargetTypeData.DeserializeChaosTargetTypeData(document.RootElement); + value = TargetTypeListResult.DeserializeTargetTypeListResult(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ChaosTargetTypeData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string locationName, string continuationToken) + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location, string continuationToken) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -236,7 +232,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string locationName, string continuationToken) + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, AzureLocation location, string continuationToken) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -252,19 +248,18 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get a list of Target Type resources for given location. /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// String that represents a Location resource name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. /// String that sets the continuation token. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string locationName, string continuationToken = null, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, locationName, continuationToken); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, location, continuationToken); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -282,19 +277,18 @@ public async Task> ListNextPageAsync(string nextL /// Get a list of Target Type resources for given location. /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// String that represents a Location resource name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. /// String that sets the continuation token. /// The cancellation token to use. - /// , or is null. - /// or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string locationName, string continuationToken = null, CancellationToken cancellationToken = default) + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, AzureLocation location, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(locationName, nameof(locationName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, locationName, continuationToken); + using var message = CreateListNextPageRequest(nextLink, subscriptionId, location, continuationToken); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/TargetsRestOperations.cs b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/TargetsRestOperations.cs index daa4fcae5f2e..11a873425e55 100644 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/TargetsRestOperations.cs +++ b/sdk/chaos/Azure.ResourceManager.Chaos/src/Generated/RestOperations/TargetsRestOperations.cs @@ -25,18 +25,18 @@ internal partial class TargetsRestOperations /// Initializes a new instance of TargetsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public TargetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-01-01"; + _apiVersion = apiVersion ?? "2025-01-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string continuationToken) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -50,16 +50,13 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(parentResourceType, true); uri.AppendPath("/", false); uri.AppendPath(parentResourceName, true); - uri.AppendPath("/providers/Microsoft.Chaos/targets", false); + uri.AppendPath("/providers/Microsoft.Chaos/targets/", false); + uri.AppendPath(targetName, true); uri.AppendQuery("api-version", _apiVersion, true); - if (continuationToken != null) - { - uri.AppendQuery("continuationToken", continuationToken, true); - } return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string continuationToken) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -76,87 +73,90 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(parentResourceType, true); uri.AppendPath("/", false); uri.AppendPath(parentResourceName, true); - uri.AppendPath("/providers/Microsoft.Chaos/targets", false); + uri.AppendPath("/providers/Microsoft.Chaos/targets/", false); + uri.AppendPath(targetName, true); uri.AppendQuery("api-version", _apiVersion, true); - if (continuationToken != null) - { - uri.AppendQuery("continuationToken", continuationToken, true); - } request.Uri = uri; request.Headers.Add("Accept", "application/json"); _userAgent.Apply(message); return message; } - /// Get a list of Target resources that extend a tracked regional resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. - /// String that sets the continuation token. + /// Get a Target resource that extends a tracked regional resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. + /// String that represents a Target resource name. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string continuationToken = null, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(parentProviderNamespace, nameof(parentProviderNamespace)); Argument.AssertNotNullOrEmpty(parentResourceType, nameof(parentResourceType)); Argument.AssertNotNullOrEmpty(parentResourceName, nameof(parentResourceName)); + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, continuationToken); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - TargetListResult value = default; + ChaosTargetData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = TargetListResult.DeserializeTargetListResult(document.RootElement); + value = ChaosTargetData.DeserializeChaosTargetData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((ChaosTargetData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a list of Target resources that extend a tracked regional resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. - /// String that sets the continuation token. + /// Get a Target resource that extends a tracked regional resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. + /// String that represents a Target resource name. /// The cancellation token to use. - /// , , , or is null. - /// , , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string continuationToken = null, CancellationToken cancellationToken = default) + /// , , , , or is null. + /// , , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(parentProviderNamespace, nameof(parentProviderNamespace)); Argument.AssertNotNullOrEmpty(parentResourceType, nameof(parentResourceType)); Argument.AssertNotNullOrEmpty(parentResourceName, nameof(parentResourceName)); + Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, continuationToken); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - TargetListResult value = default; + ChaosTargetData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = TargetListResult.DeserializeTargetListResult(document.RootElement); + value = ChaosTargetData.DeserializeChaosTargetData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((ChaosTargetData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, ChaosTargetData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -176,11 +176,11 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, ChaosTargetData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -198,21 +198,26 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou 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; } - /// Get a Target resource that extends a tracked regional resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// Create or update a Target resource that extends a tracked regional resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. + /// Target resource to be created or updated. /// The cancellation token to use. - /// , , , , or is null. + /// , , , , , or is null. /// , , , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) + public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, ChaosTargetData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -220,36 +225,37 @@ public async Task> GetAsync(string subscriptionId, str Argument.AssertNotNullOrEmpty(parentResourceType, nameof(parentResourceType)); Argument.AssertNotNullOrEmpty(parentResourceName, nameof(parentResourceName)); Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: + case 201: { ChaosTargetData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); value = ChaosTargetData.DeserializeChaosTargetData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ChaosTargetData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a Target resource that extends a tracked regional resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// Create or update a Target resource that extends a tracked regional resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. + /// Target resource to be created or updated. /// The cancellation token to use. - /// , , , , or is null. + /// , , , , , or is null. /// , , , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, ChaosTargetData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -257,20 +263,20 @@ public Response Get(string subscriptionId, string resourceGroup Argument.AssertNotNullOrEmpty(parentResourceType, nameof(parentResourceType)); Argument.AssertNotNullOrEmpty(parentResourceName, nameof(parentResourceName)); Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: + case 201: { ChaosTargetData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); value = ChaosTargetData.DeserializeChaosTargetData(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ChaosTargetData)null, message.Response); default: throw new RequestFailedException(message.Response); } @@ -323,11 +329,11 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a Target resource that extends a tracked regional resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. /// The cancellation token to use. /// , , , , or is null. @@ -354,11 +360,11 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Target resource that extends a tracked regional resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that represents a Target resource name. /// The cancellation token to use. /// , , , , or is null. @@ -384,7 +390,7 @@ public Response Delete(string subscriptionId, string resourceGroupName, string p } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, ChaosTargetData data) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string continuationToken) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -398,17 +404,20 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(parentResourceType, true); uri.AppendPath("/", false); uri.AppendPath(parentResourceName, true); - uri.AppendPath("/providers/Microsoft.Chaos/targets/", false); - uri.AppendPath(targetName, true); + uri.AppendPath("/providers/Microsoft.Chaos/targets", false); uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, ChaosTargetData data) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string continuationToken) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -421,49 +430,45 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(parentResourceType, true); uri.AppendPath("/", false); uri.AppendPath(parentResourceName, true); - uri.AppendPath("/providers/Microsoft.Chaos/targets/", false); - uri.AppendPath(targetName, true); + uri.AppendPath("/providers/Microsoft.Chaos/targets", false); uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, 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 or update a Target resource that extends a tracked regional resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. - /// String that represents a Target resource name. - /// Target resource to be created or updated. + /// Get a list of Target resources that extend a tracked regional resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. + /// String that sets the continuation token. /// The cancellation token to use. - /// , , , , , or is null. - /// , , , , or is an empty string, and was expected to be non-empty. - public async Task> CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, ChaosTargetData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(parentProviderNamespace, nameof(parentProviderNamespace)); Argument.AssertNotNullOrEmpty(parentResourceType, nameof(parentResourceType)); Argument.AssertNotNullOrEmpty(parentResourceName, nameof(parentResourceName)); - Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, data); + using var message = CreateListRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, continuationToken); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ChaosTargetData value = default; + TargetListResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ChaosTargetData.DeserializeChaosTargetData(document.RootElement); + value = TargetListResult.DeserializeTargetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -471,36 +476,33 @@ public async Task> CreateOrUpdateAsync(string subscrip } } - /// Create or update a Target resource that extends a tracked regional resource. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. - /// String that represents a Target resource name. - /// Target resource to be created or updated. + /// Get a list of Target resources that extend a tracked regional resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. + /// String that sets the continuation token. /// 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 parentProviderNamespace, string parentResourceType, string parentResourceName, string targetName, ChaosTargetData data, CancellationToken cancellationToken = default) + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string parentProviderNamespace, string parentResourceType, string parentResourceName, string continuationToken = null, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(parentProviderNamespace, nameof(parentProviderNamespace)); Argument.AssertNotNullOrEmpty(parentResourceType, nameof(parentResourceType)); Argument.AssertNotNullOrEmpty(parentResourceName, nameof(parentResourceName)); - Argument.AssertNotNullOrEmpty(targetName, nameof(targetName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, data); + using var message = CreateListRequest(subscriptionId, resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, continuationToken); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ChaosTargetData value = default; + TargetListResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ChaosTargetData.DeserializeChaosTargetData(document.RootElement); + value = TargetListResult.DeserializeTargetListResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -532,11 +534,11 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get a list of Target resources that extend a tracked regional resource. /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that sets the continuation token. /// The cancellation token to use. /// , , , , or is null. @@ -568,11 +570,11 @@ public async Task> ListNextPageAsync(string nextLink, /// Get a list of Target resources that extend a tracked regional resource. /// The URL to the next page of results. - /// GUID that represents an Azure subscription ID. - /// String that represents an Azure resource group. - /// String that represents a resource provider namespace. - /// String that represents a resource type. - /// String that represents a resource name. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The parent resource provider namespace. + /// The parent resource type. + /// The parent resource name. /// String that sets the continuation token. /// The cancellation token to use. /// , , , , or is null. diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/src/autorest.md b/sdk/chaos/Azure.ResourceManager.Chaos/src/autorest.md deleted file mode 100644 index 433ca7df8c96..000000000000 --- a/sdk/chaos/Azure.ResourceManager.Chaos/src/autorest.md +++ /dev/null @@ -1,81 +0,0 @@ -# Generated code configuration - -Run `dotnet build /t:GenerateCode` to generate code. - -```yaml -azure-arm: true -csharp: true -library-name: Chaos -namespace: Azure.ResourceManager.Chaos -#tag: package-2024-01 -require: https://github.com/Azure/azure-rest-api-specs/blob/f3cd6922dbe117d78b4f719bbf8b03db46b30808/specification/chaos/resource-manager/readme.md -output-folder: $(this-folder)/Generated -clear-output-folder: true -sample-gen: - output-folder: $(this-folder)/../samples/Generated - clear-output-folder: true -skip-csproj: true -modelerfour: - flatten-payloads: false -use-model-reader-writer: true - -#mgmt-debug: -# show-serialized-names: true - -rename-mapping: - ActionStatus: ChaosExperimentRunActionStatus - BranchStatus: ChaosExperimentRunBranchStatus - StepStatus: ChaosExperimentRunStepStatus - TargetReference.id: -|arm-id - CapabilityTypePropertiesRuntimeProperties: ChaosCapabilityTypeRuntimeProperties - ExperimentExecutionDetailsPropertiesRunInformation: ChaosExperimentRunInformation - -prepend-rp-prefix: - - Capability - - CapabilityType - - Experiment - - ExperimentExecution - - Target - - TargetType - - ProvisioningState - - ContinuousAction - - DelayAction - - DiscreteAction - - KeyValuePair - - TargetReference - - TargetReferenceType - -format-by-name-rules: - 'tenantId': 'uuid' - 'ETag': 'etag' - 'location': 'azure-location' - '*Uri': 'Uri' - '*Uris': 'Uri' - -acronym-mapping: - CPU: Cpu - CPUs: Cpus - Os: OS - Ip: IP - Ips: IPs|ips - ID: Id - IDs: Ids - VM: Vm - VMs: Vms - Vmos: VmOS - VMScaleSet: VmScaleSet - DNS: Dns - VPN: Vpn - NAT: Nat - WAN: Wan - Ipv4: IPv4|ipv4 - Ipv6: IPv6|ipv6 - Ipsec: IPsec|ipsec - SSO: Sso - URI: Uri - Etag: ETag|etag - -directive: - - remove-operation: 'OperationStatuses_Get' - -``` diff --git a/sdk/chaos/Azure.ResourceManager.Chaos/tsp-location.yaml b/sdk/chaos/Azure.ResourceManager.Chaos/tsp-location.yaml new file mode 100644 index 000000000000..6a910d28911f --- /dev/null +++ b/sdk/chaos/Azure.ResourceManager.Chaos/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/chaos/Chaos.Management +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml index 4b6a31091856..7f597e5a82c0 100644 --- a/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml +++ b/sdk/computefleet/Azure.ResourceManager.ComputeFleet/tsp-location.yaml @@ -1,4 +1,4 @@ directory: specification/azurefleet/AzureFleet.Management -commit: 462574dbd02088c209bb1da3eef0d93f699e8de2 +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b repo: Azure/azure-rest-api-specs - +additionalDirectories: diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index fbc0fcac38ca..bd2d120c9493 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -19,9 +19,9 @@ public partial class Sample_SubscriptionResourceExtensions { [Test] [Ignore("Only validating compilation of examples")] - public async Task SubmitVirtualMachineDeallocate_ScheduledActionsVirtualMachinesSubmitDeallocate() + public async Task SubmitVirtualMachineDeallocate_ScheduledActionsVirtualMachinesSubmitDeallocateMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-10-01/ScheduledActions_VirtualMachinesSubmitDeallocate.json + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesSubmitDeallocate_MaximumSet_Gen.json // this example is just showing the usage of "ScheduledActions_SubmitVirtualMachineDeallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -31,24 +31,27 @@ public async Task SubmitVirtualMachineDeallocate_ScheduledActionsVirtualMachines // 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 = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; + string subscriptionId = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - string locationparameter = "eastus2euap"; - SubmitDeallocateContent content = new SubmitDeallocateContent(new UserRequestSchedule(ScheduledActionDeadlineType.InitiateAt) + string locationparameter = "mqlftjjfnzubxpricsgstgjojaoah"; + SubmitDeallocateContent content = new SubmitDeallocateContent(new UserRequestSchedule(ScheduledActionDeadlineType.Unknown) { - Deadline = DateTimeOffset.Parse("2024-11-01T17:52:54.215Z"), - Timezone = "UTC", + Deadline = DateTimeOffset.Parse("2025-04-15T19:47:04.403Z"), + UserRequestDeadline = DateTimeOffset.Parse("2025-04-15T19:47:04.403Z"), + Timezone = "qacufsmctpgjozovlsihrzoctatcsj", + UserRequestTimezone = "upnmayfebiadztdktxzq", }, new ScheduledActionExecutionParameterDetail { + OptimizationPreference = ScheduledActionOptimizationPreference.Cost, RetryPolicy = new UserRequestRetryPolicy { - RetryCount = 4, - RetryWindowInMinutes = 27, + RetryCount = 25, + RetryWindowInMinutes = 4, }, - }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "23480d2f-1dca-4610-afb4-dd25eec1f34r"); + }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "evmwonebfzxenjdpucgcwdjdya"); DeallocateResourceOperationResult result = await subscriptionResource.SubmitVirtualMachineDeallocateAsync(locationparameter, content); Console.WriteLine($"Succeeded: {result}"); @@ -56,9 +59,35 @@ public async Task SubmitVirtualMachineDeallocate_ScheduledActionsVirtualMachines [Test] [Ignore("Only validating compilation of examples")] - public async Task SubmitVirtualMachineHibernate_ScheduledActionsVirtualMachinesSubmitHibernate() + public async Task SubmitVirtualMachineDeallocate_ScheduledActionsVirtualMachinesSubmitDeallocateMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - // Generated from example definition: 2024-10-01/ScheduledActions_VirtualMachinesSubmitHibernate.json + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesSubmitDeallocate_MinimumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_SubmitVirtualMachineDeallocate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "xrcabowpojl"; + SubmitDeallocateContent content = new SubmitDeallocateContent(new UserRequestSchedule(ScheduledActionDeadlineType.Unknown), new ScheduledActionExecutionParameterDetail(), new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "evmwonebfzxenjdpucgcwdjdya"); + DeallocateResourceOperationResult result = await subscriptionResource.SubmitVirtualMachineDeallocateAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task SubmitVirtualMachineHibernate_ScheduledActionsVirtualMachinesSubmitHibernateMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesSubmitHibernate_MaximumSet_Gen.json // this example is just showing the usage of "ScheduledActions_SubmitVirtualMachineHibernate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -68,24 +97,53 @@ public async Task SubmitVirtualMachineHibernate_ScheduledActionsVirtualMachinesS // 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 = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; + string subscriptionId = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - string locationparameter = "eastus2euap"; - SubmitHibernateContent content = new SubmitHibernateContent(new UserRequestSchedule(ScheduledActionDeadlineType.InitiateAt) + string locationparameter = "hiceqzwkjmijxdfw"; + SubmitHibernateContent content = new SubmitHibernateContent(new UserRequestSchedule(ScheduledActionDeadlineType.Unknown) { - Deadline = DateTimeOffset.Parse("2024-11-01T17:52:54.215Z"), - Timezone = "UTC", + Deadline = DateTimeOffset.Parse("2025-04-15T19:47:04.403Z"), + UserRequestDeadline = DateTimeOffset.Parse("2025-04-15T19:47:04.403Z"), + Timezone = "qacufsmctpgjozovlsihrzoctatcsj", + UserRequestTimezone = "upnmayfebiadztdktxzq", }, new ScheduledActionExecutionParameterDetail { + OptimizationPreference = ScheduledActionOptimizationPreference.Cost, RetryPolicy = new UserRequestRetryPolicy { - RetryCount = 2, - RetryWindowInMinutes = 27, + RetryCount = 25, + RetryWindowInMinutes = 4, }, - }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "23480d2f-1dca-4610-afb4-dd25eec1f34r"); + }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "htqivutynuoslvbp"); + HibernateResourceOperationResult result = await subscriptionResource.SubmitVirtualMachineHibernateAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task SubmitVirtualMachineHibernate_ScheduledActionsVirtualMachinesSubmitHibernateMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesSubmitHibernate_MinimumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_SubmitVirtualMachineHibernate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "jsbmestfaqxxejcgrs"; + SubmitHibernateContent content = new SubmitHibernateContent(new UserRequestSchedule(ScheduledActionDeadlineType.Unknown), new ScheduledActionExecutionParameterDetail(), new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "htqivutynuoslvbp"); HibernateResourceOperationResult result = await subscriptionResource.SubmitVirtualMachineHibernateAsync(locationparameter, content); Console.WriteLine($"Succeeded: {result}"); @@ -93,9 +151,9 @@ public async Task SubmitVirtualMachineHibernate_ScheduledActionsVirtualMachinesS [Test] [Ignore("Only validating compilation of examples")] - public async Task SubmitVirtualMachineStart_ScheduledActionsVirtualMachinesSubmitStart() + public async Task SubmitVirtualMachineStart_ScheduledActionsVirtualMachinesSubmitStartMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-10-01/ScheduledActions_VirtualMachinesSubmitStart.json + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesSubmitStart_MaximumSet_Gen.json // this example is just showing the usage of "ScheduledActions_SubmitVirtualMachineStart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -105,24 +163,53 @@ public async Task SubmitVirtualMachineStart_ScheduledActionsVirtualMachinesSubmi // 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 = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; + string subscriptionId = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - string locationparameter = "eastus2euap"; - SubmitStartContent content = new SubmitStartContent(new UserRequestSchedule(ScheduledActionDeadlineType.InitiateAt) + string locationparameter = "klvdoznxekrxhuvgeels"; + SubmitStartContent content = new SubmitStartContent(new UserRequestSchedule(ScheduledActionDeadlineType.Unknown) { - Deadline = DateTimeOffset.Parse("2024-11-01T17:52:54.215Z"), - Timezone = "UTC", + Deadline = DateTimeOffset.Parse("2025-04-15T19:47:04.403Z"), + UserRequestDeadline = DateTimeOffset.Parse("2025-04-15T19:47:04.403Z"), + Timezone = "qacufsmctpgjozovlsihrzoctatcsj", + UserRequestTimezone = "upnmayfebiadztdktxzq", }, new ScheduledActionExecutionParameterDetail { + OptimizationPreference = ScheduledActionOptimizationPreference.Cost, RetryPolicy = new UserRequestRetryPolicy { - RetryCount = 5, - RetryWindowInMinutes = 27, + RetryCount = 25, + RetryWindowInMinutes = 4, }, - }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "23480d2f-1dca-4610-afb4-dd25eec1f34r"); + }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "bvmpxvbd"); + StartResourceOperationResult result = await subscriptionResource.SubmitVirtualMachineStartAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task SubmitVirtualMachineStart_ScheduledActionsVirtualMachinesSubmitStartMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesSubmitStart_MinimumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_SubmitVirtualMachineStart" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "rbsdwsfprygqqwqhwapovusm"; + SubmitStartContent content = new SubmitStartContent(new UserRequestSchedule(ScheduledActionDeadlineType.Unknown), new ScheduledActionExecutionParameterDetail(), new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "bvmpxvbd"); StartResourceOperationResult result = await subscriptionResource.SubmitVirtualMachineStartAsync(locationparameter, content); Console.WriteLine($"Succeeded: {result}"); @@ -130,9 +217,9 @@ public async Task SubmitVirtualMachineStart_ScheduledActionsVirtualMachinesSubmi [Test] [Ignore("Only validating compilation of examples")] - public async Task ExecuteVirtualMachineDeallocate_ScheduledActionsVirtualMachinesExecuteDeallocate() + public async Task ExecuteVirtualMachineDeallocate_ScheduledActionsVirtualMachinesExecuteDeallocateMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-10-01/ScheduledActions_VirtualMachinesExecuteDeallocate.json + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesExecuteDeallocate_MaximumSet_Gen.json // this example is just showing the usage of "ScheduledActions_ExecuteVirtualMachineDeallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -142,20 +229,47 @@ public async Task ExecuteVirtualMachineDeallocate_ScheduledActionsVirtualMachine // 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 = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; + string subscriptionId = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - string locationparameter = "eastus2euap"; + string locationparameter = "ykpowbmjexmsv"; ExecuteDeallocateContent content = new ExecuteDeallocateContent(new ScheduledActionExecutionParameterDetail { + OptimizationPreference = ScheduledActionOptimizationPreference.Cost, RetryPolicy = new UserRequestRetryPolicy { - RetryCount = 4, - RetryWindowInMinutes = 27, + RetryCount = 25, + RetryWindowInMinutes = 4, }, - }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "23480d2f-1dca-4610-afb4-dd25eec1f34r"); + }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "dsszhmrdsczkv"); + DeallocateResourceOperationResult result = await subscriptionResource.ExecuteVirtualMachineDeallocateAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task ExecuteVirtualMachineDeallocate_ScheduledActionsVirtualMachinesExecuteDeallocateMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesExecuteDeallocate_MinimumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_ExecuteVirtualMachineDeallocate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "bfldnxffvllwvqa"; + ExecuteDeallocateContent content = new ExecuteDeallocateContent(new ScheduledActionExecutionParameterDetail(), new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "dsszhmrdsczkv"); DeallocateResourceOperationResult result = await subscriptionResource.ExecuteVirtualMachineDeallocateAsync(locationparameter, content); Console.WriteLine($"Succeeded: {result}"); @@ -163,9 +277,9 @@ public async Task ExecuteVirtualMachineDeallocate_ScheduledActionsVirtualMachine [Test] [Ignore("Only validating compilation of examples")] - public async Task ExecuteVirtualMachineHibernate_ScheduledActionsVirtualMachinesExecuteHibernate() + public async Task ExecuteVirtualMachineHibernate_ScheduledActionsVirtualMachinesExecuteHibernateMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-10-01/ScheduledActions_VirtualMachinesExecuteHibernate.json + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesExecuteHibernate_MaximumSet_Gen.json // this example is just showing the usage of "ScheduledActions_ExecuteVirtualMachineHibernate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -175,20 +289,21 @@ public async Task ExecuteVirtualMachineHibernate_ScheduledActionsVirtualMachines // 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 = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; + string subscriptionId = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - string locationparameter = "eastus2euap"; + string locationparameter = "aojgnzdqrphhygchir"; ExecuteHibernateContent content = new ExecuteHibernateContent(new ScheduledActionExecutionParameterDetail { + OptimizationPreference = ScheduledActionOptimizationPreference.Cost, RetryPolicy = new UserRequestRetryPolicy { - RetryCount = 5, - RetryWindowInMinutes = 27, + RetryCount = 25, + RetryWindowInMinutes = 4, }, - }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "23480d2f-1dca-4610-afb4-dd25eec1f34r"); + }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "jmdiz"); HibernateResourceOperationResult result = await subscriptionResource.ExecuteVirtualMachineHibernateAsync(locationparameter, content); Console.WriteLine($"Succeeded: {result}"); @@ -196,9 +311,35 @@ public async Task ExecuteVirtualMachineHibernate_ScheduledActionsVirtualMachines [Test] [Ignore("Only validating compilation of examples")] - public async Task ExecuteVirtualMachineStart_ScheduledActionsVirtualMachinesExecuteStart() + public async Task ExecuteVirtualMachineHibernate_ScheduledActionsVirtualMachinesExecuteHibernateMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - // Generated from example definition: 2024-10-01/ScheduledActions_VirtualMachinesExecuteStart.json + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesExecuteHibernate_MinimumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_ExecuteVirtualMachineHibernate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "gmflbqliyjrhmrjvqrxrgocbxzjr"; + ExecuteHibernateContent content = new ExecuteHibernateContent(new ScheduledActionExecutionParameterDetail(), new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "jmdiz"); + HibernateResourceOperationResult result = await subscriptionResource.ExecuteVirtualMachineHibernateAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task ExecuteVirtualMachineStart_ScheduledActionsVirtualMachinesExecuteStartMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesExecuteStart_MaximumSet_Gen.json // this example is just showing the usage of "ScheduledActions_ExecuteVirtualMachineStart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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,20 +349,47 @@ public async Task ExecuteVirtualMachineStart_ScheduledActionsVirtualMachinesExec // 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 = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; + string subscriptionId = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - string locationparameter = "eastus2euap"; + string locationparameter = "jwybvpf"; ExecuteStartContent content = new ExecuteStartContent(new ScheduledActionExecutionParameterDetail { + OptimizationPreference = ScheduledActionOptimizationPreference.Cost, RetryPolicy = new UserRequestRetryPolicy { - RetryCount = 2, - RetryWindowInMinutes = 27, + RetryCount = 25, + RetryWindowInMinutes = 4, }, - }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "23480d2f-1dca-4610-afb4-dd25eec1f34r"); + }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "vwpcrwowcfgjuwnxzvvdma"); + StartResourceOperationResult result = await subscriptionResource.ExecuteVirtualMachineStartAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task ExecuteVirtualMachineStart_ScheduledActionsVirtualMachinesExecuteStartMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesExecuteStart_MinimumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_ExecuteVirtualMachineStart" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "ksfzuak"; + ExecuteStartContent content = new ExecuteStartContent(new ScheduledActionExecutionParameterDetail(), new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") }), "vwpcrwowcfgjuwnxzvvdma"); StartResourceOperationResult result = await subscriptionResource.ExecuteVirtualMachineStartAsync(locationparameter, content); Console.WriteLine($"Succeeded: {result}"); @@ -229,9 +397,286 @@ public async Task ExecuteVirtualMachineStart_ScheduledActionsVirtualMachinesExec [Test] [Ignore("Only validating compilation of examples")] - public async Task GetVirtualMachineOperationStatus_ScheduledActionsVirtualMachinesGetOperationStatus() + public async Task VirtualMachinesExecuteCreateScheduledAction_ScheduledActionsVirtualMachinesExecuteCreateMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() { - // Generated from example definition: 2024-10-01/ScheduledActions_VirtualMachinesGetOperationStatus.json + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesExecuteCreate_MaximumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_VirtualMachinesExecuteCreate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "nxbiupqfkijjq"; + ExecuteCreateContent content = new ExecuteCreateContent(new ResourceProvisionPayload(28) + { + BaseProfile = "tfgrulcuneopmbdjydzofmhpa", + ResourceOverrides = { "hsqtjgsobjaffl" }, + ResourcePrefix = "rqlxavviucrxfjj", + }, new ScheduledActionExecutionParameterDetail + { + OptimizationPreference = ScheduledActionOptimizationPreference.Cost, + RetryPolicy = new UserRequestRetryPolicy + { + RetryCount = 25, + RetryWindowInMinutes = 4, + }, + }) + { + Correlationid = "erpswvxajdpqgxfpgmzy", + }; + CreateResourceOperationResponse result = await subscriptionResource.VirtualMachinesExecuteCreateScheduledActionAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task VirtualMachinesExecuteCreateScheduledAction_ScheduledActionsVirtualMachinesExecuteCreateMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesExecuteCreate_MinimumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_VirtualMachinesExecuteCreate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "aiqyytlqsikciuxzocihxb"; + ExecuteCreateContent content = new ExecuteCreateContent(new ResourceProvisionPayload(28), new ScheduledActionExecutionParameterDetail()); + CreateResourceOperationResponse result = await subscriptionResource.VirtualMachinesExecuteCreateScheduledActionAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task VirtualMachinesExecuteDeleteScheduledAction_ScheduledActionsVirtualMachinesExecuteDeleteMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesExecuteDelete_MaximumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_VirtualMachinesExecuteDelete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "yrngwxkxxxbifqyc"; + ExecuteDeleteContent content = new ExecuteDeleteContent(new ScheduledActionExecutionParameterDetail + { + OptimizationPreference = ScheduledActionOptimizationPreference.Cost, + RetryPolicy = new UserRequestRetryPolicy + { + RetryCount = 25, + RetryWindowInMinutes = 4, + }, + }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") })) + { + Correlationid = "lgxsiioaybtjexssjzw", + ForceDeletion = true, + }; + DeleteResourceOperationResponse result = await subscriptionResource.VirtualMachinesExecuteDeleteScheduledActionAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task VirtualMachinesExecuteDeleteScheduledAction_ScheduledActionsVirtualMachinesExecuteDeleteMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesExecuteDelete_MinimumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_VirtualMachinesExecuteDelete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "urzqnogieubgnjsyadipeyqegdomtm"; + ExecuteDeleteContent content = new ExecuteDeleteContent(new ScheduledActionExecutionParameterDetail(), new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") })); + DeleteResourceOperationResponse result = await subscriptionResource.VirtualMachinesExecuteDeleteScheduledActionAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task VirtualMachinesSubmitCreateScheduledAction_ScheduledActionsVirtualMachinesSubmitCreateGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesSubmitCreate_MaximumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_VirtualMachinesSubmitCreate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "msbmrhcjsqsydsq"; + SubmitCreateContent content = new SubmitCreateContent(new UserRequestSchedule(ScheduledActionDeadlineType.Unknown) + { + Deadline = DateTimeOffset.Parse("2025-04-15T19:47:04.403Z"), + UserRequestDeadline = DateTimeOffset.Parse("2025-04-15T19:47:04.403Z"), + Timezone = "qacufsmctpgjozovlsihrzoctatcsj", + UserRequestTimezone = "upnmayfebiadztdktxzq", + }, new ResourceProvisionPayload(28) + { + BaseProfile = "tfgrulcuneopmbdjydzofmhpa", + ResourceOverrides = { "hsqtjgsobjaffl" }, + ResourcePrefix = "rqlxavviucrxfjj", + }) + { + ExecutionParameters = new ScheduledActionExecutionParameterDetail + { + OptimizationPreference = ScheduledActionOptimizationPreference.Cost, + RetryPolicy = new UserRequestRetryPolicy + { + RetryCount = 25, + RetryWindowInMinutes = 4, + }, + }, + Correlationid = "muxopzmvkxlowegf", + }; + CreateResourceOperationResponse result = await subscriptionResource.VirtualMachinesSubmitCreateScheduledActionAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task VirtualMachinesSubmitCreateScheduledAction_ScheduledActionsVirtualMachinesSubmitCreateGeneratedByMinimumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesSubmitCreate_MinimumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_VirtualMachinesSubmitCreate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "hrktusuzoncwpnwohurwlmxfbndt"; + SubmitCreateContent content = new SubmitCreateContent(new UserRequestSchedule(ScheduledActionDeadlineType.Unknown), new ResourceProvisionPayload(28)); + CreateResourceOperationResponse result = await subscriptionResource.VirtualMachinesSubmitCreateScheduledActionAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task VirtualMachinesSubmitDeleteScheduledAction_ScheduledActionsVirtualMachinesSubmitDeleteGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesSubmitDelete_MaximumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_VirtualMachinesSubmitDelete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "ppjqysfqumddvzzs"; + SubmitDeleteContent content = new SubmitDeleteContent(new UserRequestSchedule(ScheduledActionDeadlineType.Unknown) + { + Deadline = DateTimeOffset.Parse("2025-04-15T19:47:04.403Z"), + UserRequestDeadline = DateTimeOffset.Parse("2025-04-15T19:47:04.403Z"), + Timezone = "qacufsmctpgjozovlsihrzoctatcsj", + UserRequestTimezone = "upnmayfebiadztdktxzq", + }, new ScheduledActionExecutionParameterDetail + { + OptimizationPreference = ScheduledActionOptimizationPreference.Cost, + RetryPolicy = new UserRequestRetryPolicy + { + RetryCount = 25, + RetryWindowInMinutes = 4, + }, + }, new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") })) + { + Correlationid = "e", + ForceDeletion = true, + }; + DeleteResourceOperationResponse result = await subscriptionResource.VirtualMachinesSubmitDeleteScheduledActionAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task VirtualMachinesSubmitDeleteScheduledAction_ScheduledActionsVirtualMachinesSubmitDeleteGeneratedByMinimumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesSubmitDelete_MinimumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_VirtualMachinesSubmitDelete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "xsllpkyjquhhumdidsl"; + SubmitDeleteContent content = new SubmitDeleteContent(new UserRequestSchedule(ScheduledActionDeadlineType.Unknown), new ScheduledActionExecutionParameterDetail(), new UserRequestResources(new ResourceIdentifier[] { new ResourceIdentifier("/subscriptions/YourSubscriptionId/resourceGroups/YourResourceGroupName/providers/Microsoft.Compute/virtualMachines/testResource3") })); + DeleteResourceOperationResponse result = await subscriptionResource.VirtualMachinesSubmitDeleteScheduledActionAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetVirtualMachineOperationStatus_ScheduledActionsVirtualMachinesGetOperationStatusMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesGetOperationStatus_MaximumSet_Gen.json // this example is just showing the usage of "ScheduledActions_GetVirtualMachineOperationStatus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -241,13 +686,13 @@ public async Task GetVirtualMachineOperationStatus_ScheduledActionsVirtualMachin // 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 = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; + string subscriptionId = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - string locationparameter = "eastus2euap"; - GetOperationStatusContent content = new GetOperationStatusContent(new string[] { "23480d2f-1dca-4610-afb4-dd25eec1f34r" }, "35780d2f-1dca-4610-afb4-dd25eec1f34r"); + string locationparameter = "xzbxygykutmvmxpfowdai"; + GetOperationStatusContent content = new GetOperationStatusContent(new string[] { "hswzfrierpxdgcuu" }, "jtlszorevrftvfhnqoxlwpiwcbmj"); GetOperationStatusResult result = await subscriptionResource.GetVirtualMachineOperationStatusAsync(locationparameter, content); Console.WriteLine($"Succeeded: {result}"); @@ -255,9 +700,35 @@ public async Task GetVirtualMachineOperationStatus_ScheduledActionsVirtualMachin [Test] [Ignore("Only validating compilation of examples")] - public async Task CancelVirtualMachineOperations_ScheduledActionsVirtualMachinesCancelOperations() + public async Task GetVirtualMachineOperationStatus_ScheduledActionsVirtualMachinesGetOperationStatusMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - // Generated from example definition: 2024-10-01/ScheduledActions_VirtualMachinesCancelOperations.json + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesGetOperationStatus_MinimumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_GetVirtualMachineOperationStatus" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "egz"; + GetOperationStatusContent content = new GetOperationStatusContent(new string[] { "hswzfrierpxdgcuu" }, "jtlszorevrftvfhnqoxlwpiwcbmj"); + GetOperationStatusResult result = await subscriptionResource.GetVirtualMachineOperationStatusAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CancelVirtualMachineOperations_ScheduledActionsVirtualMachinesCancelOperationsMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesCancelOperations_MaximumSet_Gen.json // this example is just showing the usage of "ScheduledActions_CancelVirtualMachineOperations" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -267,13 +738,13 @@ public async Task CancelVirtualMachineOperations_ScheduledActionsVirtualMachines // 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 = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; + string subscriptionId = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - string locationparameter = "eastus2euap"; - CancelOperationsContent content = new CancelOperationsContent(new string[] { "23480d2f-1dca-4610-afb4-dd25eec1f34r" }, "23480d2f-1dca-4610-afb4-gg25eec1f34r"); + string locationparameter = "hwrogamrxmqmbhyksvvbpge"; + CancelOperationsContent content = new CancelOperationsContent(new string[] { "rcudibq" }, "lacjacfbxixdmg"); CancelOperationsResult result = await subscriptionResource.CancelVirtualMachineOperationsAsync(locationparameter, content); Console.WriteLine($"Succeeded: {result}"); @@ -281,9 +752,61 @@ public async Task CancelVirtualMachineOperations_ScheduledActionsVirtualMachines [Test] [Ignore("Only validating compilation of examples")] - public async Task GetVirtualMachineOperationErrors_ScheduledActionsVirtualMachinesGetOperationErrors() + public async Task CancelVirtualMachineOperations_ScheduledActionsVirtualMachinesCancelOperationsMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesCancelOperations_MinimumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_CancelVirtualMachineOperations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "pitwczrefdkzfrpphvbqrvbavgnfxl"; + CancelOperationsContent content = new CancelOperationsContent(new string[] { "rcudibq" }, "lacjacfbxixdmg"); + CancelOperationsResult result = await subscriptionResource.CancelVirtualMachineOperationsAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetVirtualMachineOperationErrors_ScheduledActionsVirtualMachinesGetOperationErrorsMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesGetOperationErrors_MaximumSet_Gen.json + // this example is just showing the usage of "ScheduledActions_GetVirtualMachineOperationErrors" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + string locationparameter = "paluwjjcxtjeozpoxrnstls"; + GetOperationErrorsContent content = new GetOperationErrorsContent(new string[] { "ksufjznokhsbowdupyt" }); + GetOperationErrorsResult result = await subscriptionResource.GetVirtualMachineOperationErrorsAsync(locationparameter, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetVirtualMachineOperationErrors_ScheduledActionsVirtualMachinesGetOperationErrorsMaximumSetGenGeneratedByMaximumSetRuleGeneratedByMaximumSetRuleGeneratedByMinimumSetRule() { - // Generated from example definition: 2024-10-01/ScheduledActions_VirtualMachinesGetOperationErrors.json + // Generated from example definition: 2025-05-01/ScheduledActions_VirtualMachinesGetOperationErrors_MinimumSet_Gen.json // this example is just showing the usage of "ScheduledActions_GetVirtualMachineOperationErrors" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -293,13 +816,13 @@ public async Task GetVirtualMachineOperationErrors_ScheduledActionsVirtualMachin // 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 = "D8E30CC0-2763-4FCC-84A8-3C5659281032"; + string subscriptionId = "0505D8E4-D41A-48FB-9CA5-4AF8D93BE75F"; ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - string locationparameter = "eastus2euap"; - GetOperationErrorsContent content = new GetOperationErrorsContent(new string[] { "23480d2f-1dca-4610-afb4-dd25eec1f34r" }); + string locationparameter = "nqwtkslhoamsmxucgbljcz"; + GetOperationErrorsContent content = new GetOperationErrorsContent(new string[] { "ksufjznokhsbowdupyt" }); GetOperationErrorsResult result = await subscriptionResource.GetVirtualMachineOperationErrorsAsync(locationparameter, content); Console.WriteLine($"Succeeded: {result}"); diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ArmComputeScheduleModelFactory.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ArmComputeScheduleModelFactory.cs index f90d6dc03e9c..b4d95dae8581 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ArmComputeScheduleModelFactory.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/ArmComputeScheduleModelFactory.cs @@ -124,6 +124,99 @@ public static StartResourceOperationResult StartResourceOperationResult(string d return new StartResourceOperationResult(description, resourceType, location, results?.ToList(), serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// resource creation payload. + /// The execution parameters for the request. + /// CorrelationId item. + /// A new instance for mocking. + public static ExecuteCreateContent ExecuteCreateContent(ResourceProvisionPayload resourceConfigParameters = null, ScheduledActionExecutionParameterDetail executionParameters = null, string correlationid = null) + { + return new ExecuteCreateContent(resourceConfigParameters, executionParameters, correlationid, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// baseProfile, Resource properties that common across all resources. + /// resourceOverrides, properties per resource that needs to be overwritted from baseProfile. + /// Number of resources to be created. + /// if resourceOverrides doesn't contain "name", service will create name based of prefix and ResourceCount e.g. resourceprefix-0,resourceprefix-1.. + /// A new instance for mocking. + public static ResourceProvisionPayload ResourceProvisionPayload(string baseProfile = null, IEnumerable resourceOverrides = null, int resourceCount = default, string resourcePrefix = null) + { + resourceOverrides ??= new List(); + + return new ResourceProvisionPayload(baseProfile, resourceOverrides?.ToList(), resourceCount, resourcePrefix, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The description of the operation response. + /// The type of resources used in the create request eg virtual machines. + /// The location of the start request eg westus. + /// The results from the start request if no errors exist. + /// A new instance for mocking. + public static CreateResourceOperationResponse CreateResourceOperationResponse(string description = null, string type = null, AzureLocation location = default, IEnumerable results = null) + { + results ??= new List(); + + return new CreateResourceOperationResponse(description, type, location, results?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The execution parameters for the request. + /// The resources for the request. + /// CorrelationId item. + /// Forced delete resource item. + /// A new instance for mocking. + public static ExecuteDeleteContent ExecuteDeleteContent(ScheduledActionExecutionParameterDetail executionParameters = null, IEnumerable resourcesIds = null, string correlationid = null, bool? forceDeletion = null) + { + resourcesIds ??= new List(); + + return new ExecuteDeleteContent(executionParameters, resourcesIds != null ? new UserRequestResources(resourcesIds?.ToList(), serializedAdditionalRawData: null) : null, correlationid, forceDeletion, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The description of the operation response. + /// The type of resources used in the delete request eg virtual machines. + /// The location of the start request eg westus. + /// The results from the start request if no errors exist. + /// A new instance for mocking. + public static DeleteResourceOperationResponse DeleteResourceOperationResponse(string description = null, string type = null, AzureLocation location = default, IEnumerable results = null) + { + results ??= new List(); + + return new DeleteResourceOperationResponse(description, type, location, results?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The schedule for the request. + /// resource creation payload. + /// The execution parameters for the request. + /// CorrelationId item. + /// A new instance for mocking. + public static SubmitCreateContent SubmitCreateContent(UserRequestSchedule schedule = null, ResourceProvisionPayload resourceConfigParameters = null, ScheduledActionExecutionParameterDetail executionParameters = null, string correlationid = null) + { + return new SubmitCreateContent(schedule, resourceConfigParameters, executionParameters, correlationid, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The schedule for the request. + /// The execution parameters for the request. + /// The resources for the request. + /// CorrelationId item. + /// Forced delete resource item. + /// A new instance for mocking. + public static SubmitDeleteContent SubmitDeleteContent(UserRequestSchedule schedule = null, ScheduledActionExecutionParameterDetail executionParameters = null, IEnumerable resourcesIds = null, string correlationid = null, bool? forceDeletion = null) + { + resourcesIds ??= new List(); + + return new SubmitDeleteContent( + schedule, + executionParameters, + resourcesIds != null ? new UserRequestResources(resourcesIds?.ToList(), serializedAdditionalRawData: null) : null, + correlationid, + forceDeletion, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// An array of resource operations based on their operation ids. /// A new instance for mocking. diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/ComputeScheduleExtensions.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/ComputeScheduleExtensions.cs index 599f4b22f17e..ecc7b3fc8e59 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/ComputeScheduleExtensions.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/ComputeScheduleExtensions.cs @@ -35,7 +35,7 @@ private static MockableComputeScheduleSubscriptionResource GetMockableComputeSch /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -69,7 +69,7 @@ public static async Task> SubmitVirt /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -103,7 +103,7 @@ public static Response SubmitVirtualMachineDe /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -137,7 +137,7 @@ public static async Task> SubmitVirtu /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -171,7 +171,7 @@ public static Response SubmitVirtualMachineHib /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -205,7 +205,7 @@ public static async Task> SubmitVirtualMa /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -239,7 +239,7 @@ public static Response SubmitVirtualMachineStart(t /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -273,7 +273,7 @@ public static async Task> ExecuteVir /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -307,7 +307,7 @@ public static Response ExecuteVirtualMachineD /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -341,7 +341,7 @@ public static async Task> ExecuteVirt /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -375,7 +375,7 @@ public static Response ExecuteVirtualMachineHi /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -409,7 +409,7 @@ public static async Task> ExecuteVirtualM /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -430,6 +430,278 @@ public static Response ExecuteVirtualMachineStart( return GetMockableComputeScheduleSubscriptionResource(subscriptionResource).ExecuteVirtualMachineStart(locationparameter, content, cancellationToken); } + /// + /// VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteCreate + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesExecuteCreate + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// , or is null. + public static async Task> VirtualMachinesExecuteCreateScheduledActionAsync(this SubscriptionResource subscriptionResource, string locationparameter, ExecuteCreateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableComputeScheduleSubscriptionResource(subscriptionResource).VirtualMachinesExecuteCreateScheduledActionAsync(locationparameter, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteCreate + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesExecuteCreate + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// , or is null. + public static Response VirtualMachinesExecuteCreateScheduledAction(this SubscriptionResource subscriptionResource, string locationparameter, ExecuteCreateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableComputeScheduleSubscriptionResource(subscriptionResource).VirtualMachinesExecuteCreateScheduledAction(locationparameter, content, cancellationToken); + } + + /// + /// VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDelete + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesExecuteDelete + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// , or is null. + public static async Task> VirtualMachinesExecuteDeleteScheduledActionAsync(this SubscriptionResource subscriptionResource, string locationparameter, ExecuteDeleteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableComputeScheduleSubscriptionResource(subscriptionResource).VirtualMachinesExecuteDeleteScheduledActionAsync(locationparameter, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDelete + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesExecuteDelete + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// , or is null. + public static Response VirtualMachinesExecuteDeleteScheduledAction(this SubscriptionResource subscriptionResource, string locationparameter, ExecuteDeleteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableComputeScheduleSubscriptionResource(subscriptionResource).VirtualMachinesExecuteDeleteScheduledAction(locationparameter, content, cancellationToken); + } + + /// + /// VirtualMachinesSubmitCreate: submit create operation for a batch of virtual machines, at datetime in future. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitCreate + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesSubmitCreate + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// , or is null. + public static async Task> VirtualMachinesSubmitCreateScheduledActionAsync(this SubscriptionResource subscriptionResource, string locationparameter, SubmitCreateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableComputeScheduleSubscriptionResource(subscriptionResource).VirtualMachinesSubmitCreateScheduledActionAsync(locationparameter, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// VirtualMachinesSubmitCreate: submit create operation for a batch of virtual machines, at datetime in future. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitCreate + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesSubmitCreate + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// , or is null. + public static Response VirtualMachinesSubmitCreateScheduledAction(this SubscriptionResource subscriptionResource, string locationparameter, SubmitCreateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableComputeScheduleSubscriptionResource(subscriptionResource).VirtualMachinesSubmitCreateScheduledAction(locationparameter, content, cancellationToken); + } + + /// + /// VirtualMachinesSubmitDelete: submit delete operation for a batch of virtual machines, at datetime in future. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitDelete + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesSubmitDelete + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// , or is null. + public static async Task> VirtualMachinesSubmitDeleteScheduledActionAsync(this SubscriptionResource subscriptionResource, string locationparameter, SubmitDeleteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableComputeScheduleSubscriptionResource(subscriptionResource).VirtualMachinesSubmitDeleteScheduledActionAsync(locationparameter, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// VirtualMachinesSubmitDelete: submit delete operation for a batch of virtual machines, at datetime in future. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitDelete + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesSubmitDelete + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// , or is null. + public static Response VirtualMachinesSubmitDeleteScheduledAction(this SubscriptionResource subscriptionResource, string locationparameter, SubmitDeleteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableComputeScheduleSubscriptionResource(subscriptionResource).VirtualMachinesSubmitDeleteScheduledAction(locationparameter, content, cancellationToken); + } + /// /// VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines /// @@ -443,7 +715,7 @@ public static Response ExecuteVirtualMachineStart( /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -477,7 +749,7 @@ public static async Task> GetVirtualMachineOp /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -511,7 +783,7 @@ public static Response GetVirtualMachineOperationStatu /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -545,7 +817,7 @@ public static async Task> CancelVirtualMachineO /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -579,7 +851,7 @@ public static Response CancelVirtualMachineOperations(th /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -613,7 +885,7 @@ public static async Task> GetVirtualMachineOp /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleSubscriptionResource.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleSubscriptionResource.cs index e25fb1608042..cba8de2fa10c 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleSubscriptionResource.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Extensions/MockableComputeScheduleSubscriptionResource.cs @@ -54,7 +54,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -95,7 +95,7 @@ public virtual async Task> SubmitVir /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -136,7 +136,7 @@ public virtual Response SubmitVirtualMachineD /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -177,7 +177,7 @@ public virtual async Task> SubmitVirt /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -218,7 +218,7 @@ public virtual Response SubmitVirtualMachineHi /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -259,7 +259,7 @@ public virtual async Task> SubmitVirtualM /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -300,7 +300,7 @@ public virtual Response SubmitVirtualMachineStart( /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -341,7 +341,7 @@ public virtual async Task> ExecuteVi /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -382,7 +382,7 @@ public virtual Response ExecuteVirtualMachine /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -423,7 +423,7 @@ public virtual async Task> ExecuteVir /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -464,7 +464,7 @@ public virtual Response ExecuteVirtualMachineH /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -505,7 +505,7 @@ public virtual async Task> ExecuteVirtual /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -533,6 +533,334 @@ public virtual Response ExecuteVirtualMachineStart } } + /// + /// VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteCreate + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesExecuteCreate + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> VirtualMachinesExecuteCreateScheduledActionAsync(string locationparameter, ExecuteCreateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.VirtualMachinesExecuteCreateScheduledAction"); + scope.Start(); + try + { + var response = await ScheduledActionsRestClient.VirtualMachinesExecuteCreateAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteCreate + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesExecuteCreate + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual Response VirtualMachinesExecuteCreateScheduledAction(string locationparameter, ExecuteCreateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.VirtualMachinesExecuteCreateScheduledAction"); + scope.Start(); + try + { + var response = ScheduledActionsRestClient.VirtualMachinesExecuteCreate(Id.SubscriptionId, locationparameter, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDelete + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesExecuteDelete + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> VirtualMachinesExecuteDeleteScheduledActionAsync(string locationparameter, ExecuteDeleteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.VirtualMachinesExecuteDeleteScheduledAction"); + scope.Start(); + try + { + var response = await ScheduledActionsRestClient.VirtualMachinesExecuteDeleteAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesExecuteDelete + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesExecuteDelete + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual Response VirtualMachinesExecuteDeleteScheduledAction(string locationparameter, ExecuteDeleteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.VirtualMachinesExecuteDeleteScheduledAction"); + scope.Start(); + try + { + var response = ScheduledActionsRestClient.VirtualMachinesExecuteDelete(Id.SubscriptionId, locationparameter, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// VirtualMachinesSubmitCreate: submit create operation for a batch of virtual machines, at datetime in future. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitCreate + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesSubmitCreate + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> VirtualMachinesSubmitCreateScheduledActionAsync(string locationparameter, SubmitCreateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.VirtualMachinesSubmitCreateScheduledAction"); + scope.Start(); + try + { + var response = await ScheduledActionsRestClient.VirtualMachinesSubmitCreateAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// VirtualMachinesSubmitCreate: submit create operation for a batch of virtual machines, at datetime in future. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitCreate + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesSubmitCreate + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual Response VirtualMachinesSubmitCreateScheduledAction(string locationparameter, SubmitCreateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.VirtualMachinesSubmitCreateScheduledAction"); + scope.Start(); + try + { + var response = ScheduledActionsRestClient.VirtualMachinesSubmitCreate(Id.SubscriptionId, locationparameter, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// VirtualMachinesSubmitDelete: submit delete operation for a batch of virtual machines, at datetime in future. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitDelete + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesSubmitDelete + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> VirtualMachinesSubmitDeleteScheduledActionAsync(string locationparameter, SubmitDeleteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.VirtualMachinesSubmitDeleteScheduledAction"); + scope.Start(); + try + { + var response = await ScheduledActionsRestClient.VirtualMachinesSubmitDeleteAsync(Id.SubscriptionId, locationparameter, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// VirtualMachinesSubmitDelete: submit delete operation for a batch of virtual machines, at datetime in future. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ComputeSchedule/locations/{locationparameter}/virtualMachinesSubmitDelete + /// + /// + /// Operation Id + /// ScheduledActions_VirtualMachinesSubmitDelete + /// + /// + /// Default Api Version + /// 2025-05-01 + /// + /// + /// + /// The location name. + /// The request body. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual Response VirtualMachinesSubmitDeleteScheduledAction(string locationparameter, SubmitDeleteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = ScheduledActionsClientDiagnostics.CreateScope("MockableComputeScheduleSubscriptionResource.VirtualMachinesSubmitDeleteScheduledAction"); + scope.Start(); + try + { + var response = ScheduledActionsRestClient.VirtualMachinesSubmitDelete(Id.SubscriptionId, locationparameter, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// VirtualMachinesGetOperationStatus: Polling endpoint to read status of operations performed on virtual machines /// @@ -546,7 +874,7 @@ public virtual Response ExecuteVirtualMachineStart /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -587,7 +915,7 @@ public virtual async Task> GetVirtualMachineO /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -628,7 +956,7 @@ public virtual Response GetVirtualMachineOperationStat /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -669,7 +997,7 @@ public virtual async Task> CancelVirtualMachine /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -710,7 +1038,7 @@ public virtual Response CancelVirtualMachineOperations(s /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// @@ -751,7 +1079,7 @@ public virtual async Task> GetVirtualMachineO /// /// /// Default Api Version - /// 2024-10-01 + /// 2025-05-01 /// /// /// diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResponse.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResponse.Serialization.cs new file mode 100644 index 000000000000..fee05b1b1cab --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResponse.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + public partial class CreateResourceOperationResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CreateResourceOperationResponse)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + if (Optional.IsCollectionDefined(Results)) + { + writer.WritePropertyName("results"u8); + writer.WriteStartArray(); + foreach (var item in Results) + { + 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 + } + } + } + + CreateResourceOperationResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateResourceOperationResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateResourceOperationResponse(document.RootElement, options); + } + + internal static CreateResourceOperationResponse DeserializeCreateResourceOperationResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + string type = default; + AzureLocation location = default; + IReadOnlyList results = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("results"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceOperationResult.DeserializeResourceOperationResult(item, options)); + } + results = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CreateResourceOperationResponse(description, type, location, results ?? 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(CreateResourceOperationResponse)} does not support writing '{options.Format}' format."); + } + } + + CreateResourceOperationResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCreateResourceOperationResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateResourceOperationResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResponse.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResponse.cs new file mode 100644 index 000000000000..40116e07a07b --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/CreateResourceOperationResponse.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + /// The response from a create request. + public partial class CreateResourceOperationResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 description of the operation response. + /// The type of resources used in the create request eg virtual machines. + /// The location of the start request eg westus. + /// or is null. + internal CreateResourceOperationResponse(string description, string type, AzureLocation location) + { + Argument.AssertNotNull(description, nameof(description)); + Argument.AssertNotNull(type, nameof(type)); + + Description = description; + Type = type; + Location = location; + Results = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The description of the operation response. + /// The type of resources used in the create request eg virtual machines. + /// The location of the start request eg westus. + /// The results from the start request if no errors exist. + /// Keeps track of any properties unknown to the library. + internal CreateResourceOperationResponse(string description, string type, AzureLocation location, IReadOnlyList results, IDictionary serializedAdditionalRawData) + { + Description = description; + Type = type; + Location = location; + Results = results; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CreateResourceOperationResponse() + { + } + + /// The description of the operation response. + public string Description { get; } + /// The type of resources used in the create request eg virtual machines. + public string Type { get; } + /// The location of the start request eg westus. + public AzureLocation Location { get; } + /// The results from the start request if no errors exist. + public IReadOnlyList Results { get; } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResponse.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResponse.Serialization.cs new file mode 100644 index 000000000000..bc862a35d848 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResponse.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + public partial class DeleteResourceOperationResponse : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DeleteResourceOperationResponse)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + if (Optional.IsCollectionDefined(Results)) + { + writer.WritePropertyName("results"u8); + writer.WriteStartArray(); + foreach (var item in Results) + { + 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 + } + } + } + + DeleteResourceOperationResponse IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeleteResourceOperationResponse)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeleteResourceOperationResponse(document.RootElement, options); + } + + internal static DeleteResourceOperationResponse DeserializeDeleteResourceOperationResponse(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + string type = default; + AzureLocation location = default; + IReadOnlyList results = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("results"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ResourceOperationResult.DeserializeResourceOperationResult(item, options)); + } + results = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeleteResourceOperationResponse(description, type, location, results ?? 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(DeleteResourceOperationResponse)} does not support writing '{options.Format}' format."); + } + } + + DeleteResourceOperationResponse IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeleteResourceOperationResponse(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeleteResourceOperationResponse)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResponse.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResponse.cs new file mode 100644 index 000000000000..d6baeb12254b --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/DeleteResourceOperationResponse.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + /// The response from a delete request. + public partial class DeleteResourceOperationResponse + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 description of the operation response. + /// The type of resources used in the delete request eg virtual machines. + /// The location of the start request eg westus. + /// or is null. + internal DeleteResourceOperationResponse(string description, string type, AzureLocation location) + { + Argument.AssertNotNull(description, nameof(description)); + Argument.AssertNotNull(type, nameof(type)); + + Description = description; + Type = type; + Location = location; + Results = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The description of the operation response. + /// The type of resources used in the delete request eg virtual machines. + /// The location of the start request eg westus. + /// The results from the start request if no errors exist. + /// Keeps track of any properties unknown to the library. + internal DeleteResourceOperationResponse(string description, string type, AzureLocation location, IReadOnlyList results, IDictionary serializedAdditionalRawData) + { + Description = description; + Type = type; + Location = location; + Results = results; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DeleteResourceOperationResponse() + { + } + + /// The description of the operation response. + public string Description { get; } + /// The type of resources used in the delete request eg virtual machines. + public string Type { get; } + /// The location of the start request eg westus. + public AzureLocation Location { get; } + /// The results from the start request if no errors exist. + public IReadOnlyList Results { get; } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.Serialization.cs new file mode 100644 index 000000000000..fb07f6330780 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + public partial class ExecuteCreateContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ExecuteCreateContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("resourceConfigParameters"u8); + writer.WriteObjectValue(ResourceConfigParameters, options); + writer.WritePropertyName("executionParameters"u8); + writer.WriteObjectValue(ExecutionParameters, options); + if (Optional.IsDefined(Correlationid)) + { + writer.WritePropertyName("correlationid"u8); + writer.WriteStringValue(Correlationid); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + ExecuteCreateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExecuteCreateContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExecuteCreateContent(document.RootElement, options); + } + + internal static ExecuteCreateContent DeserializeExecuteCreateContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceProvisionPayload resourceConfigParameters = default; + ScheduledActionExecutionParameterDetail executionParameters = default; + string correlationid = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceConfigParameters"u8)) + { + resourceConfigParameters = ResourceProvisionPayload.DeserializeResourceProvisionPayload(property.Value, options); + continue; + } + if (property.NameEquals("executionParameters"u8)) + { + executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(property.Value, options); + continue; + } + if (property.NameEquals("correlationid"u8)) + { + correlationid = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExecuteCreateContent(resourceConfigParameters, executionParameters, correlationid, serializedAdditionalRawData); + } + + BinaryData 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(ExecuteCreateContent)} does not support writing '{options.Format}' format."); + } + } + + ExecuteCreateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExecuteCreateContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExecuteCreateContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.cs new file mode 100644 index 000000000000..0a93b41900f6 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteCreateContent.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.ComputeSchedule.Models +{ + /// The ExecuteCreateRequest request for create operations. + public partial class ExecuteCreateContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// resource creation payload. + /// The execution parameters for the request. + /// or is null. + public ExecuteCreateContent(ResourceProvisionPayload resourceConfigParameters, ScheduledActionExecutionParameterDetail executionParameters) + { + Argument.AssertNotNull(resourceConfigParameters, nameof(resourceConfigParameters)); + Argument.AssertNotNull(executionParameters, nameof(executionParameters)); + + ResourceConfigParameters = resourceConfigParameters; + ExecutionParameters = executionParameters; + } + + /// Initializes a new instance of . + /// resource creation payload. + /// The execution parameters for the request. + /// CorrelationId item. + /// Keeps track of any properties unknown to the library. + internal ExecuteCreateContent(ResourceProvisionPayload resourceConfigParameters, ScheduledActionExecutionParameterDetail executionParameters, string correlationid, IDictionary serializedAdditionalRawData) + { + ResourceConfigParameters = resourceConfigParameters; + ExecutionParameters = executionParameters; + Correlationid = correlationid; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExecuteCreateContent() + { + } + + /// resource creation payload. + public ResourceProvisionPayload ResourceConfigParameters { get; } + /// The execution parameters for the request. + public ScheduledActionExecutionParameterDetail ExecutionParameters { get; } + /// CorrelationId item. + public string Correlationid { get; set; } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.Serialization.cs new file mode 100644 index 000000000000..e59d37307a21 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + public partial class ExecuteDeleteContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ExecuteDeleteContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("executionParameters"u8); + writer.WriteObjectValue(ExecutionParameters, options); + writer.WritePropertyName("resources"u8); + writer.WriteObjectValue(Resources, options); + if (Optional.IsDefined(Correlationid)) + { + writer.WritePropertyName("correlationid"u8); + writer.WriteStringValue(Correlationid); + } + if (Optional.IsDefined(ForceDeletion)) + { + writer.WritePropertyName("forceDeletion"u8); + writer.WriteBooleanValue(ForceDeletion.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 + } + } + } + + ExecuteDeleteContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExecuteDeleteContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExecuteDeleteContent(document.RootElement, options); + } + + internal static ExecuteDeleteContent DeserializeExecuteDeleteContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ScheduledActionExecutionParameterDetail executionParameters = default; + UserRequestResources resources = default; + string correlationid = default; + bool? forceDeletion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("executionParameters"u8)) + { + executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(property.Value, options); + continue; + } + if (property.NameEquals("resources"u8)) + { + resources = UserRequestResources.DeserializeUserRequestResources(property.Value, options); + continue; + } + if (property.NameEquals("correlationid"u8)) + { + correlationid = property.Value.GetString(); + continue; + } + if (property.NameEquals("forceDeletion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + forceDeletion = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExecuteDeleteContent(executionParameters, resources, correlationid, forceDeletion, serializedAdditionalRawData); + } + + BinaryData 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(ExecuteDeleteContent)} does not support writing '{options.Format}' format."); + } + } + + ExecuteDeleteContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExecuteDeleteContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExecuteDeleteContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.cs new file mode 100644 index 000000000000..ee74c1e3a193 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ExecuteDeleteContent.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + /// The ExecuteDeleteRequest request for delete operations. + public partial class ExecuteDeleteContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 execution parameters for the request. + /// The resources for the request. + /// or is null. + public ExecuteDeleteContent(ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources) + { + Argument.AssertNotNull(executionParameters, nameof(executionParameters)); + Argument.AssertNotNull(resources, nameof(resources)); + + ExecutionParameters = executionParameters; + Resources = resources; + } + + /// Initializes a new instance of . + /// The execution parameters for the request. + /// The resources for the request. + /// CorrelationId item. + /// Forced delete resource item. + /// Keeps track of any properties unknown to the library. + internal ExecuteDeleteContent(ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationid, bool? forceDeletion, IDictionary serializedAdditionalRawData) + { + ExecutionParameters = executionParameters; + Resources = resources; + Correlationid = correlationid; + ForceDeletion = forceDeletion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ExecuteDeleteContent() + { + } + + /// The execution parameters for the request. + public ScheduledActionExecutionParameterDetail ExecutionParameters { get; } + /// The resources for the request. + internal UserRequestResources Resources { get; } + /// The resource ids used for the request. + public IList ResourcesIds + { + get => Resources?.Ids; + } + + /// CorrelationId item. + public string Correlationid { get; set; } + /// Forced delete resource item. + public bool? ForceDeletion { get; set; } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.Serialization.cs new file mode 100644 index 000000000000..db480dbc593b --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.ComputeSchedule.Models +{ + public partial class ResourceProvisionPayload : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ResourceProvisionPayload)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(BaseProfile)) + { + writer.WritePropertyName("baseProfile"u8); + writer.WriteStringValue(BaseProfile); + } + if (Optional.IsCollectionDefined(ResourceOverrides)) + { + writer.WritePropertyName("resourceOverrides"u8); + writer.WriteStartArray(); + foreach (var item in ResourceOverrides) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("resourceCount"u8); + writer.WriteNumberValue(ResourceCount); + if (Optional.IsDefined(ResourcePrefix)) + { + writer.WritePropertyName("resourcePrefix"u8); + writer.WriteStringValue(ResourcePrefix); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + ResourceProvisionPayload IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ResourceProvisionPayload)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeResourceProvisionPayload(document.RootElement, options); + } + + internal static ResourceProvisionPayload DeserializeResourceProvisionPayload(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string baseProfile = default; + IList resourceOverrides = default; + int resourceCount = default; + string resourcePrefix = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("baseProfile"u8)) + { + baseProfile = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceOverrides"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + resourceOverrides = array; + continue; + } + if (property.NameEquals("resourceCount"u8)) + { + resourceCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resourcePrefix"u8)) + { + resourcePrefix = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ResourceProvisionPayload(baseProfile, resourceOverrides ?? new ChangeTrackingList(), resourceCount, resourcePrefix, serializedAdditionalRawData); + } + + BinaryData 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(ResourceProvisionPayload)} does not support writing '{options.Format}' format."); + } + } + + ResourceProvisionPayload IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeResourceProvisionPayload(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ResourceProvisionPayload)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.cs new file mode 100644 index 000000000000..05f4e33ebf91 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/ResourceProvisionPayload.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + /// Resource creation data model. + public partial class ResourceProvisionPayload + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Number of resources to be created. + public ResourceProvisionPayload(int resourceCount) + { + ResourceOverrides = new ChangeTrackingList(); + ResourceCount = resourceCount; + } + + /// Initializes a new instance of . + /// baseProfile, Resource properties that common across all resources. + /// resourceOverrides, properties per resource that needs to be overwritted from baseProfile. + /// Number of resources to be created. + /// if resourceOverrides doesn't contain "name", service will create name based of prefix and ResourceCount e.g. resourceprefix-0,resourceprefix-1.. + /// Keeps track of any properties unknown to the library. + internal ResourceProvisionPayload(string baseProfile, IList resourceOverrides, int resourceCount, string resourcePrefix, IDictionary serializedAdditionalRawData) + { + BaseProfile = baseProfile; + ResourceOverrides = resourceOverrides; + ResourceCount = resourceCount; + ResourcePrefix = resourcePrefix; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ResourceProvisionPayload() + { + } + + /// baseProfile, Resource properties that common across all resources. + public string BaseProfile { get; set; } + /// resourceOverrides, properties per resource that needs to be overwritted from baseProfile. + public IList ResourceOverrides { get; } + /// Number of resources to be created. + public int ResourceCount { get; } + /// if resourceOverrides doesn't contain "name", service will create name based of prefix and ResourceCount e.g. resourceprefix-0,resourceprefix-1.. + public string ResourcePrefix { get; set; } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitCreateContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitCreateContent.Serialization.cs new file mode 100644 index 000000000000..7f159fa7fe7c --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitCreateContent.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + public partial class SubmitCreateContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SubmitCreateContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("schedule"u8); + writer.WriteObjectValue(Schedule, options); + writer.WritePropertyName("resourceConfigParameters"u8); + writer.WriteObjectValue(ResourceConfigParameters, options); + if (Optional.IsDefined(ExecutionParameters)) + { + writer.WritePropertyName("executionParameters"u8); + writer.WriteObjectValue(ExecutionParameters, options); + } + if (Optional.IsDefined(Correlationid)) + { + writer.WritePropertyName("correlationid"u8); + writer.WriteStringValue(Correlationid); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + SubmitCreateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubmitCreateContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSubmitCreateContent(document.RootElement, options); + } + + internal static SubmitCreateContent DeserializeSubmitCreateContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + UserRequestSchedule schedule = default; + ResourceProvisionPayload resourceConfigParameters = default; + ScheduledActionExecutionParameterDetail executionParameters = default; + string correlationid = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("schedule"u8)) + { + schedule = UserRequestSchedule.DeserializeUserRequestSchedule(property.Value, options); + continue; + } + if (property.NameEquals("resourceConfigParameters"u8)) + { + resourceConfigParameters = ResourceProvisionPayload.DeserializeResourceProvisionPayload(property.Value, options); + continue; + } + if (property.NameEquals("executionParameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(property.Value, options); + continue; + } + if (property.NameEquals("correlationid"u8)) + { + correlationid = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SubmitCreateContent(schedule, resourceConfigParameters, executionParameters, correlationid, serializedAdditionalRawData); + } + + BinaryData 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(SubmitCreateContent)} does not support writing '{options.Format}' format."); + } + } + + SubmitCreateContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSubmitCreateContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SubmitCreateContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitCreateContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitCreateContent.cs new file mode 100644 index 000000000000..5e96bf35e60d --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitCreateContent.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + /// The SubmitCreateRequest request for create operations. + public partial class SubmitCreateContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 schedule for the request. + /// resource creation payload. + /// or is null. + public SubmitCreateContent(UserRequestSchedule schedule, ResourceProvisionPayload resourceConfigParameters) + { + Argument.AssertNotNull(schedule, nameof(schedule)); + Argument.AssertNotNull(resourceConfigParameters, nameof(resourceConfigParameters)); + + Schedule = schedule; + ResourceConfigParameters = resourceConfigParameters; + } + + /// Initializes a new instance of . + /// The schedule for the request. + /// resource creation payload. + /// The execution parameters for the request. + /// CorrelationId item. + /// Keeps track of any properties unknown to the library. + internal SubmitCreateContent(UserRequestSchedule schedule, ResourceProvisionPayload resourceConfigParameters, ScheduledActionExecutionParameterDetail executionParameters, string correlationid, IDictionary serializedAdditionalRawData) + { + Schedule = schedule; + ResourceConfigParameters = resourceConfigParameters; + ExecutionParameters = executionParameters; + Correlationid = correlationid; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SubmitCreateContent() + { + } + + /// The schedule for the request. + public UserRequestSchedule Schedule { get; } + /// resource creation payload. + public ResourceProvisionPayload ResourceConfigParameters { get; } + /// The execution parameters for the request. + public ScheduledActionExecutionParameterDetail ExecutionParameters { get; set; } + /// CorrelationId item. + public string Correlationid { get; set; } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeleteContent.Serialization.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeleteContent.Serialization.cs new file mode 100644 index 000000000000..c0f2c907f1fd --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeleteContent.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.ComputeSchedule.Models +{ + public partial class SubmitDeleteContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SubmitDeleteContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("schedule"u8); + writer.WriteObjectValue(Schedule, options); + writer.WritePropertyName("executionParameters"u8); + writer.WriteObjectValue(ExecutionParameters, options); + writer.WritePropertyName("resources"u8); + writer.WriteObjectValue(Resources, options); + if (Optional.IsDefined(Correlationid)) + { + writer.WritePropertyName("correlationid"u8); + writer.WriteStringValue(Correlationid); + } + if (Optional.IsDefined(ForceDeletion)) + { + writer.WritePropertyName("forceDeletion"u8); + writer.WriteBooleanValue(ForceDeletion.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 + } + } + } + + SubmitDeleteContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SubmitDeleteContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSubmitDeleteContent(document.RootElement, options); + } + + internal static SubmitDeleteContent DeserializeSubmitDeleteContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + UserRequestSchedule schedule = default; + ScheduledActionExecutionParameterDetail executionParameters = default; + UserRequestResources resources = default; + string correlationid = default; + bool? forceDeletion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("schedule"u8)) + { + schedule = UserRequestSchedule.DeserializeUserRequestSchedule(property.Value, options); + continue; + } + if (property.NameEquals("executionParameters"u8)) + { + executionParameters = ScheduledActionExecutionParameterDetail.DeserializeScheduledActionExecutionParameterDetail(property.Value, options); + continue; + } + if (property.NameEquals("resources"u8)) + { + resources = UserRequestResources.DeserializeUserRequestResources(property.Value, options); + continue; + } + if (property.NameEquals("correlationid"u8)) + { + correlationid = property.Value.GetString(); + continue; + } + if (property.NameEquals("forceDeletion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + forceDeletion = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SubmitDeleteContent( + schedule, + executionParameters, + resources, + correlationid, + forceDeletion, + serializedAdditionalRawData); + } + + BinaryData 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(SubmitDeleteContent)} does not support writing '{options.Format}' format."); + } + } + + SubmitDeleteContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSubmitDeleteContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SubmitDeleteContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeleteContent.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeleteContent.cs new file mode 100644 index 000000000000..4b135de3b212 --- /dev/null +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/Models/SubmitDeleteContent.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.ComputeSchedule.Models +{ + /// The SubmitDeleteRequest request for delete operations. + public partial class SubmitDeleteContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 schedule for the request. + /// The execution parameters for the request. + /// The resources for the request. + /// , or is null. + public SubmitDeleteContent(UserRequestSchedule schedule, ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources) + { + Argument.AssertNotNull(schedule, nameof(schedule)); + Argument.AssertNotNull(executionParameters, nameof(executionParameters)); + Argument.AssertNotNull(resources, nameof(resources)); + + Schedule = schedule; + ExecutionParameters = executionParameters; + Resources = resources; + } + + /// Initializes a new instance of . + /// The schedule for the request. + /// The execution parameters for the request. + /// The resources for the request. + /// CorrelationId item. + /// Forced delete resource item. + /// Keeps track of any properties unknown to the library. + internal SubmitDeleteContent(UserRequestSchedule schedule, ScheduledActionExecutionParameterDetail executionParameters, UserRequestResources resources, string correlationid, bool? forceDeletion, IDictionary serializedAdditionalRawData) + { + Schedule = schedule; + ExecutionParameters = executionParameters; + Resources = resources; + Correlationid = correlationid; + ForceDeletion = forceDeletion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SubmitDeleteContent() + { + } + + /// The schedule for the request. + public UserRequestSchedule Schedule { get; } + /// The execution parameters for the request. + public ScheduledActionExecutionParameterDetail ExecutionParameters { get; } + /// The resources for the request. + internal UserRequestResources Resources { get; } + /// The resource ids used for the request. + public IList ResourcesIds + { + get => Resources?.Ids; + } + + /// CorrelationId item. + public string Correlationid { get; set; } + /// Forced delete resource item. + public bool? ForceDeletion { get; set; } + } +} diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/ScheduledActionsRestOperations.cs b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/ScheduledActionsRestOperations.cs index f97f477230fb..7b3694f73154 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/ScheduledActionsRestOperations.cs +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/src/Generated/RestOperations/ScheduledActionsRestOperations.cs @@ -32,7 +32,7 @@ public ScheduledActionsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-10-01"; + _apiVersion = apiVersion ?? "2025-05-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -600,6 +600,382 @@ public Response ExecuteVirtualMachineStart(string } } + internal RequestUriBuilder CreateVirtualMachinesExecuteCreateRequestUri(string subscriptionId, string locationparameter, ExecuteCreateContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); + uri.AppendPath(locationparameter, true); + uri.AppendPath("/virtualMachinesExecuteCreate", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateVirtualMachinesExecuteCreateRequest(string subscriptionId, string locationparameter, ExecuteCreateContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); + uri.AppendPath(locationparameter, true); + uri.AppendPath("/virtualMachinesExecuteCreate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + /// The ID of the target subscription. The value must be an UUID. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> VirtualMachinesExecuteCreateAsync(string subscriptionId, string locationparameter, ExecuteCreateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateVirtualMachinesExecuteCreateRequest(subscriptionId, locationparameter, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CreateResourceOperationResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CreateResourceOperationResponse.DeserializeCreateResourceOperationResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// VirtualMachinesExecuteCreate: Execute create operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + /// The ID of the target subscription. The value must be an UUID. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response VirtualMachinesExecuteCreate(string subscriptionId, string locationparameter, ExecuteCreateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateVirtualMachinesExecuteCreateRequest(subscriptionId, locationparameter, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CreateResourceOperationResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CreateResourceOperationResponse.DeserializeCreateResourceOperationResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateVirtualMachinesExecuteDeleteRequestUri(string subscriptionId, string locationparameter, ExecuteDeleteContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); + uri.AppendPath(locationparameter, true); + uri.AppendPath("/virtualMachinesExecuteDelete", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateVirtualMachinesExecuteDeleteRequest(string subscriptionId, string locationparameter, ExecuteDeleteContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); + uri.AppendPath(locationparameter, true); + uri.AppendPath("/virtualMachinesExecuteDelete", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + /// The ID of the target subscription. The value must be an UUID. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> VirtualMachinesExecuteDeleteAsync(string subscriptionId, string locationparameter, ExecuteDeleteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateVirtualMachinesExecuteDeleteRequest(subscriptionId, locationparameter, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeleteResourceOperationResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DeleteResourceOperationResponse.DeserializeDeleteResourceOperationResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// VirtualMachinesExecuteDelete: Execute delete operation for a batch of virtual machines, this operation is triggered as soon as Computeschedule receives it. + /// The ID of the target subscription. The value must be an UUID. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response VirtualMachinesExecuteDelete(string subscriptionId, string locationparameter, ExecuteDeleteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateVirtualMachinesExecuteDeleteRequest(subscriptionId, locationparameter, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeleteResourceOperationResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DeleteResourceOperationResponse.DeserializeDeleteResourceOperationResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateVirtualMachinesSubmitCreateRequestUri(string subscriptionId, string locationparameter, SubmitCreateContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); + uri.AppendPath(locationparameter, true); + uri.AppendPath("/virtualMachinesSubmitCreate", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateVirtualMachinesSubmitCreateRequest(string subscriptionId, string locationparameter, SubmitCreateContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); + uri.AppendPath(locationparameter, true); + uri.AppendPath("/virtualMachinesSubmitCreate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// VirtualMachinesSubmitCreate: submit create operation for a batch of virtual machines, at datetime in future. + /// The ID of the target subscription. The value must be an UUID. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> VirtualMachinesSubmitCreateAsync(string subscriptionId, string locationparameter, SubmitCreateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateVirtualMachinesSubmitCreateRequest(subscriptionId, locationparameter, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CreateResourceOperationResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CreateResourceOperationResponse.DeserializeCreateResourceOperationResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// VirtualMachinesSubmitCreate: submit create operation for a batch of virtual machines, at datetime in future. + /// The ID of the target subscription. The value must be an UUID. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response VirtualMachinesSubmitCreate(string subscriptionId, string locationparameter, SubmitCreateContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateVirtualMachinesSubmitCreateRequest(subscriptionId, locationparameter, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CreateResourceOperationResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CreateResourceOperationResponse.DeserializeCreateResourceOperationResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateVirtualMachinesSubmitDeleteRequestUri(string subscriptionId, string locationparameter, SubmitDeleteContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); + uri.AppendPath(locationparameter, true); + uri.AppendPath("/virtualMachinesSubmitDelete", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateVirtualMachinesSubmitDeleteRequest(string subscriptionId, string locationparameter, SubmitDeleteContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ComputeSchedule/locations/", false); + uri.AppendPath(locationparameter, true); + uri.AppendPath("/virtualMachinesSubmitDelete", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// VirtualMachinesSubmitDelete: submit delete operation for a batch of virtual machines, at datetime in future. + /// The ID of the target subscription. The value must be an UUID. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> VirtualMachinesSubmitDeleteAsync(string subscriptionId, string locationparameter, SubmitDeleteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateVirtualMachinesSubmitDeleteRequest(subscriptionId, locationparameter, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeleteResourceOperationResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DeleteResourceOperationResponse.DeserializeDeleteResourceOperationResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// VirtualMachinesSubmitDelete: submit delete operation for a batch of virtual machines, at datetime in future. + /// The ID of the target subscription. The value must be an UUID. + /// The location name. + /// The request body. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response VirtualMachinesSubmitDelete(string subscriptionId, string locationparameter, SubmitDeleteContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(locationparameter, nameof(locationparameter)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateVirtualMachinesSubmitDeleteRequest(subscriptionId, locationparameter, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeleteResourceOperationResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DeleteResourceOperationResponse.DeserializeDeleteResourceOperationResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + internal RequestUriBuilder CreateGetVirtualMachineOperationStatusRequestUri(string subscriptionId, string locationparameter, GetOperationStatusContent content) { var uri = new RawRequestUriBuilder(); diff --git a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml index a1e8be2a82fb..3c0347eb2615 100644 --- a/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml +++ b/sdk/computeschedule/Azure.ResourceManager.ComputeSchedule/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/computeschedule/ComputeSchedule.Management -commit: 462574dbd02088c209bb1da3eef0d93f699e8de2 -repo: Azure/azure-rest-api-specs \ No newline at end of file +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Azure.ResourceManager.DatabaseFleetManager.sln b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Azure.ResourceManager.DatabaseFleetManager.sln new file mode 100644 index 000000000000..089254656cac --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Azure.ResourceManager.DatabaseFleetManager.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.DatabaseFleetManager.Samples", "samples\Azure.ResourceManager.DatabaseFleetManager.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.DatabaseFleetManager", "src\Azure.ResourceManager.DatabaseFleetManager.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.DatabaseFleetManager.Tests", "tests\Azure.ResourceManager.DatabaseFleetManager.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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/CHANGELOG.md b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Directory.Build.props b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/README.md b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/README.md new file mode 100644 index 000000000000..ce57f5065e0e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure DatabaseFleetManager 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 DatabaseFleetManager management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.DatabaseFleetManager --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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.net8.0.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.net8.0.cs new file mode 100644 index 000000000000..3cd9005cfaab --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.net8.0.cs @@ -0,0 +1,637 @@ +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public static partial class DatabaseFleetManagerExtensions + { + public static Azure.ResourceManager.DatabaseFleetManager.FirewallRuleResource GetFirewallRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetFleet(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetFleetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseResource GetFleetDatabaseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetResource GetFleetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetCollection GetFleets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetFleets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetFleetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetspaceResource GetFleetspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetTierResource GetFleetTierResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class FirewallRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FirewallRuleCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FirewallRuleData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FirewallRuleData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FirewallRuleResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FirewallRuleResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.DatabaseFleetManager.FleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.DatabaseFleetManager.FleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetDatabaseCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string databaseName, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string databaseName, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string filter = null, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string filter = null, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetDatabaseData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetDatabaseData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetDatabaseResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.ResourceManager.ArmOperation ChangeTier(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ChangeTierAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Rename(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RenameAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Revert(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RevertAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFleetspace(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetspaceAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceCollection GetFleetspaces() { throw null; } + public virtual Azure.Response GetFleetTier(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetTierAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierCollection GetFleetTiers() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetspaceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetspaceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetspaceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetspaceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetspaceResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFirewallRule(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFirewallRuleAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleCollection GetFirewallRules() { throw null; } + public virtual Azure.Response GetFleetDatabase(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetDatabaseAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseCollection GetFleetDatabases() { throw null; } + public virtual Azure.ResourceManager.ArmOperation RegisterServer(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RegisterServerAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Unregister(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UnregisterAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetTierCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetTierCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string tierName, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string tierName, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetTierData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetTierData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetTierResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetTierResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string tierName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Disable(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DisableAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseFleetManager.Mocking +{ + public partial class MockableDatabaseFleetManagerArmClient : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerArmClient() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleResource GetFirewallRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseResource GetFleetDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetResource GetFleetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceResource GetFleetspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierResource GetFleetTierResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableDatabaseFleetManagerResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerResourceGroupResource() { } + public virtual Azure.Response GetFleet(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetCollection GetFleets() { throw null; } + } + public partial class MockableDatabaseFleetManagerSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerSubscriptionResource() { } + public virtual Azure.Pageable GetFleets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetFleetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public static partial class ArmDatabaseFleetManagerModelFactory + { + public static Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData FirewallRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties FirewallRuleProperties(string startIPAddress = null, string endIPAddress = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetData FleetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData FleetDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties FleetDatabaseProperties(string originalDatabaseId = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?), Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode? createMode = default(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode?), string tierName = null, string connectionString = null, bool? recoverable = default(bool?), System.DateTimeOffset? restoreFromOn = default(System.DateTimeOffset?), System.DateTimeOffset? earliestRestoreOn = default(System.DateTimeOffset?), System.DateTimeOffset? latestRestoreOn = default(System.DateTimeOffset?), int? backupRetentionDays = default(int?), int? databaseSizeGbMax = default(int?), string sourceDatabaseName = null, System.Collections.Generic.IDictionary resourceTags = null, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties identity = null, Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption transparentDataEncryption = null, string collation = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties FleetProperties(string description = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetspaceData FleetspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties FleetspaceProperties(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?), int? capacityMax = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal mainPrincipal = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetTierData FleetTierData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties FleetTierProperties(bool? disabled = default(bool?), bool? serverless = default(bool?), bool? pooled = default(bool?), string serviceTier = null, string family = null, int? capacity = default(int?), int? poolNumOfDatabasesMax = default(int?), int? highAvailabilityReplicaCount = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy?), double? databaseCapacityMin = default(double?), double? databaseCapacityMax = default(double?), int? databaseSizeGbMax = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState left, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState left, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseChangeTierProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseChangeTierProperties() { } + public string TargetTierName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DatabaseCreateMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DatabaseCreateMode(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode Copy { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode Default { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode PointInTimeRestore { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode left, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode left, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseIdentity() { } + public System.Guid? ClientId { get { throw null; } set { } } + public System.Guid? PrincipalId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DatabaseRenameProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseRenameProperties() { } + public string NewName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DestinationTierOverride : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DestinationTierOverride(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType resourceType, string tierName, string resourceName) { } + public string ResourceName { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType ResourceType { get { throw null; } } + public string TierName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DestinationTierOverride System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DestinationTierOverride System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FirewallRuleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FirewallRuleProperties() { } + public string EndIPAddress { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public string StartIPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetDatabaseProperties() { } + public int? BackupRetentionDays { get { throw null; } } + public string Collation { get { throw null; } set { } } + public string ConnectionString { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode? CreateMode { get { throw null; } set { } } + public int? DatabaseSizeGbMax { get { throw null; } } + public System.DateTimeOffset? EarliestRestoreOn { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties Identity { get { throw null; } set { } } + public System.DateTimeOffset? LatestRestoreOn { get { throw null; } } + public string OriginalDatabaseId { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public bool? Recoverable { get { throw null; } } + public System.Collections.Generic.IDictionary ResourceTags { get { throw null; } } + public System.DateTimeOffset? RestoreFromOn { get { throw null; } set { } } + public string SourceDatabaseName { get { throw null; } set { } } + public string TierName { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption TransparentDataEncryption { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetPatch() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetProperties() { } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetspaceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceProperties() { } + public int? CapacityMax { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal MainPrincipal { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetTierProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetTierProperties() { } + public int? Capacity { get { throw null; } set { } } + public double? DatabaseCapacityMax { get { throw null; } set { } } + public double? DatabaseCapacityMin { get { throw null; } set { } } + public int? DatabaseSizeGbMax { get { throw null; } set { } } + public bool? Disabled { get { throw null; } } + public string Family { get { throw null; } set { } } + public int? HighAvailabilityReplicaCount { get { throw null; } set { } } + public bool? Pooled { get { throw null; } set { } } + public int? PoolNumOfDatabasesMax { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public bool? Serverless { get { throw null; } set { } } + public string ServiceTier { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy? ZoneRedundancy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IdentityProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IdentityProperties() { } + public System.Guid? FederatedClientId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType? IdentityType { get { throw null; } set { } } + public System.Collections.Generic.IList UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IdentityType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType None { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType left, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType left, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MainPrincipal : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MainPrincipal() { } + public System.Guid? ApplicationId { get { throw null; } set { } } + public string Login { get { throw null; } set { } } + public System.Guid? ObjectId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType? PrincipalType { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrincipalType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrincipalType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType Application { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType User { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType left, Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType left, Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RegisterServerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RegisterServerProperties() { } + public System.Collections.Generic.IList DestinationTierOverrides { get { throw null; } } + public string SourceResourceGroupName { get { throw null; } set { } } + public string SourceServerName { get { throw null; } set { } } + public string SourceSubscriptionId { get { throw null; } set { } } + public string TierName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType Database { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType Pool { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType left, Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType left, Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TransparentDataEncryption : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TransparentDataEncryption() { } + public bool? EnableAutoRotation { get { throw null; } set { } } + public System.Collections.Generic.IList Keys { get { throw null; } } + public System.Uri KeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ZoneRedundancy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ZoneRedundancy(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy Disabled { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy left, Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy left, Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.netstandard2.0.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.netstandard2.0.cs new file mode 100644 index 000000000000..3cd9005cfaab --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/api/Azure.ResourceManager.DatabaseFleetManager.netstandard2.0.cs @@ -0,0 +1,637 @@ +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public static partial class DatabaseFleetManagerExtensions + { + public static Azure.ResourceManager.DatabaseFleetManager.FirewallRuleResource GetFirewallRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetFleet(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetFleetAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseResource GetFleetDatabaseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetResource GetFleetResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetCollection GetFleets(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetFleets(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetFleetsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetspaceResource GetFleetspaceResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetTierResource GetFleetTierResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class FirewallRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FirewallRuleCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FirewallRuleData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FirewallRuleData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FirewallRuleResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FirewallRuleResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.DatabaseFleetManager.FleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetName, Azure.ResourceManager.DatabaseFleetManager.FleetData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetDatabaseCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string databaseName, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string databaseName, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string filter = null, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string filter = null, string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetDatabaseData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetDatabaseData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetDatabaseResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.ResourceManager.ArmOperation ChangeTier(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task ChangeTierAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Rename(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RenameAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Revert(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RevertAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFleetspace(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetspaceAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceCollection GetFleetspaces() { throw null; } + public virtual Azure.Response GetFleetTier(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetTierAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierCollection GetFleetTiers() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetspaceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetspaceCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fleetspaceName, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fleetspaceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetspaceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetspaceResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetspaceResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetFirewallRule(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFirewallRuleAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleCollection GetFirewallRules() { throw null; } + public virtual Azure.Response GetFleetDatabase(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetDatabaseAsync(string databaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseCollection GetFleetDatabases() { throw null; } + public virtual Azure.ResourceManager.ArmOperation RegisterServer(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task RegisterServerAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Unregister(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task UnregisterAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetspaceData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class FleetTierCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected FleetTierCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string tierName, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string tierName, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(long? skip = default(long?), long? top = default(long?), string skiptoken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string tierName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class FleetTierData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetTierData() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetTierResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected FleetTierResource() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string tierName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Disable(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DisableAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.FleetTierData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.DatabaseFleetManager.FleetTierData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseFleetManager.Mocking +{ + public partial class MockableDatabaseFleetManagerArmClient : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerArmClient() { } + public virtual Azure.ResourceManager.DatabaseFleetManager.FirewallRuleResource GetFirewallRuleResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseResource GetFleetDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetResource GetFleetResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetspaceResource GetFleetspaceResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetTierResource GetFleetTierResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableDatabaseFleetManagerResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerResourceGroupResource() { } + public virtual Azure.Response GetFleet(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetFleetAsync(string fleetName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.DatabaseFleetManager.FleetCollection GetFleets() { throw null; } + } + public partial class MockableDatabaseFleetManagerSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableDatabaseFleetManagerSubscriptionResource() { } + public virtual Azure.Pageable GetFleets(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetFleetsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public static partial class ArmDatabaseFleetManagerModelFactory + { + public static Azure.ResourceManager.DatabaseFleetManager.FirewallRuleData FirewallRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties FirewallRuleProperties(string startIPAddress = null, string endIPAddress = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetData FleetData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetDatabaseData FleetDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties FleetDatabaseProperties(string originalDatabaseId = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?), Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode? createMode = default(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode?), string tierName = null, string connectionString = null, bool? recoverable = default(bool?), System.DateTimeOffset? restoreFromOn = default(System.DateTimeOffset?), System.DateTimeOffset? earliestRestoreOn = default(System.DateTimeOffset?), System.DateTimeOffset? latestRestoreOn = default(System.DateTimeOffset?), int? backupRetentionDays = default(int?), int? databaseSizeGbMax = default(int?), string sourceDatabaseName = null, System.Collections.Generic.IDictionary resourceTags = null, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties identity = null, Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption transparentDataEncryption = null, string collation = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties FleetProperties(string description = null, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetspaceData FleetspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties FleetspaceProperties(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?), int? capacityMax = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal mainPrincipal = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.FleetTierData FleetTierData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties properties = null) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties FleetTierProperties(bool? disabled = default(bool?), bool? serverless = default(bool?), bool? pooled = default(bool?), string serviceTier = null, string family = null, int? capacity = default(int?), int? poolNumOfDatabasesMax = default(int?), int? highAvailabilityReplicaCount = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy? zoneRedundancy = default(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy?), double? databaseCapacityMin = default(double?), double? databaseCapacityMax = default(double?), int? databaseSizeGbMax = default(int?), Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? provisioningState = default(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState?)) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState left, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState left, Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseChangeTierProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseChangeTierProperties() { } + public string TargetTierName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseChangeTierProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DatabaseCreateMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DatabaseCreateMode(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode Copy { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode Default { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode PointInTimeRestore { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode left, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode left, Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DatabaseIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseIdentity() { } + public System.Guid? ClientId { get { throw null; } set { } } + public System.Guid? PrincipalId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DatabaseRenameProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DatabaseRenameProperties() { } + public string NewName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseRenameProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DestinationTierOverride : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DestinationTierOverride(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType resourceType, string tierName, string resourceName) { } + public string ResourceName { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType ResourceType { get { throw null; } } + public string TierName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DestinationTierOverride System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.DestinationTierOverride System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FirewallRuleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FirewallRuleProperties() { } + public string EndIPAddress { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public string StartIPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FirewallRuleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetDatabaseProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetDatabaseProperties() { } + public int? BackupRetentionDays { get { throw null; } } + public string Collation { get { throw null; } set { } } + public string ConnectionString { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.DatabaseCreateMode? CreateMode { get { throw null; } set { } } + public int? DatabaseSizeGbMax { get { throw null; } } + public System.DateTimeOffset? EarliestRestoreOn { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties Identity { get { throw null; } set { } } + public System.DateTimeOffset? LatestRestoreOn { get { throw null; } } + public string OriginalDatabaseId { get { throw null; } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public bool? Recoverable { get { throw null; } } + public System.Collections.Generic.IDictionary ResourceTags { get { throw null; } } + public System.DateTimeOffset? RestoreFromOn { get { throw null; } set { } } + public string SourceDatabaseName { get { throw null; } set { } } + public string TierName { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption TransparentDataEncryption { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetDatabaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetPatch : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetPatch() { } + public Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetProperties() { } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetspaceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetspaceProperties() { } + public int? CapacityMax { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal MainPrincipal { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetspaceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FleetTierProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public FleetTierProperties() { } + public int? Capacity { get { throw null; } set { } } + public double? DatabaseCapacityMax { get { throw null; } set { } } + public double? DatabaseCapacityMin { get { throw null; } set { } } + public int? DatabaseSizeGbMax { get { throw null; } set { } } + public bool? Disabled { get { throw null; } } + public string Family { get { throw null; } set { } } + public int? HighAvailabilityReplicaCount { get { throw null; } set { } } + public bool? Pooled { get { throw null; } set { } } + public int? PoolNumOfDatabasesMax { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.AzureProvisioningState? ProvisioningState { get { throw null; } } + public bool? Serverless { get { throw null; } set { } } + public string ServiceTier { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy? ZoneRedundancy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.FleetTierProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class IdentityProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public IdentityProperties() { } + public System.Guid? FederatedClientId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType? IdentityType { get { throw null; } set { } } + public System.Collections.Generic.IList UserAssignedIdentities { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.IdentityProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct IdentityType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public IdentityType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType None { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType UserAssigned { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType left, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType left, Azure.ResourceManager.DatabaseFleetManager.Models.IdentityType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MainPrincipal : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public MainPrincipal() { } + public System.Guid? ApplicationId { get { throw null; } set { } } + public string Login { get { throw null; } set { } } + public System.Guid? ObjectId { get { throw null; } set { } } + public Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType? PrincipalType { get { throw null; } set { } } + public System.Guid? TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.MainPrincipal System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct PrincipalType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public PrincipalType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType Application { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType User { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType left, Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType left, Azure.ResourceManager.DatabaseFleetManager.Models.PrincipalType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class RegisterServerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RegisterServerProperties() { } + public System.Collections.Generic.IList DestinationTierOverrides { get { throw null; } } + public string SourceResourceGroupName { get { throw null; } set { } } + public string SourceServerName { get { throw null; } set { } } + public string SourceSubscriptionId { get { throw null; } set { } } + public string TierName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.RegisterServerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ResourceType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ResourceType(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType Database { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType Pool { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType left, Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType left, Azure.ResourceManager.DatabaseFleetManager.Models.ResourceType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TransparentDataEncryption : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TransparentDataEncryption() { } + public bool? EnableAutoRotation { get { throw null; } set { } } + public System.Collections.Generic.IList Keys { get { throw null; } } + public System.Uri KeyUri { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.DatabaseFleetManager.Models.TransparentDataEncryption System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ZoneRedundancy : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ZoneRedundancy(string value) { throw null; } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy Disabled { get { throw null; } } + public static Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy Enabled { get { throw null; } } + public bool Equals(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy left, Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy right) { throw null; } + public static implicit operator Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy left, Azure.ResourceManager.DatabaseFleetManager.Models.ZoneRedundancy right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/assets.json b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/assets.json new file mode 100644 index 000000000000..a3ae9749e088 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager", + "Tag": "" +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Azure.ResourceManager.DatabaseFleetManager.Samples.csproj b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Azure.ResourceManager.DatabaseFleetManager.Samples.csproj new file mode 100644 index 000000000000..1591846d9047 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Azure.ResourceManager.DatabaseFleetManager.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleCollection.cs new file mode 100644 index 000000000000..460fbae841d0 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleCollection.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FirewallRuleCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + FirewallRuleData data = new FirewallRuleData + { + Properties = new FirewallRuleProperties + { + StartIPAddress = "10.0.0.0", + EndIPAddress = "10.0.0.255", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, firewallRuleName, data); + FirewallRuleResource 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 + FirewallRuleData 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_GetFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + FirewallRuleResource result = await collection.GetAsync(firewallRuleName); + + // 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 + FirewallRuleData 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_ListFirewallRulesByFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_ListByFleetspace_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_ListByFleetspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation and iterate over the result + await foreach (FirewallRuleResource 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 + FirewallRuleData 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_GetFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + bool result = await collection.ExistsAsync(firewallRuleName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FirewallRuleResource + FirewallRuleCollection collection = fleetspace.GetFirewallRules(); + + // invoke the operation + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + NullableResponse response = await collection.GetIfExistsAsync(firewallRuleName); + FirewallRuleResource 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 + FirewallRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleResource.cs new file mode 100644 index 000000000000..87e86ff9cd3d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FirewallRuleResource.cs @@ -0,0 +1,120 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FirewallRuleResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FirewallRuleResource created on azure + // for more information of creating FirewallRuleResource, please refer to the document of FirewallRuleResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + ResourceIdentifier firewallRuleResourceId = FirewallRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + FirewallRuleResource firewallRule = client.GetFirewallRuleResource(firewallRuleResourceId); + + // invoke the operation + FirewallRuleResource result = await firewallRule.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 + FirewallRuleData 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_DeleteFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_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 FirewallRuleResource created on azure + // for more information of creating FirewallRuleResource, please refer to the document of FirewallRuleResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + ResourceIdentifier firewallRuleResourceId = FirewallRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + FirewallRuleResource firewallRule = client.GetFirewallRuleResource(firewallRuleResourceId); + + // invoke the operation + await firewallRule.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreateOrUpdateFirewallRuleGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FirewallRules_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FirewallRule_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 FirewallRuleResource created on azure + // for more information of creating FirewallRuleResource, please refer to the document of FirewallRuleResource + string subscriptionId = "a2b3c4d5-6789-0123-4567-89abcdef1234"; + string resourceGroupName = "rg-networking-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string firewallRuleName = "allow-10-0-0-0-24-to-10-1-0-0-24"; + ResourceIdentifier firewallRuleResourceId = FirewallRuleResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + FirewallRuleResource firewallRule = client.GetFirewallRuleResource(firewallRuleResourceId); + + // invoke the operation + FirewallRuleData data = new FirewallRuleData + { + Properties = new FirewallRuleProperties + { + StartIPAddress = "10.0.0.0", + EndIPAddress = "10.0.0.255", + }, + }; + ArmOperation lro = await firewallRule.UpdateAsync(WaitUntil.Completed, data); + FirewallRuleResource 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 + FirewallRuleData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetCollection.cs new file mode 100644 index 000000000000..da1a1955775a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.DatabaseFleetManager.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_FleetsCreateOrUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_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 = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "production-fleet-01"; + FleetData data = new FleetData(new AzureLocation("East US")) + { + Properties = new FleetProperties + { + Description = "Production fleet for high availability and scalability.", + }, + Tags = +{ +["environment"] = "production", +["owner"] = "team-database" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetName, data); + FleetResource 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 + FleetData 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_FleetsGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "production-fleet-01"; + FleetResource result = await collection.GetAsync(fleetName); + + // 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 + FleetData 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_FleetsListByResourceGroupMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_ListByResourceGroup_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_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 = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation and iterate over the result + await foreach (FleetResource 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 + FleetData 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_FleetsGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "production-fleet-01"; + bool result = await collection.ExistsAsync(fleetName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_FleetsGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this FleetResource + FleetCollection collection = resourceGroupResource.GetFleets(); + + // invoke the operation + string fleetName = "production-fleet-01"; + NullableResponse response = await collection.GetIfExistsAsync(fleetName); + FleetResource 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 + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseCollection.cs new file mode 100644 index 000000000000..6a008639d091 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseCollection.cs @@ -0,0 +1,232 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetDatabaseCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateDatabaseInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation + string databaseName = "customer-db-prod"; + FleetDatabaseData data = new FleetDatabaseData + { + Properties = new FleetDatabaseProperties + { + CreateMode = DatabaseCreateMode.Default, + TierName = "Premium", + RestoreFromOn = DateTimeOffset.Parse("2024-11-06T09:16:05.048Z"), + SourceDatabaseName = "existing-db-prod", + ResourceTags = +{ +["project"] = "Customer Data" +}, + Identity = new IdentityProperties + { + IdentityType = IdentityType.None, + UserAssignedIdentities = {new DatabaseIdentity +{ +ResourceId = new ResourceIdentifier("/subscriptions/12345678-90ab-cdef-1234-567890abcdef/resourceGroups/rg-database-operations/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity-01"), +PrincipalId = Guid.Parse("a2b3c4d5-6789-0123-4567-89abcdef1234"), +ClientId = Guid.Parse("a2b3c4d5-6789-0123-4567-89abcdef1234"), +}}, + FederatedClientId = Guid.Parse("a2b3c4d5-6789-0123-4567-89abcdef1234"), + }, + TransparentDataEncryption = new TransparentDataEncryption + { + KeyUri = new Uri("https://keyvaultname.vault.azure.net/keys/myKey/12345"), + Keys = { "key1" }, + EnableAutoRotation = true, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseName, data); + FleetDatabaseResource 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 + FleetDatabaseData 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_RetrieveDatabaseDetailsInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation + string databaseName = "customer-db-prod"; + FleetDatabaseResource result = await collection.GetAsync(databaseName); + + // 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 + FleetDatabaseData 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_ListDatabasesInFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_ListByFleetspace_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_ListByFleetspace" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation and iterate over the result + await foreach (FleetDatabaseResource 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 + FleetDatabaseData 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_RetrieveDatabaseDetailsInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation + string databaseName = "customer-db-prod"; + bool result = await collection.ExistsAsync(databaseName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_RetrieveDatabaseDetailsInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // get the collection of this FleetDatabaseResource + FleetDatabaseCollection collection = fleetspace.GetFleetDatabases(); + + // invoke the operation + string databaseName = "customer-db-prod"; + NullableResponse response = await collection.GetIfExistsAsync(databaseName); + FleetDatabaseResource 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 + FleetDatabaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseResource.cs new file mode 100644 index 000000000000..37e47d452231 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetDatabaseResource.cs @@ -0,0 +1,236 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetDatabaseResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_RetrieveDatabaseDetailsInFleetGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + FleetDatabaseResource result = await fleetDatabase.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 + FleetDatabaseData 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_FleetDatabasesDeleteMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_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 FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + await fleetDatabase.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateDatabaseInFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Update_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabase_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 FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + string databaseName = "customer-database-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + FleetDatabaseData data = new FleetDatabaseData + { + Properties = new FleetDatabaseProperties + { + CreateMode = DatabaseCreateMode.Default, + TierName = "Standard", + RestoreFromOn = DateTimeOffset.Parse("2024-11-06T09:16:05.048Z"), + SourceDatabaseName = "customer-database-staging", + ResourceTags = +{ +["environment"] = "production", +["owner"] = "database-team" +}, + Identity = new IdentityProperties + { + IdentityType = IdentityType.UserAssigned, + UserAssignedIdentities = {new DatabaseIdentity +{ +ResourceId = new ResourceIdentifier("/subscriptions/C3897315-3847-4D8A-B2FC-7307B066AD63/resourcegroups/rgdatabasefleetmanager/providers/Microsoft.ManagedIdentity/userAssignedIdentities/db-identity"), +PrincipalId = Guid.Parse("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"), +ClientId = Guid.Parse("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"), +}}, + FederatedClientId = Guid.Parse("a2b3c4d5-6789-0123-4567-89abcdef1234"), + }, + TransparentDataEncryption = new TransparentDataEncryption + { + KeyUri = new Uri("https://keyvault-contoso.vault.azure.net/keys/db-encryption-key/abc123"), + Keys = { "abc123", "xyz789" }, + EnableAutoRotation = true, + }, + }, + }; + ArmOperation lro = await fleetDatabase.UpdateAsync(WaitUntil.Completed, data); + FleetDatabaseResource 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 + FleetDatabaseData 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 ChangeTier_ChangeDatabaseTierGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_ChangeTier_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabases_ChangeTier" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + DatabaseChangeTierProperties body = new DatabaseChangeTierProperties + { + TargetTierName = "Standard", + }; + await fleetDatabase.ChangeTierAsync(WaitUntil.Completed, body); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Rename_RenameDatabaseInFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Rename_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabases_Rename" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + DatabaseRenameProperties body = new DatabaseRenameProperties + { + NewName = "new-customer-db-prod", + }; + await fleetDatabase.RenameAsync(WaitUntil.Completed, body); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Revert_RevertTransparentDataEncryptionInDatabaseGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/FleetDatabases_Revert_MaximumSet_Gen.json + // this example is just showing the usage of "FleetDatabases_Revert" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetDatabaseResource created on azure + // for more information of creating FleetDatabaseResource, please refer to the document of FleetDatabaseResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-operations"; + string fleetName = "data-fleet-01"; + string fleetspaceName = "prod-environment"; + string databaseName = "customer-db-prod"; + ResourceIdentifier fleetDatabaseResourceId = FleetDatabaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + FleetDatabaseResource fleetDatabase = client.GetFleetDatabaseResource(fleetDatabaseResourceId); + + // invoke the operation + await fleetDatabase.RevertAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetResource.cs new file mode 100644 index 000000000000..89a408825e23 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetResource.cs @@ -0,0 +1,118 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FleetsGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet-01"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetResource result = await fleet.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 + FleetData 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_FleetsDeleteMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet-01"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + await fleet.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_FleetsUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_Update_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // invoke the operation + FleetPatch patch = new FleetPatch + { + Tags = +{ +["environment"] = "production", +["owner"] = "team-database" +}, + Properties = new FleetProperties + { + Description = "Fleet containing critical production databases and high availability configurations.", + }, + }; + ArmOperation lro = await fleet.UpdateAsync(WaitUntil.Completed, patch); + FleetResource 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 + FleetData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierCollection.cs new file mode 100644 index 000000000000..cd978d6286e0 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierCollection.cs @@ -0,0 +1,213 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetTierCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_FleetTiersCreateOrUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation + string tierName = "general-purpose-tier"; + FleetTierData data = new FleetTierData + { + Properties = new FleetTierProperties + { + Serverless = false, + Pooled = true, + ServiceTier = "GeneralPurpose", + Family = "Gen5", + Capacity = 4, + PoolNumOfDatabasesMax = 10, + HighAvailabilityReplicaCount = 5, + ZoneRedundancy = ZoneRedundancy.Disabled, + DatabaseCapacityMin = 0, + DatabaseCapacityMax = 4, + DatabaseSizeGbMax = 50, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, tierName, data); + FleetTierResource 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 + FleetTierData 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_FleetTiersGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation + string tierName = "general-purpose-tier"; + FleetTierResource result = await collection.GetAsync(tierName); + + // 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 + FleetTierData 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_FleetTiersListByFleetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_ListByFleet_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation and iterate over the result + await foreach (FleetTierResource 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 + FleetTierData 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_FleetTiersGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation + string tierName = "general-purpose-tier"; + bool result = await collection.ExistsAsync(tierName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_FleetTiersGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetTierResource + FleetTierCollection collection = fleet.GetFleetTiers(); + + // invoke the operation + string tierName = "general-purpose-tier"; + NullableResponse response = await collection.GetIfExistsAsync(tierName); + FleetTierResource 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 + FleetTierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierResource.cs new file mode 100644 index 000000000000..f087512991d3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetTierResource.cs @@ -0,0 +1,157 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetTierResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FleetTiersGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Get_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetTierResource created on azure + // for more information of creating FleetTierResource, please refer to the document of FleetTierResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + string tierName = "general-purpose-tier"; + ResourceIdentifier fleetTierResourceId = FleetTierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, tierName); + FleetTierResource fleetTier = client.GetFleetTierResource(fleetTierResourceId); + + // invoke the operation + FleetTierResource result = await fleetTier.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 + FleetTierData 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_FleetTiersDeleteMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_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 FleetTierResource created on azure + // for more information of creating FleetTierResource, please refer to the document of FleetTierResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + string tierName = "general-purpose-tier"; + ResourceIdentifier fleetTierResourceId = FleetTierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, tierName); + FleetTierResource fleetTier = client.GetFleetTierResource(fleetTierResourceId); + + // invoke the operation + await fleetTier.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_FleetTiersUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Update_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTier_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 FleetTierResource created on azure + // for more information of creating FleetTierResource, please refer to the document of FleetTierResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + string tierName = "general-purpose-tier"; + ResourceIdentifier fleetTierResourceId = FleetTierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, tierName); + FleetTierResource fleetTier = client.GetFleetTierResource(fleetTierResourceId); + + // invoke the operation + FleetTierData data = new FleetTierData + { + Properties = new FleetTierProperties + { + Serverless = false, + Pooled = true, + ServiceTier = "GeneralPurpose", + Family = "Gen5", + Capacity = 4, + PoolNumOfDatabasesMax = 10, + HighAvailabilityReplicaCount = 5, + ZoneRedundancy = ZoneRedundancy.Disabled, + DatabaseCapacityMin = 0, + DatabaseCapacityMax = 4, + DatabaseSizeGbMax = 50, + }, + }; + ArmOperation lro = await fleetTier.UpdateAsync(WaitUntil.Completed, data); + FleetTierResource 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 + FleetTierData 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 Disable_FleetTiersDisableMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/FleetTiers_Disable_MaximumSet_Gen.json + // this example is just showing the usage of "FleetTiers_Disable" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetTierResource created on azure + // for more information of creating FleetTierResource, please refer to the document of FleetTierResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "critical-production-fleet"; + string tierName = "general-purpose-tier"; + ResourceIdentifier fleetTierResourceId = FleetTierResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, tierName); + FleetTierResource fleetTier = client.GetFleetTierResource(fleetTierResourceId); + + // invoke the operation + FleetTierResource result = await fleetTier.DisableAsync(); + + // 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 + FleetTierData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceCollection.cs new file mode 100644 index 000000000000..a0888b0588bf --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceCollection.cs @@ -0,0 +1,211 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetspaceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreateOrUpdateFleetspaceGeneratedByPolicy() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_CreateOrUpdate_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_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 FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation + string fleetspaceName = "primary-space"; + FleetspaceData data = new FleetspaceData + { + Properties = new FleetspaceProperties + { + CapacityMax = 150000, + MainPrincipal = new MainPrincipal + { + Login = "adminUser", + ApplicationId = Guid.Parse("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"), + ObjectId = Guid.Parse("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"), + TenantId = Guid.Parse("bde45d44-ec42-45b8-a5a2-c5b998c65ef6"), + PrincipalType = PrincipalType.Application, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fleetspaceName, data); + FleetspaceResource 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 + FleetspaceData 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_FleetspacesGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation + string fleetspaceName = "primary-space"; + FleetspaceResource result = await collection.GetAsync(fleetspaceName); + + // 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 + FleetspaceData 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_FleetspacesListByFleetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_ListByFleet_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_ListByFleet" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation and iterate over the result + await foreach (FleetspaceResource 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 + FleetspaceData 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_FleetspacesGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation + string fleetspaceName = "primary-space"; + bool result = await collection.ExistsAsync(fleetspaceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_FleetspacesGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetResource created on azure + // for more information of creating FleetResource, please refer to the document of FleetResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + ResourceIdentifier fleetResourceId = FleetResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName); + FleetResource fleet = client.GetFleetResource(fleetResourceId); + + // get the collection of this FleetspaceResource + FleetspaceCollection collection = fleet.GetFleetspaces(); + + // invoke the operation + string fleetspaceName = "primary-space"; + NullableResponse response = await collection.GetIfExistsAsync(fleetspaceName); + FleetspaceResource 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 + FleetspaceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceResource.cs new file mode 100644 index 000000000000..210b86120dc8 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_FleetspaceResource.cs @@ -0,0 +1,186 @@ +// 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.DatabaseFleetManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Samples +{ + public partial class Sample_FleetspaceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_FleetspacesGetMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Get_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + FleetspaceResource result = await fleetspace.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 + FleetspaceData 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_FleetspacesDeleteMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rgdatabasefleetmanager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + await fleetspace.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_FleetspacesUpdateMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Update_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspace_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 FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + FleetspaceData data = new FleetspaceData + { + Properties = new FleetspaceProperties + { + CapacityMax = 150000, + MainPrincipal = new MainPrincipal + { + Login = "adminUser", + ApplicationId = Guid.Parse("d2d8b19e-c4f7-4c62-8e8d-7f0f96d94e39"), + ObjectId = Guid.Parse("f8b7c2d3-b9c4-4f3b-85cd-3d56c6e49f92"), + TenantId = Guid.Parse("bde45d44-ec42-45b8-a5a2-c5b998c65ef6"), + PrincipalType = PrincipalType.Application, + }, + }, + }; + ArmOperation lro = await fleetspace.UpdateAsync(WaitUntil.Completed, data); + FleetspaceResource 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 + FleetspaceData 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 RegisterServer_FleetspacesRegisterServerMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_RegisterServer_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspaces_RegisterServer" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + RegisterServerProperties body = new RegisterServerProperties + { + TierName = "Standard", + SourceSubscriptionId = "c76e2b32-46c7-4325-8f4f-476828a5b207", + SourceResourceGroupName = "rg-source-database", + SourceServerName = "source-db-server-prod", + DestinationTierOverrides = { new DestinationTierOverride(Models.ResourceType.Database, "bronze", "source-db-prod") }, + }; + await fleetspace.RegisterServerAsync(WaitUntil.Completed, body); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Unregister_FleetspacesUnregisterMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleetspaces_Unregister_MaximumSet_Gen.json + // this example is just showing the usage of "Fleetspaces_Unregister" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this FleetspaceResource created on azure + // for more information of creating FleetspaceResource, please refer to the document of FleetspaceResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + string resourceGroupName = "rg-database-fleet-manager"; + string fleetName = "production-fleet"; + string fleetspaceName = "primary-space"; + ResourceIdentifier fleetspaceResourceId = FleetspaceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + FleetspaceResource fleetspace = client.GetFleetspaceResource(fleetspaceResourceId); + + // invoke the operation + await fleetspace.UnregisterAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..3b8d32d2d723 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/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.DatabaseFleetManager.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetFleets_FleetsListMaximumSetGenGeneratedByMaximumSetRule() + { + // Generated from example definition: 2025-02-01-preview/Fleets_List_MaximumSet_Gen.json + // this example is just showing the usage of "Fleet_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "C3897315-3847-4D8A-B2FC-7307B066AD63"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (FleetResource item in subscriptionResource.GetFleetsAsync()) + { + // 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 + FleetData 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Azure.ResourceManager.DatabaseFleetManager.csproj b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Azure.ResourceManager.DatabaseFleetManager.csproj new file mode 100644 index 000000000000..2bb49547d2ac --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Azure.ResourceManager.DatabaseFleetManager.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider DatabaseFleetManager. + 1.0.0-beta.1 + azure;management;arm;resource manager;databasefleetmanager + Azure.ResourceManager.DatabaseFleetManager + + diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ArmDatabaseFleetManagerModelFactory.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ArmDatabaseFleetManagerModelFactory.cs new file mode 100644 index 000000000000..25d7a1bf677d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ArmDatabaseFleetManagerModelFactory.cs @@ -0,0 +1,220 @@ +// 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.DatabaseFleetManager.Models +{ + /// Model factory for models. + public static partial class ArmDatabaseFleetManagerModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Fleet database properties. + /// A new instance for mocking. + public static FleetDatabaseData FleetDatabaseData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, FleetDatabaseProperties properties = null) + { + return new FleetDatabaseData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Resource identifier for the underlying database resource. + /// Database state. + /// Create mode. Available options: Default - Create a database. Copy - Copy the source database (source database name must be specified) PointInTimeRestore - Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + /// Name of the tier this database belongs to. + /// Connection string to connect to the database with. + /// If true, database is recoverable. + /// Restore from time when CreateMode is PointInTimeRestore. + /// Earliest restore time. + /// Latest restore time. + /// Backup retention in days. + /// Maximum database size in Gb. + /// Source database name used when CreateMode is Copy or PointInTimeRestore. + /// Additional database properties to be applied as the underlying database resource tags. + /// Identity property. + /// Transparent Data Encryption properties. + /// Database collation. + /// A new instance for mocking. + public static FleetDatabaseProperties FleetDatabaseProperties(string originalDatabaseId = null, AzureProvisioningState? provisioningState = null, DatabaseCreateMode? createMode = null, string tierName = null, string connectionString = null, bool? recoverable = null, DateTimeOffset? restoreFromOn = null, DateTimeOffset? earliestRestoreOn = null, DateTimeOffset? latestRestoreOn = null, int? backupRetentionDays = null, int? databaseSizeGbMax = null, string sourceDatabaseName = null, IDictionary resourceTags = null, IdentityProperties identity = null, TransparentDataEncryption transparentDataEncryption = null, string collation = null) + { + resourceTags ??= new Dictionary(); + + return new FleetDatabaseProperties( + originalDatabaseId, + provisioningState, + createMode, + tierName, + connectionString, + recoverable, + restoreFromOn, + earliestRestoreOn, + latestRestoreOn, + backupRetentionDays, + databaseSizeGbMax, + sourceDatabaseName, + resourceTags, + identity, + transparentDataEncryption, + collation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Fleetspace properties. + /// A new instance for mocking. + public static FleetspaceData FleetspaceData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, FleetspaceProperties properties = null) + { + return new FleetspaceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Fleetspace state. + /// Maximum number of vCores database fleet manager is allowed to provision in the fleetspace. + /// Main Microsoft Entra ID principal that has admin access to all databases in the fleetspace. + /// A new instance for mocking. + public static FleetspaceProperties FleetspaceProperties(AzureProvisioningState? provisioningState = null, int? capacityMax = null, MainPrincipal mainPrincipal = null) + { + return new FleetspaceProperties(provisioningState, capacityMax, mainPrincipal, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The fleet properties. + /// A new instance for mocking. + public static FleetData FleetData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, FleetProperties properties = null) + { + tags ??= new Dictionary(); + + return new FleetData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Fleet description. + /// Provisioning state. + /// A new instance for mocking. + public static FleetProperties FleetProperties(string description = null, AzureProvisioningState? provisioningState = null) + { + return new FleetProperties(description, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Firewall rule properties. + /// A new instance for mocking. + public static FirewallRuleData FirewallRuleData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, FirewallRuleProperties properties = null) + { + return new FirewallRuleData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Start IP address. + /// End IP address. + /// Provisioning state. + /// A new instance for mocking. + public static FirewallRuleProperties FirewallRuleProperties(string startIPAddress = null, string endIPAddress = null, AzureProvisioningState? provisioningState = null) + { + return new FirewallRuleProperties(startIPAddress, endIPAddress, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Fleet tier properties. + /// A new instance for mocking. + public static FleetTierData FleetTierData(ResourceIdentifier id = null, string name = null, Core.ResourceType resourceType = default, SystemData systemData = null, FleetTierProperties properties = null) + { + return new FleetTierData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// If true, tier is disabled. + /// If true, serverless resources are provisioned in the tier. + /// If true, databases are pooled. + /// Service tier of provisioned resources. Supported values: GeneralPurpose, Hyperscale. + /// Family of provisioned resources, for example Gen5. + /// Capacity of provisioned resources in the tier, in units matching the specified service tier, for example vCore for GeneralPurpose. + /// Maximum number of databases per pool. + /// Number of high availability replicas for databases in this tier. + /// Enable zone redundancy for all databases in this tier. + /// Minimum allocated capacity per database, in units matching the specified service tier. + /// Maximum allocated capacity per database, in units matching the specified service tier. + /// Maximum database size in Gb. + /// Provisioning state. + /// A new instance for mocking. + public static FleetTierProperties FleetTierProperties(bool? disabled = null, bool? serverless = null, bool? pooled = null, string serviceTier = null, string family = null, int? capacity = null, int? poolNumOfDatabasesMax = null, int? highAvailabilityReplicaCount = null, ZoneRedundancy? zoneRedundancy = null, double? databaseCapacityMin = null, double? databaseCapacityMax = null, int? databaseSizeGbMax = null, AzureProvisioningState? provisioningState = null) + { + return new FleetTierProperties( + disabled, + serverless, + pooled, + serviceTier, + family, + capacity, + poolNumOfDatabasesMax, + highAvailabilityReplicaCount, + zoneRedundancy, + databaseCapacityMin, + databaseCapacityMax, + databaseSizeGbMax, + provisioningState, + serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/DatabaseFleetManagerExtensions.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/DatabaseFleetManagerExtensions.cs new file mode 100644 index 000000000000..e89a58848597 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/DatabaseFleetManagerExtensions.cs @@ -0,0 +1,295 @@ +// 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.DatabaseFleetManager.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// A class to add extension methods to Azure.ResourceManager.DatabaseFleetManager. + public static partial class DatabaseFleetManagerExtensions + { + private static MockableDatabaseFleetManagerArmClient GetMockableDatabaseFleetManagerArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableDatabaseFleetManagerArmClient(client0)); + } + + private static MockableDatabaseFleetManagerResourceGroupResource GetMockableDatabaseFleetManagerResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableDatabaseFleetManagerResourceGroupResource(client, resource.Id)); + } + + private static MockableDatabaseFleetManagerSubscriptionResource GetMockableDatabaseFleetManagerSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableDatabaseFleetManagerSubscriptionResource(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 FleetDatabaseResource GetFleetDatabaseResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFleetDatabaseResource(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 FleetspaceResource GetFleetspaceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFleetspaceResource(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 FleetResource GetFleetResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFleetResource(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 FirewallRuleResource GetFirewallRuleResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFirewallRuleResource(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 FleetTierResource GetFleetTierResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableDatabaseFleetManagerArmClient(client).GetFleetTierResource(id); + } + + /// + /// Gets a collection of FleetResources 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 FleetResources and their operations over a FleetResource. + public static FleetCollection GetFleets(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDatabaseFleetManagerResourceGroupResource(resourceGroupResource).GetFleets(); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the database fleet. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetFleetAsync(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableDatabaseFleetManagerResourceGroupResource(resourceGroupResource).GetFleetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Name of the database fleet. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetFleet(this ResourceGroupResource resourceGroupResource, string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableDatabaseFleetManagerResourceGroupResource(resourceGroupResource).GetFleet(fleetName, cancellationToken); + } + + /// + /// Gets all fleets in a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetFleetsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDatabaseFleetManagerSubscriptionResource(subscriptionResource).GetFleetsAsync(cancellationToken); + } + + /// + /// Gets all fleets in a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetFleets(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableDatabaseFleetManagerSubscriptionResource(subscriptionResource).GetFleets(cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerArmClient.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerArmClient.cs new file mode 100644 index 000000000000..c3c91294f345 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerArmClient.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableDatabaseFleetManagerArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableDatabaseFleetManagerArmClient() + { + } + + /// 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 MockableDatabaseFleetManagerArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableDatabaseFleetManagerArmClient(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 FleetDatabaseResource GetFleetDatabaseResource(ResourceIdentifier id) + { + FleetDatabaseResource.ValidateResourceId(id); + return new FleetDatabaseResource(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 FleetspaceResource GetFleetspaceResource(ResourceIdentifier id) + { + FleetspaceResource.ValidateResourceId(id); + return new FleetspaceResource(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 FleetResource GetFleetResource(ResourceIdentifier id) + { + FleetResource.ValidateResourceId(id); + return new FleetResource(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 FirewallRuleResource GetFirewallRuleResource(ResourceIdentifier id) + { + FirewallRuleResource.ValidateResourceId(id); + return new FirewallRuleResource(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 FleetTierResource GetFleetTierResource(ResourceIdentifier id) + { + FleetTierResource.ValidateResourceId(id); + return new FleetTierResource(Client, id); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerResourceGroupResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerResourceGroupResource.cs new file mode 100644 index 000000000000..85c1487077ff --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerResourceGroupResource.cs @@ -0,0 +1,105 @@ +// 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.DatabaseFleetManager.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableDatabaseFleetManagerResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableDatabaseFleetManagerResourceGroupResource() + { + } + + /// 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 MockableDatabaseFleetManagerResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of FleetResources in the ResourceGroupResource. + /// An object representing collection of FleetResources and their operations over a FleetResource. + public virtual FleetCollection GetFleets() + { + return GetCachedClient(client => new FleetCollection(client, Id)); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetAsync(string fleetName, CancellationToken cancellationToken = default) + { + return await GetFleets().GetAsync(fleetName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleet(string fleetName, CancellationToken cancellationToken = default) + { + return GetFleets().Get(fleetName, cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerSubscriptionResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerSubscriptionResource.cs new file mode 100644 index 000000000000..d5e0e2001ef8 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Extensions/MockableDatabaseFleetManagerSubscriptionResource.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableDatabaseFleetManagerSubscriptionResource : ArmResource + { + private ClientDiagnostics _fleetClientDiagnostics; + private FleetsRestOperations _fleetRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableDatabaseFleetManagerSubscriptionResource() + { + } + + /// 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 MockableDatabaseFleetManagerSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics FleetClientDiagnostics => _fleetClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetResource.ResourceType.Namespace, Diagnostics); + private FleetsRestOperations FleetRestClient => _fleetRestClient ??= new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(FleetResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets all fleets in a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetFleetsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FleetRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FleetRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), FleetClientDiagnostics, Pipeline, "MockableDatabaseFleetManagerSubscriptionResource.GetFleets", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all fleets in a subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_List + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetFleets(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => FleetRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => FleetRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), FleetClientDiagnostics, Pipeline, "MockableDatabaseFleetManagerSubscriptionResource.GetFleets", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleCollection.cs new file mode 100644 index 000000000000..bf8f48feaf7f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleCollection.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// 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 GetFirewallRules method from an instance of . + /// + public partial class FirewallRuleCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _firewallRuleClientDiagnostics; + private readonly FirewallRulesRestOperations _firewallRuleRestClient; + + /// Initializes a new instance of the class for mocking. + protected FirewallRuleCollection() + { + } + + /// 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 FirewallRuleCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _firewallRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FirewallRuleResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FirewallRuleResource.ResourceType, out string firewallRuleApiVersion); + _firewallRuleRestClient = new FirewallRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, firewallRuleApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetspaceResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the firewall rule. + /// The firewall rule object to create or update. + /// 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 firewallRuleName, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FirewallRuleOperationSource(Client), _firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the firewall rule. + /// The firewall rule object to create or update. + /// 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 firewallRuleName, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FirewallRuleOperationSource(Client), _firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.Get"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.Get"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all firewall rules in a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules + /// + /// + /// Operation Id + /// FirewallRule_ListByFleetspace + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _firewallRuleRestClient.CreateListByFleetspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _firewallRuleRestClient.CreateListByFleetspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FirewallRuleResource(Client, FirewallRuleData.DeserializeFirewallRuleData(e)), _firewallRuleClientDiagnostics, Pipeline, "FirewallRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all firewall rules in a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules + /// + /// + /// Operation Id + /// FirewallRule_ListByFleetspace + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _firewallRuleRestClient.CreateListByFleetspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _firewallRuleRestClient.CreateListByFleetspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FirewallRuleResource(Client, FirewallRuleData.DeserializeFirewallRuleData(e)), _firewallRuleClientDiagnostics, Pipeline, "FirewallRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.Exists"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.Exists"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleCollection.GetIfExists"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, firewallRuleName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.Serialization.cs new file mode 100644 index 000000000000..e00a36737d00 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FirewallRuleData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FirewallRuleData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FirewallRuleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FirewallRuleData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFirewallRuleData(document.RootElement, options); + } + + internal static FirewallRuleData DeserializeFirewallRuleData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FirewallRuleProperties properties = default; + ResourceIdentifier id = default; + string name = default; + Core.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 = FirewallRuleProperties.DeserializeFirewallRuleProperties(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 Core.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 FirewallRuleData( + 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(FirewallRuleData)} does not support writing '{options.Format}' format."); + } + } + + FirewallRuleData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFirewallRuleData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FirewallRuleData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.cs new file mode 100644 index 000000000000..6138a49804b9 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the FirewallRule data model. + /// A firewall rule. + /// + public partial class FirewallRuleData : 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 FirewallRuleData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Firewall rule properties. + /// Keeps track of any properties unknown to the library. + internal FirewallRuleData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, FirewallRuleProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A Firewall rule properties. + public FirewallRuleProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.Serialization.cs new file mode 100644 index 000000000000..57847384327f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.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.DatabaseFleetManager +{ + public partial class FirewallRuleResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FirewallRuleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FirewallRuleData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.cs new file mode 100644 index 000000000000..8486d098a7b3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FirewallRuleResource.cs @@ -0,0 +1,348 @@ +// 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.DatabaseFleetManager +{ + /// + /// A Class representing a FirewallRule 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 GetFirewallRuleResource method. + /// Otherwise you can get one from its parent resource using the GetFirewallRule method. + /// + public partial class FirewallRuleResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The fleetspaceName. + /// The firewallRuleName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _firewallRuleClientDiagnostics; + private readonly FirewallRulesRestOperations _firewallRuleRestClient; + private readonly FirewallRuleData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets/fleetspaces/firewallRules"; + + /// Initializes a new instance of the class for mocking. + protected FirewallRuleResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FirewallRuleResource(ArmClient client, FirewallRuleData 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 FirewallRuleResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _firewallRuleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string firewallRuleApiVersion); + _firewallRuleRestClient = new FirewallRulesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, firewallRuleApiVersion); +#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 FirewallRuleData 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 firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Get"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Get"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Delete"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Delete"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The firewall rule object to create or update. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Update"); + scope.Start(); + try + { + var response = await _firewallRuleRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FirewallRuleOperationSource(Client), _firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The firewall rule object to create or update. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _firewallRuleClientDiagnostics.CreateScope("FirewallRuleResource.Update"); + scope.Start(); + try + { + var response = _firewallRuleRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FirewallRuleOperationSource(Client), _firewallRuleClientDiagnostics, Pipeline, _firewallRuleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetCollection.cs new file mode 100644 index 000000000000..1657d527cedd --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetCollection.cs @@ -0,0 +1,500 @@ +// 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.DatabaseFleetManager +{ + /// + /// 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 GetFleets method from an instance of . + /// + public partial class FleetCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetClientDiagnostics; + private readonly FleetsRestOperations _fleetRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetCollection() + { + } + + /// 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 FleetCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetResource.ResourceType, out string fleetApiVersion); + _fleetRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the database fleet. + /// The fleet object to create or update. + /// 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 fleetName, FleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the database fleet. + /// The fleet object to create or update. + /// 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 fleetName, FleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, fleetName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Get"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Get"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all fleets in a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skip, top, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), _fleetClientDiagnostics, Pipeline, "FleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all fleets in a resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets + /// + /// + /// Operation Id + /// Fleet_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, skip, top, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetResource(Client, FleetData.DeserializeFleetData(e)), _fleetClientDiagnostics, Pipeline, "FleetCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.Exists"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database fleet. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fleetName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetResource(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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.Serialization.cs new file mode 100644 index 000000000000..19e4230b3ce6 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FleetData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetData(document.RootElement, options); + } + + internal static FleetData DeserializeFleetData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FleetProperties properties = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + Core.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 = FleetProperties.DeserializeFleetProperties(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 Core.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 FleetData( + 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(FleetData)} does not support writing '{options.Format}' format."); + } + } + + FleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.cs new file mode 100644 index 000000000000..b104bd126dd7 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the Fleet data model. + /// A Database Fleet. + /// + public partial class FleetData : 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 FleetData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The fleet properties. + /// Keeps track of any properties unknown to the library. + internal FleetData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, FleetProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetData() + { + } + + /// The fleet properties. + public FleetProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseCollection.cs new file mode 100644 index 000000000000..dec216d79917 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseCollection.cs @@ -0,0 +1,501 @@ +// 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.DatabaseFleetManager +{ + /// + /// 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 GetFleetDatabases method from an instance of . + /// + public partial class FleetDatabaseCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetDatabaseClientDiagnostics; + private readonly FleetDatabasesRestOperations _fleetDatabaseRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetDatabaseCollection() + { + } + + /// 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 FleetDatabaseCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetDatabaseClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetDatabaseResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetDatabaseResource.ResourceType, out string fleetDatabaseApiVersion); + _fleetDatabaseRestClient = new FleetDatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetDatabaseApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetspaceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetspaceResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the database. + /// The database object to create or update. + /// 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 databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetDatabaseOperationSource(Client), _fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the database. + /// The database object to create or update. + /// 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 databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetDatabaseOperationSource(Client), _fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.Get"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.Get"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all fleet databases in a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases + /// + /// + /// Operation Id + /// FleetDatabase_ListByFleetspace + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetDatabaseRestClient.CreateListByFleetspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, filter, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetDatabaseRestClient.CreateListByFleetspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, filter, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetDatabaseResource(Client, FleetDatabaseData.DeserializeFleetDatabaseData(e)), _fleetDatabaseClientDiagnostics, Pipeline, "FleetDatabaseCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all fleet databases in a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases + /// + /// + /// Operation Id + /// FleetDatabase_ListByFleetspace + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetDatabaseRestClient.CreateListByFleetspaceRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, filter, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetDatabaseRestClient.CreateListByFleetspaceNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, skip, top, filter, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetDatabaseResource(Client, FleetDatabaseData.DeserializeFleetDatabaseData(e)), _fleetDatabaseClientDiagnostics, Pipeline, "FleetDatabaseCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.Exists"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, databaseName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.Serialization.cs new file mode 100644 index 000000000000..3c81181ff6fc --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetDatabaseData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FleetDatabaseData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FleetDatabaseData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetDatabaseData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetDatabaseData(document.RootElement, options); + } + + internal static FleetDatabaseData DeserializeFleetDatabaseData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FleetDatabaseProperties properties = default; + ResourceIdentifier id = default; + string name = default; + Core.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 = FleetDatabaseProperties.DeserializeFleetDatabaseProperties(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 Core.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 FleetDatabaseData( + 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(FleetDatabaseData)} does not support writing '{options.Format}' format."); + } + } + + FleetDatabaseData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetDatabaseData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetDatabaseData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.cs new file mode 100644 index 000000000000..15a588a310a1 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the FleetDatabase data model. + /// A fleet database. + /// + public partial class FleetDatabaseData : 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 FleetDatabaseData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Fleet database properties. + /// Keeps track of any properties unknown to the library. + internal FleetDatabaseData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, FleetDatabaseProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Fleet database properties. + public FleetDatabaseProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.Serialization.cs new file mode 100644 index 000000000000..590f0c91cc98 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.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.DatabaseFleetManager +{ + public partial class FleetDatabaseResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetDatabaseData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetDatabaseData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.cs new file mode 100644 index 000000000000..78b41bfbae8f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetDatabaseResource.cs @@ -0,0 +1,617 @@ +// 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.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A Class representing a FleetDatabase 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 GetFleetDatabaseResource method. + /// Otherwise you can get one from its parent resource using the GetFleetDatabase method. + /// + public partial class FleetDatabaseResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The fleetspaceName. + /// The databaseName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetDatabaseClientDiagnostics; + private readonly FleetDatabasesRestOperations _fleetDatabaseRestClient; + private readonly FleetDatabaseData _data; + + /// Gets the resource type for the operations. + public static readonly Core.ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets/fleetspaces/databases"; + + /// Initializes a new instance of the class for mocking. + protected FleetDatabaseResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetDatabaseResource(ArmClient client, FleetDatabaseData 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 FleetDatabaseResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetDatabaseClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetDatabaseApiVersion); + _fleetDatabaseRestClient = new FleetDatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetDatabaseApiVersion); +#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 FleetDatabaseData 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 fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Get"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Get"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Delete"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Delete"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The database object to patch. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Update"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetDatabaseOperationSource(Client), _fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The database object to patch. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Update"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetDatabaseOperationSource(Client), _fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Moves database to a different tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/changeTier + /// + /// + /// Operation Id + /// FleetDatabases_ChangeTier + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The details of the change tier operation. + /// The cancellation token to use. + /// is null. + public virtual async Task ChangeTierAsync(WaitUntil waitUntil, DatabaseChangeTierProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.ChangeTier"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.ChangeTierAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateChangeTierRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Moves database to a different tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/changeTier + /// + /// + /// Operation Id + /// FleetDatabases_ChangeTier + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The details of the change tier operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation ChangeTier(WaitUntil waitUntil, DatabaseChangeTierProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.ChangeTier"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.ChangeTier(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateChangeTierRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Renames a database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/rename + /// + /// + /// Operation Id + /// FleetDatabases_Rename + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The details of the rename operation. + /// The cancellation token to use. + /// is null. + public virtual async Task RenameAsync(WaitUntil waitUntil, DatabaseRenameProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Rename"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.RenameAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateRenameRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Renames a database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/rename + /// + /// + /// Operation Id + /// FleetDatabases_Rename + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The details of the rename operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Rename(WaitUntil waitUntil, DatabaseRenameProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Rename"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Rename(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateRenameRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Revert a database transparent data encryption (TDE). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/revert + /// + /// + /// Operation Id + /// FleetDatabases_Revert + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task RevertAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Revert"); + scope.Start(); + try + { + var response = await _fleetDatabaseRestClient.RevertAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateRevertRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Revert a database transparent data encryption (TDE). + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName}/revert + /// + /// + /// Operation Id + /// FleetDatabases_Revert + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Revert(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetDatabaseClientDiagnostics.CreateScope("FleetDatabaseResource.Revert"); + scope.Start(); + try + { + var response = _fleetDatabaseRestClient.Revert(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetDatabaseClientDiagnostics, Pipeline, _fleetDatabaseRestClient.CreateRevertRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.Serialization.cs new file mode 100644 index 000000000000..7f71b89ec415 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.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.DatabaseFleetManager +{ + public partial class FleetResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.cs new file mode 100644 index 000000000000..d7a95ec075a5 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetResource.cs @@ -0,0 +1,845 @@ +// 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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A Class representing a Fleet 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 GetFleetResource method. + /// Otherwise you can get one from its parent resource using the GetFleet method. + /// + public partial class FleetResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetClientDiagnostics; + private readonly FleetsRestOperations _fleetRestClient; + private readonly FleetData _data; + + /// Gets the resource type for the operations. + public static readonly Core.ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets"; + + /// Initializes a new instance of the class for mocking. + protected FleetResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetResource(ArmClient client, FleetData 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 FleetResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetApiVersion); + _fleetRestClient = new FleetsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetApiVersion); +#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 FleetData 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 FleetspaceResources in the Fleet. + /// An object representing collection of FleetspaceResources and their operations over a FleetspaceResource. + public virtual FleetspaceCollection GetFleetspaces() + { + return GetCachedClient(client => new FleetspaceCollection(client, Id)); + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetspaceAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + return await GetFleetspaces().GetAsync(fleetspaceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetspace(string fleetspaceName, CancellationToken cancellationToken = default) + { + return GetFleetspaces().Get(fleetspaceName, cancellationToken); + } + + /// Gets a collection of FleetTierResources in the Fleet. + /// An object representing collection of FleetTierResources and their operations over a FleetTierResource. + public virtual FleetTierCollection GetFleetTiers() + { + return GetCachedClient(client => new FleetTierCollection(client, Id)); + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetTierAsync(string tierName, CancellationToken cancellationToken = default) + { + return await GetFleetTiers().GetAsync(tierName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetTier(string tierName, CancellationToken cancellationToken = default) + { + return GetFleetTiers().Get(tierName, cancellationToken); + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Get"); + scope.Start(); + try + { + var response = await _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Get"); + scope.Start(); + try + { + var response = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Delete"); + scope.Start(); + try + { + var response = await _fleetRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Delete"); + scope.Start(); + try + { + var response = _fleetRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetClientDiagnostics, Pipeline, _fleetRestClient.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; + } + } + + /// + /// Modifies a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The fleet object to patch. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Update"); + scope.Start(); + try + { + var response = await _fleetRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.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; + } + } + + /// + /// Modifies a fleet resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The fleet object to patch. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.Update"); + scope.Start(); + try + { + var response = _fleetRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetOperationSource(Client), _fleetClientDiagnostics, Pipeline, _fleetRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.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 _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.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 = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.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 _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FleetPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.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 = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FleetPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.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 _fleetRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new FleetPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName} + /// + /// + /// Operation Id + /// Fleet_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _fleetClientDiagnostics.CreateScope("FleetResource.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 = _fleetRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new FleetResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new FleetPatch(); + 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierCollection.cs new file mode 100644 index 000000000000..e7d8fffec97a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierCollection.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// 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 GetFleetTiers method from an instance of . + /// + public partial class FleetTierCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetTierClientDiagnostics; + private readonly FleetTiersRestOperations _fleetTierRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetTierCollection() + { + } + + /// 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 FleetTierCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetTierClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetTierResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetTierResource.ResourceType, out string fleetTierApiVersion); + _fleetTierRestClient = new FleetTiersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetTierApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the tier. + /// The tier object to create or update. + /// 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 tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetTierOperationSource(Client), _fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the tier. + /// The tier object to create or update. + /// 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 tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetTierRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetTierOperationSource(Client), _fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.Get"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.Get"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List tiers in a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers + /// + /// + /// Operation Id + /// FleetTier_ListByFleet + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetTierRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetTierRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetTierResource(Client, FleetTierData.DeserializeFleetTierData(e)), _fleetTierClientDiagnostics, Pipeline, "FleetTierCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List tiers in a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers + /// + /// + /// Operation Id + /// FleetTier_ListByFleet + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetTierRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetTierRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetTierResource(Client, FleetTierData.DeserializeFleetTierData(e)), _fleetTierClientDiagnostics, Pipeline, "FleetTierCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.Exists"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the tier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, tierName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.Serialization.cs new file mode 100644 index 000000000000..4ef11a28c117 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetTierData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FleetTierData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FleetTierData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetTierData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetTierData(document.RootElement, options); + } + + internal static FleetTierData DeserializeFleetTierData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FleetTierProperties properties = default; + ResourceIdentifier id = default; + string name = default; + Core.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 = FleetTierProperties.DeserializeFleetTierProperties(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 Core.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 FleetTierData( + 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(FleetTierData)} does not support writing '{options.Format}' format."); + } + } + + FleetTierData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetTierData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetTierData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.cs new file mode 100644 index 000000000000..b7d9416f249a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the FleetTier data model. + /// A SQL Database Fleet tier. + /// + public partial class FleetTierData : 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 FleetTierData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Fleet tier properties. + /// Keeps track of any properties unknown to the library. + internal FleetTierData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, FleetTierProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A Fleet tier properties. + public FleetTierProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.Serialization.cs new file mode 100644 index 000000000000..5e5e193cc976 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.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.DatabaseFleetManager +{ + public partial class FleetTierResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetTierData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetTierData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.cs new file mode 100644 index 000000000000..4b6723e281c2 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetTierResource.cs @@ -0,0 +1,423 @@ +// 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.DatabaseFleetManager +{ + /// + /// A Class representing a FleetTier 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 GetFleetTierResource method. + /// Otherwise you can get one from its parent resource using the GetFleetTier method. + /// + public partial class FleetTierResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The tierName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetTierClientDiagnostics; + private readonly FleetTiersRestOperations _fleetTierRestClient; + private readonly FleetTierData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets/tiers"; + + /// Initializes a new instance of the class for mocking. + protected FleetTierResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetTierResource(ArmClient client, FleetTierData 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 FleetTierResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetTierClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetTierApiVersion); + _fleetTierRestClient = new FleetTiersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetTierApiVersion); +#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 FleetTierData 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 tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Get"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.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 FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a tier resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Get"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Delete"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Delete"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.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; + } + } + + /// + /// Updates a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Update"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetTierOperationSource(Client), _fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.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; + } + } + + /// + /// Updates a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName} + /// + /// + /// Operation Id + /// FleetTier_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Update"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetTierOperationSource(Client), _fleetTierClientDiagnostics, Pipeline, _fleetTierRestClient.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; + } + } + + /// + /// Disables a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}/disable + /// + /// + /// Operation Id + /// FleetTiers_Disable + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> DisableAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Disable"); + scope.Start(); + try + { + var response = await _fleetTierRestClient.DisableAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Disables a tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/tiers/{tierName}/disable + /// + /// + /// Operation Id + /// FleetTiers_Disable + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Disable(CancellationToken cancellationToken = default) + { + using var scope = _fleetTierClientDiagnostics.CreateScope("FleetTierResource.Disable"); + scope.Start(); + try + { + var response = _fleetTierRestClient.Disable(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new FleetTierResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceCollection.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceCollection.cs new file mode 100644 index 000000000000..66e97247dfb7 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceCollection.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// 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 GetFleetspaces method from an instance of . + /// + public partial class FleetspaceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _fleetspaceClientDiagnostics; + private readonly FleetspacesRestOperations _fleetspaceRestClient; + + /// Initializes a new instance of the class for mocking. + protected FleetspaceCollection() + { + } + + /// 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 FleetspaceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetspaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", FleetspaceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(FleetspaceResource.ResourceType, out string fleetspaceApiVersion); + _fleetspaceRestClient = new FleetspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetspaceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != FleetResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, FleetResource.ResourceType), nameof(id)); + } + + /// + /// Creates or updates a fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the fleetspace. + /// The fleet object to create or update. + /// 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 fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetspaceOperationSource(Client), _fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates or updates a fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_CreateOrUpdate + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Name of the fleetspace. + /// The fleet object to create or update. + /// 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 fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetspaceOperationSource(Client), _fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.Get"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.Get"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists fleetspaces in a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces + /// + /// + /// Operation Id + /// Fleetspace_ListByFleet + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetspaceRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetspaceRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new FleetspaceResource(Client, FleetspaceData.DeserializeFleetspaceData(e)), _fleetspaceClientDiagnostics, Pipeline, "FleetspaceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists fleetspaces in a fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces + /// + /// + /// Operation Id + /// Fleetspace_ListByFleet + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _fleetspaceRestClient.CreateListByFleetRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _fleetspaceRestClient.CreateListByFleetNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, skip, top, skiptoken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new FleetspaceResource(Client, FleetspaceData.DeserializeFleetspaceData(e)), _fleetspaceClientDiagnostics, Pipeline, "FleetspaceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.Exists"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.Exists"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the fleetspace. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fleetspaceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.Serialization.cs new file mode 100644 index 000000000000..3e4bf7c0a4c6 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + public partial class FleetspaceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FleetspaceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + FleetspaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceData(document.RootElement, options); + } + + internal static FleetspaceData DeserializeFleetspaceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FleetspaceProperties properties = default; + ResourceIdentifier id = default; + string name = default; + Core.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 = FleetspaceProperties.DeserializeFleetspaceProperties(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 Core.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 FleetspaceData( + 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(FleetspaceData)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetspaceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.cs new file mode 100644 index 000000000000..ff1a45dd143b --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceData.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.DatabaseFleetManager.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A class representing the Fleetspace data model. + /// A fleetspace. + /// + public partial class FleetspaceData : 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 FleetspaceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// A Fleetspace properties. + /// Keeps track of any properties unknown to the library. + internal FleetspaceData(ResourceIdentifier id, string name, Core.ResourceType resourceType, SystemData systemData, FleetspaceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A Fleetspace properties. + public FleetspaceProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.Serialization.cs new file mode 100644 index 000000000000..b75fae2c086c --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.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.DatabaseFleetManager +{ + public partial class FleetspaceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + FleetspaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + FleetspaceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.cs new file mode 100644 index 000000000000..09866a232bc4 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/FleetspaceResource.cs @@ -0,0 +1,662 @@ +// 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.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + /// + /// A Class representing a Fleetspace 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 GetFleetspaceResource method. + /// Otherwise you can get one from its parent resource using the GetFleetspace method. + /// + public partial class FleetspaceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fleetName. + /// The fleetspaceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _fleetspaceClientDiagnostics; + private readonly FleetspacesRestOperations _fleetspaceRestClient; + private readonly FleetspaceData _data; + + /// Gets the resource type for the operations. + public static readonly Core.ResourceType ResourceType = "Microsoft.DatabaseFleetManager/fleets/fleetspaces"; + + /// Initializes a new instance of the class for mocking. + protected FleetspaceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal FleetspaceResource(ArmClient client, FleetspaceData 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 FleetspaceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _fleetspaceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.DatabaseFleetManager", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string fleetspaceApiVersion); + _fleetspaceRestClient = new FleetspacesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, fleetspaceApiVersion); +#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 FleetspaceData 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 FleetDatabaseResources in the Fleetspace. + /// An object representing collection of FleetDatabaseResources and their operations over a FleetDatabaseResource. + public virtual FleetDatabaseCollection GetFleetDatabases() + { + return GetCachedClient(client => new FleetDatabaseCollection(client, Id)); + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFleetDatabaseAsync(string databaseName, CancellationToken cancellationToken = default) + { + return await GetFleetDatabases().GetAsync(databaseName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a fleet database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/databases/{databaseName} + /// + /// + /// Operation Id + /// FleetDatabase_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the database. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFleetDatabase(string databaseName, CancellationToken cancellationToken = default) + { + return GetFleetDatabases().Get(databaseName, cancellationToken); + } + + /// Gets a collection of FirewallRuleResources in the Fleetspace. + /// An object representing collection of FirewallRuleResources and their operations over a FirewallRuleResource. + public virtual FirewallRuleCollection GetFirewallRules() + { + return GetCachedClient(client => new FirewallRuleCollection(client, Id)); + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetFirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + return await GetFirewallRules().GetAsync(firewallRuleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// FirewallRule_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Name of the firewall rule. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetFirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) + { + return GetFirewallRules().Get(firewallRuleName, cancellationToken); + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Get"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.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 FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Get + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Get"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new FleetspaceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Delete"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a fleetspace. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Delete + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Delete"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.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; + } + } + + /// + /// Modifies a fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Update"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(new FleetspaceOperationSource(Client), _fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.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; + } + } + + /// + /// Modifies a fleetspace resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName} + /// + /// + /// Operation Id + /// Fleetspace_Update + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The resource properties to be updated. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Update"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(new FleetspaceOperationSource(Client), _fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.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; + } + } + + /// + /// Migrates an existing logical server into fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/registerServer + /// + /// + /// Operation Id + /// Fleetspaces_RegisterServer + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The details of the register server operation. + /// The cancellation token to use. + /// is null. + public virtual async Task RegisterServerAsync(WaitUntil waitUntil, RegisterServerProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.RegisterServer"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.RegisterServerAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateRegisterServerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Migrates an existing logical server into fleet. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/registerServer + /// + /// + /// Operation Id + /// Fleetspaces_RegisterServer + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The details of the register server operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation RegisterServer(WaitUntil waitUntil, RegisterServerProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.RegisterServer"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.RegisterServer(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateRegisterServerRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Unregisters all databases from a fleetspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/unregister + /// + /// + /// Operation Id + /// Fleetspaces_Unregister + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task UnregisterAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Unregister"); + scope.Start(); + try + { + var response = await _fleetspaceRestClient.UnregisterAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateUnregisterRequest(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; + } + } + + /// + /// Unregisters all databases from a fleetspace + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DatabaseFleetManager/fleets/{fleetName}/fleetspaces/{fleetspaceName}/unregister + /// + /// + /// Operation Id + /// Fleetspaces_Unregister + /// + /// + /// Default Api Version + /// 2025-02-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Unregister(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _fleetspaceClientDiagnostics.CreateScope("FleetspaceResource.Unregister"); + scope.Start(); + try + { + var response = _fleetspaceRestClient.Unregister(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new DatabaseFleetManagerArmOperation(_fleetspaceClientDiagnostics, Pipeline, _fleetspaceRestClient.CreateUnregisterRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Argument.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..0c8e7b17a1cd --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/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.DatabaseFleetManager +{ + 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..240180f8f8a5 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/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.DatabaseFleetManager +{ + 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingList.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..f5a2dd110e6e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/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.DatabaseFleetManager +{ + 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..cf58591ad508 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/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.DatabaseFleetManager +{ + 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Optional.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..c0a6938f59ff --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/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.DatabaseFleetManager +{ + 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..39c287294c4d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/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.DatabaseFleetManager +{ + 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperation.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperation.cs new file mode 100644 index 000000000000..6fd3fa7a1c7a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperation.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.DatabaseFleetManager +{ +#pragma warning disable SA1649 // File name should match first type name + internal class DatabaseFleetManagerArmOperation : 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 DatabaseFleetManagerArmOperation for mocking. + protected DatabaseFleetManagerArmOperation() + { + } + + internal DatabaseFleetManagerArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal DatabaseFleetManagerArmOperation(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, "DatabaseFleetManagerArmOperation", 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperationOfT.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperationOfT.cs new file mode 100644 index 000000000000..86c5d39dd20e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/DatabaseFleetManagerArmOperationOfT.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.DatabaseFleetManager +{ +#pragma warning disable SA1649 // File name should match first type name + internal class DatabaseFleetManagerArmOperation : 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 DatabaseFleetManagerArmOperation for mocking. + protected DatabaseFleetManagerArmOperation() + { + } + + internal DatabaseFleetManagerArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal DatabaseFleetManagerArmOperation(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, "DatabaseFleetManagerArmOperation", 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FirewallRuleOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FirewallRuleOperationSource.cs new file mode 100644 index 000000000000..2604858bfca6 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FirewallRuleOperationSource.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.DatabaseFleetManager +{ + internal class FirewallRuleOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FirewallRuleOperationSource(ArmClient client) + { + _client = client; + } + + FirewallRuleResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FirewallRuleResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FirewallRuleResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetDatabaseOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetDatabaseOperationSource.cs new file mode 100644 index 000000000000..cf70c4e315a0 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetDatabaseOperationSource.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.DatabaseFleetManager +{ + internal class FleetDatabaseOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetDatabaseOperationSource(ArmClient client) + { + _client = client; + } + + FleetDatabaseResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FleetDatabaseResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FleetDatabaseResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetOperationSource.cs new file mode 100644 index 000000000000..7838c8a79c8a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetOperationSource.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.DatabaseFleetManager +{ + internal class FleetOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetOperationSource(ArmClient client) + { + _client = client; + } + + FleetResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FleetResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FleetResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetTierOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetTierOperationSource.cs new file mode 100644 index 000000000000..4067f6ded8bc --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetTierOperationSource.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.DatabaseFleetManager +{ + internal class FleetTierOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetTierOperationSource(ArmClient client) + { + _client = client; + } + + FleetTierResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FleetTierResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FleetTierResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetspaceOperationSource.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetspaceOperationSource.cs new file mode 100644 index 000000000000..cd5e26bb8eee --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/LongRunningOperation/FleetspaceOperationSource.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.DatabaseFleetManager +{ + internal class FleetspaceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal FleetspaceOperationSource(ArmClient client) + { + _client = client; + } + + FleetspaceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new FleetspaceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new FleetspaceResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/AzureProvisioningState.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/AzureProvisioningState.cs new file mode 100644 index 000000000000..c073fa2c2d75 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/AzureProvisioningState.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.DatabaseFleetManager.Models +{ + /// The provisioning state of the resource. + public readonly partial struct AzureProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureProvisioningState(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"; + private const string AcceptedValue = "Accepted"; + + /// Resource has been created. + public static AzureProvisioningState Succeeded { get; } = new AzureProvisioningState(SucceededValue); + /// Resource creation failed. + public static AzureProvisioningState Failed { get; } = new AzureProvisioningState(FailedValue); + /// Resource creation was canceled. + public static AzureProvisioningState Canceled { get; } = new AzureProvisioningState(CanceledValue); + /// Resource is provisioning. + public static AzureProvisioningState Provisioning { get; } = new AzureProvisioningState(ProvisioningValue); + /// Request on the resource has been accepted. + public static AzureProvisioningState Accepted { get; } = new AzureProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(AzureProvisioningState left, AzureProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureProvisioningState left, AzureProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureProvisioningState(string value) => new AzureProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureProvisioningState other && Equals(other); + /// + public bool Equals(AzureProvisioningState 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.Serialization.cs new file mode 100644 index 000000000000..32e011095089 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class DatabaseChangeTierProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DatabaseChangeTierProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TargetTierName)) + { + writer.WritePropertyName("targetTierName"u8); + writer.WriteStringValue(TargetTierName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + DatabaseChangeTierProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseChangeTierProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseChangeTierProperties(document.RootElement, options); + } + + internal static DatabaseChangeTierProperties DeserializeDatabaseChangeTierProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string targetTierName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetTierName"u8)) + { + targetTierName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseChangeTierProperties(targetTierName, serializedAdditionalRawData); + } + + BinaryData 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(DatabaseChangeTierProperties)} does not support writing '{options.Format}' format."); + } + } + + DatabaseChangeTierProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDatabaseChangeTierProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseChangeTierProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.cs new file mode 100644 index 000000000000..8a70c7397149 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseChangeTierProperties.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.DatabaseFleetManager.Models +{ + /// A database change tier definition. + public partial class DatabaseChangeTierProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DatabaseChangeTierProperties() + { + } + + /// Initializes a new instance of . + /// A target tier name. + /// Keeps track of any properties unknown to the library. + internal DatabaseChangeTierProperties(string targetTierName, IDictionary serializedAdditionalRawData) + { + TargetTierName = targetTierName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// A target tier name. + public string TargetTierName { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseCreateMode.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseCreateMode.cs new file mode 100644 index 000000000000..cc3388d3483e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseCreateMode.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.DatabaseFleetManager.Models +{ + /// Create mode. Available options: Default - Create a database. Copy - Copy the source database (source database name must be specified) PointInTimeRestore - Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + public readonly partial struct DatabaseCreateMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DatabaseCreateMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DefaultValue = "Default"; + private const string CopyValue = "Copy"; + private const string PointInTimeRestoreValue = "PointInTimeRestore"; + + /// Create a database. + public static DatabaseCreateMode Default { get; } = new DatabaseCreateMode(DefaultValue); + /// Copy the source database (source database name must be specified). + public static DatabaseCreateMode Copy { get; } = new DatabaseCreateMode(CopyValue); + /// Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + public static DatabaseCreateMode PointInTimeRestore { get; } = new DatabaseCreateMode(PointInTimeRestoreValue); + /// Determines if two values are the same. + public static bool operator ==(DatabaseCreateMode left, DatabaseCreateMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DatabaseCreateMode left, DatabaseCreateMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DatabaseCreateMode(string value) => new DatabaseCreateMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DatabaseCreateMode other && Equals(other); + /// + public bool Equals(DatabaseCreateMode 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.Serialization.cs new file mode 100644 index 000000000000..ebd6446153b4 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.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.DatabaseFleetManager.Models +{ + public partial class DatabaseIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DatabaseIdentity)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + if (Optional.IsDefined(PrincipalId)) + { + writer.WritePropertyName("principalId"u8); + writer.WriteStringValue(PrincipalId.Value); + } + if (Optional.IsDefined(ClientId)) + { + writer.WritePropertyName("clientId"u8); + writer.WriteStringValue(ClientId.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 + } + } + } + + DatabaseIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseIdentity(document.RootElement, options); + } + + internal static DatabaseIdentity DeserializeDatabaseIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier resourceId = default; + Guid? principalId = default; + Guid? clientId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("principalId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("clientId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clientId = property.Value.GetGuid(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseIdentity(resourceId, principalId, clientId, serializedAdditionalRawData); + } + + BinaryData 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(DatabaseIdentity)} does not support writing '{options.Format}' format."); + } + } + + DatabaseIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDatabaseIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.cs new file mode 100644 index 000000000000..67808bbeb8a3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseIdentity.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Database Identity properties. + public partial class DatabaseIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DatabaseIdentity() + { + } + + /// Initializes a new instance of . + /// Resource Id of the database identity. + /// Principal Id of the database identity. + /// Client Id of the database identity. + /// Keeps track of any properties unknown to the library. + internal DatabaseIdentity(ResourceIdentifier resourceId, Guid? principalId, Guid? clientId, IDictionary serializedAdditionalRawData) + { + ResourceId = resourceId; + PrincipalId = principalId; + ClientId = clientId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource Id of the database identity. + public ResourceIdentifier ResourceId { get; set; } + /// Principal Id of the database identity. + public Guid? PrincipalId { get; set; } + /// Client Id of the database identity. + public Guid? ClientId { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.Serialization.cs new file mode 100644 index 000000000000..4f6679d545d3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class DatabaseRenameProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DatabaseRenameProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NewName)) + { + writer.WritePropertyName("newName"u8); + writer.WriteStringValue(NewName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + DatabaseRenameProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseRenameProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseRenameProperties(document.RootElement, options); + } + + internal static DatabaseRenameProperties DeserializeDatabaseRenameProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string newName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("newName"u8)) + { + newName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseRenameProperties(newName, serializedAdditionalRawData); + } + + BinaryData 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(DatabaseRenameProperties)} does not support writing '{options.Format}' format."); + } + } + + DatabaseRenameProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDatabaseRenameProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseRenameProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.cs new file mode 100644 index 000000000000..214a1aebc3b1 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DatabaseRenameProperties.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.DatabaseFleetManager.Models +{ + /// A database rename definition. + public partial class DatabaseRenameProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DatabaseRenameProperties() + { + } + + /// Initializes a new instance of . + /// New database name. + /// Keeps track of any properties unknown to the library. + internal DatabaseRenameProperties(string newName, IDictionary serializedAdditionalRawData) + { + NewName = newName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// New database name. + public string NewName { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.Serialization.cs new file mode 100644 index 000000000000..d4b3b7c69463 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class DestinationTierOverride : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DestinationTierOverride)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType.ToString()); + writer.WritePropertyName("tierName"u8); + writer.WriteStringValue(TierName); + writer.WritePropertyName("resourceName"u8); + writer.WriteStringValue(ResourceName); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + DestinationTierOverride IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DestinationTierOverride)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDestinationTierOverride(document.RootElement, options); + } + + internal static DestinationTierOverride DeserializeDestinationTierOverride(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceType resourceType = default; + string tierName = default; + string resourceName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType"u8)) + { + resourceType = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("tierName"u8)) + { + tierName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceName"u8)) + { + resourceName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DestinationTierOverride(resourceType, tierName, resourceName, serializedAdditionalRawData); + } + + BinaryData 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(DestinationTierOverride)} does not support writing '{options.Format}' format."); + } + } + + DestinationTierOverride IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDestinationTierOverride(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DestinationTierOverride)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.cs new file mode 100644 index 000000000000..57d6395ac192 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/DestinationTierOverride.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; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A destination tier override. + public partial class DestinationTierOverride + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Resource type. + /// Destination tier name. + /// Resource name. + /// or is null. + public DestinationTierOverride(ResourceType resourceType, string tierName, string resourceName) + { + Argument.AssertNotNull(tierName, nameof(tierName)); + Argument.AssertNotNull(resourceName, nameof(resourceName)); + + ResourceType = resourceType; + TierName = tierName; + ResourceName = resourceName; + } + + /// Initializes a new instance of . + /// Resource type. + /// Destination tier name. + /// Resource name. + /// Keeps track of any properties unknown to the library. + internal DestinationTierOverride(ResourceType resourceType, string tierName, string resourceName, IDictionary serializedAdditionalRawData) + { + ResourceType = resourceType; + TierName = tierName; + ResourceName = resourceName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DestinationTierOverride() + { + } + + /// Resource type. + public ResourceType ResourceType { get; } + /// Destination tier name. + public string TierName { get; } + /// Resource name. + public string ResourceName { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.Serialization.cs new file mode 100644 index 000000000000..ccd82bf73663 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.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.DatabaseFleetManager.Models +{ + internal partial class FirewallRuleListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FirewallRuleListResult)} 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 + } + } + } + + FirewallRuleListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FirewallRuleListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFirewallRuleListResult(document.RootElement, options); + } + + internal static FirewallRuleListResult DeserializeFirewallRuleListResult(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(FirewallRuleData.DeserializeFirewallRuleData(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 FirewallRuleListResult(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(FirewallRuleListResult)} does not support writing '{options.Format}' format."); + } + } + + FirewallRuleListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFirewallRuleListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FirewallRuleListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.cs new file mode 100644 index 000000000000..fac7d86244ec --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleListResult.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.DatabaseFleetManager.Models +{ + /// The response of a FirewallRule list operation. + internal partial class FirewallRuleListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 FirewallRule items on this page. + /// is null. + internal FirewallRuleListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FirewallRule items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FirewallRuleListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FirewallRuleListResult() + { + } + + /// The FirewallRule items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.Serialization.cs new file mode 100644 index 000000000000..ba54c2d1e5c3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.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.DatabaseFleetManager.Models +{ + public partial class FirewallRuleProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FirewallRuleProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(StartIPAddress)) + { + writer.WritePropertyName("startIpAddress"u8); + writer.WriteStringValue(StartIPAddress); + } + if (Optional.IsDefined(EndIPAddress)) + { + writer.WritePropertyName("endIpAddress"u8); + writer.WriteStringValue(EndIPAddress); + } + 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 + } + } + } + + FirewallRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FirewallRuleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFirewallRuleProperties(document.RootElement, options); + } + + internal static FirewallRuleProperties DeserializeFirewallRuleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string startIPAddress = default; + string endIPAddress = default; + AzureProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startIpAddress"u8)) + { + startIPAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("endIpAddress"u8)) + { + endIPAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FirewallRuleProperties(startIPAddress, endIPAddress, 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(FirewallRuleProperties)} does not support writing '{options.Format}' format."); + } + } + + FirewallRuleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFirewallRuleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FirewallRuleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.cs new file mode 100644 index 000000000000..2bf604d4345e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FirewallRuleProperties.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.DatabaseFleetManager.Models +{ + /// A Firewall rule properties. + public partial class FirewallRuleProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 FirewallRuleProperties() + { + } + + /// Initializes a new instance of . + /// Start IP address. + /// End IP address. + /// Provisioning state. + /// Keeps track of any properties unknown to the library. + internal FirewallRuleProperties(string startIPAddress, string endIPAddress, AzureProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + StartIPAddress = startIPAddress; + EndIPAddress = endIPAddress; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Start IP address. + public string StartIPAddress { get; set; } + /// End IP address. + public string EndIPAddress { get; set; } + /// Provisioning state. + public AzureProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.Serialization.cs new file mode 100644 index 000000000000..192ef03dca0b --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.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.DatabaseFleetManager.Models +{ + internal partial class FleetDatabaseListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FleetDatabaseListResult)} 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 + } + } + } + + FleetDatabaseListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetDatabaseListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetDatabaseListResult(document.RootElement, options); + } + + internal static FleetDatabaseListResult DeserializeFleetDatabaseListResult(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(FleetDatabaseData.DeserializeFleetDatabaseData(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 FleetDatabaseListResult(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(FleetDatabaseListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetDatabaseListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetDatabaseListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetDatabaseListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.cs new file mode 100644 index 000000000000..94d3204d6a4e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseListResult.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.DatabaseFleetManager.Models +{ + /// The response of a FleetDatabase list operation. + internal partial class FleetDatabaseListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 FleetDatabase items on this page. + /// is null. + internal FleetDatabaseListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FleetDatabase items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetDatabaseListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetDatabaseListResult() + { + } + + /// The FleetDatabase items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.Serialization.cs new file mode 100644 index 000000000000..e94d8f475a9d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.Serialization.cs @@ -0,0 +1,366 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.DatabaseFleetManager.Models +{ + public partial class FleetDatabaseProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FleetDatabaseProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(OriginalDatabaseId)) + { + writer.WritePropertyName("originalDatabaseId"u8); + writer.WriteStringValue(OriginalDatabaseId); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(CreateMode)) + { + writer.WritePropertyName("createMode"u8); + writer.WriteStringValue(CreateMode.Value.ToString()); + } + if (Optional.IsDefined(TierName)) + { + writer.WritePropertyName("tierName"u8); + writer.WriteStringValue(TierName); + } + if (options.Format != "W" && Optional.IsDefined(ConnectionString)) + { + writer.WritePropertyName("connectionString"u8); + writer.WriteStringValue(ConnectionString); + } + if (options.Format != "W" && Optional.IsDefined(Recoverable)) + { + writer.WritePropertyName("recoverable"u8); + writer.WriteBooleanValue(Recoverable.Value); + } + if (Optional.IsDefined(RestoreFromOn)) + { + writer.WritePropertyName("restoreFromTime"u8); + writer.WriteStringValue(RestoreFromOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(EarliestRestoreOn)) + { + writer.WritePropertyName("earliestRestoreTime"u8); + writer.WriteStringValue(EarliestRestoreOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LatestRestoreOn)) + { + writer.WritePropertyName("latestRestoreTime"u8); + writer.WriteStringValue(LatestRestoreOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(BackupRetentionDays)) + { + writer.WritePropertyName("backupRetentionDays"u8); + writer.WriteNumberValue(BackupRetentionDays.Value); + } + if (options.Format != "W" && Optional.IsDefined(DatabaseSizeGbMax)) + { + writer.WritePropertyName("databaseSizeGbMax"u8); + writer.WriteNumberValue(DatabaseSizeGbMax.Value); + } + if (Optional.IsDefined(SourceDatabaseName)) + { + writer.WritePropertyName("sourceDatabaseName"u8); + writer.WriteStringValue(SourceDatabaseName); + } + if (Optional.IsCollectionDefined(ResourceTags)) + { + writer.WritePropertyName("resourceTags"u8); + writer.WriteStartObject(); + foreach (var item in ResourceTags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + if (Optional.IsDefined(TransparentDataEncryption)) + { + writer.WritePropertyName("transparentDataEncryption"u8); + writer.WriteObjectValue(TransparentDataEncryption, options); + } + if (Optional.IsDefined(Collation)) + { + writer.WritePropertyName("collation"u8); + writer.WriteStringValue(Collation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + FleetDatabaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetDatabaseProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetDatabaseProperties(document.RootElement, options); + } + + internal static FleetDatabaseProperties DeserializeFleetDatabaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string originalDatabaseId = default; + AzureProvisioningState? provisioningState = default; + DatabaseCreateMode? createMode = default; + string tierName = default; + string connectionString = default; + bool? recoverable = default; + DateTimeOffset? restoreFromTime = default; + DateTimeOffset? earliestRestoreTime = default; + DateTimeOffset? latestRestoreTime = default; + int? backupRetentionDays = default; + int? databaseSizeGbMax = default; + string sourceDatabaseName = default; + IDictionary resourceTags = default; + IdentityProperties identity = default; + TransparentDataEncryption transparentDataEncryption = default; + string collation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("originalDatabaseId"u8)) + { + originalDatabaseId = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("createMode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createMode = new DatabaseCreateMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("tierName"u8)) + { + tierName = property.Value.GetString(); + continue; + } + if (property.NameEquals("connectionString"u8)) + { + connectionString = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoverable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoverable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("restoreFromTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + restoreFromTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("earliestRestoreTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + earliestRestoreTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("latestRestoreTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + latestRestoreTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("backupRetentionDays"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + backupRetentionDays = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("databaseSizeGbMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseSizeGbMax = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sourceDatabaseName"u8)) + { + sourceDatabaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceTags"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()); + } + resourceTags = dictionary; + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = IdentityProperties.DeserializeIdentityProperties(property.Value, options); + continue; + } + if (property.NameEquals("transparentDataEncryption"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + transparentDataEncryption = TransparentDataEncryption.DeserializeTransparentDataEncryption(property.Value, options); + continue; + } + if (property.NameEquals("collation"u8)) + { + collation = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetDatabaseProperties( + originalDatabaseId, + provisioningState, + createMode, + tierName, + connectionString, + recoverable, + restoreFromTime, + earliestRestoreTime, + latestRestoreTime, + backupRetentionDays, + databaseSizeGbMax, + sourceDatabaseName, + resourceTags ?? new ChangeTrackingDictionary(), + identity, + transparentDataEncryption, + collation, + serializedAdditionalRawData); + } + + BinaryData 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(FleetDatabaseProperties)} does not support writing '{options.Format}' format."); + } + } + + FleetDatabaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetDatabaseProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetDatabaseProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.cs new file mode 100644 index 000000000000..f9af6806a77c --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetDatabaseProperties.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Fleet database properties. + public partial class FleetDatabaseProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 FleetDatabaseProperties() + { + ResourceTags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource identifier for the underlying database resource. + /// Database state. + /// Create mode. Available options: Default - Create a database. Copy - Copy the source database (source database name must be specified) PointInTimeRestore - Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + /// Name of the tier this database belongs to. + /// Connection string to connect to the database with. + /// If true, database is recoverable. + /// Restore from time when CreateMode is PointInTimeRestore. + /// Earliest restore time. + /// Latest restore time. + /// Backup retention in days. + /// Maximum database size in Gb. + /// Source database name used when CreateMode is Copy or PointInTimeRestore. + /// Additional database properties to be applied as the underlying database resource tags. + /// Identity property. + /// Transparent Data Encryption properties. + /// Database collation. + /// Keeps track of any properties unknown to the library. + internal FleetDatabaseProperties(string originalDatabaseId, AzureProvisioningState? provisioningState, DatabaseCreateMode? createMode, string tierName, string connectionString, bool? recoverable, DateTimeOffset? restoreFromOn, DateTimeOffset? earliestRestoreOn, DateTimeOffset? latestRestoreOn, int? backupRetentionDays, int? databaseSizeGbMax, string sourceDatabaseName, IDictionary resourceTags, IdentityProperties identity, TransparentDataEncryption transparentDataEncryption, string collation, IDictionary serializedAdditionalRawData) + { + OriginalDatabaseId = originalDatabaseId; + ProvisioningState = provisioningState; + CreateMode = createMode; + TierName = tierName; + ConnectionString = connectionString; + Recoverable = recoverable; + RestoreFromOn = restoreFromOn; + EarliestRestoreOn = earliestRestoreOn; + LatestRestoreOn = latestRestoreOn; + BackupRetentionDays = backupRetentionDays; + DatabaseSizeGbMax = databaseSizeGbMax; + SourceDatabaseName = sourceDatabaseName; + ResourceTags = resourceTags; + Identity = identity; + TransparentDataEncryption = transparentDataEncryption; + Collation = collation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource identifier for the underlying database resource. + public string OriginalDatabaseId { get; } + /// Database state. + public AzureProvisioningState? ProvisioningState { get; } + /// Create mode. Available options: Default - Create a database. Copy - Copy the source database (source database name must be specified) PointInTimeRestore - Create a database by restoring source database from a point in time (source database name and restore from time must be specified). + public DatabaseCreateMode? CreateMode { get; set; } + /// Name of the tier this database belongs to. + public string TierName { get; set; } + /// Connection string to connect to the database with. + public string ConnectionString { get; } + /// If true, database is recoverable. + public bool? Recoverable { get; } + /// Restore from time when CreateMode is PointInTimeRestore. + public DateTimeOffset? RestoreFromOn { get; set; } + /// Earliest restore time. + public DateTimeOffset? EarliestRestoreOn { get; } + /// Latest restore time. + public DateTimeOffset? LatestRestoreOn { get; } + /// Backup retention in days. + public int? BackupRetentionDays { get; } + /// Maximum database size in Gb. + public int? DatabaseSizeGbMax { get; } + /// Source database name used when CreateMode is Copy or PointInTimeRestore. + public string SourceDatabaseName { get; set; } + /// Additional database properties to be applied as the underlying database resource tags. + public IDictionary ResourceTags { get; } + /// Identity property. + public IdentityProperties Identity { get; set; } + /// Transparent Data Encryption properties. + public TransparentDataEncryption TransparentDataEncryption { get; set; } + /// Database collation. + public string Collation { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.Serialization.cs new file mode 100644 index 000000000000..947fc827324d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.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.DatabaseFleetManager.Models +{ + internal partial class FleetListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FleetListResult)} 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 + } + } + } + + FleetListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetListResult(document.RootElement, options); + } + + internal static FleetListResult DeserializeFleetListResult(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(FleetData.DeserializeFleetData(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 FleetListResult(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(FleetListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.cs new file mode 100644 index 000000000000..8f540541070e --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetListResult.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.DatabaseFleetManager.Models +{ + /// The response of a Fleet list operation. + internal partial class FleetListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 Fleet items on this page. + /// is null. + internal FleetListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Fleet items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetListResult() + { + } + + /// The Fleet items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.Serialization.cs new file mode 100644 index 000000000000..1d3092cc5d97 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.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.DatabaseFleetManager.Models +{ + public partial class FleetPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FleetPatch)} 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 + } + } + } + + FleetPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetPatch(document.RootElement, options); + } + + internal static FleetPatch DeserializeFleetPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + FleetProperties 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 = FleetProperties.DeserializeFleetProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetPatch(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(FleetPatch)} does not support writing '{options.Format}' format."); + } + } + + FleetPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.cs new file mode 100644 index 000000000000..5d094a941c76 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetPatch.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.DatabaseFleetManager.Models +{ + /// An update to a Database Fleet. + public partial class FleetPatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 FleetPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Resource tags. + /// The Database Fleet properties. + /// Keeps track of any properties unknown to the library. + internal FleetPatch(IDictionary tags, FleetProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Resource tags. + public IDictionary Tags { get; } + /// The Database Fleet properties. + public FleetProperties Properties { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.Serialization.cs new file mode 100644 index 000000000000..fe75ff9be114 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.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.DatabaseFleetManager.Models +{ + public partial class FleetProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FleetProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + 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 + } + } + } + + FleetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetProperties(document.RootElement, options); + } + + internal static FleetProperties DeserializeFleetProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + AzureProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetProperties(description, 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(FleetProperties)} does not support writing '{options.Format}' format."); + } + } + + FleetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.cs new file mode 100644 index 000000000000..36f22956d71d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetProperties.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.DatabaseFleetManager.Models +{ + /// The Database Fleet properties. + public partial class FleetProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 FleetProperties() + { + } + + /// Initializes a new instance of . + /// Fleet description. + /// Provisioning state. + /// Keeps track of any properties unknown to the library. + internal FleetProperties(string description, AzureProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Description = description; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Fleet description. + public string Description { get; set; } + /// Provisioning state. + public AzureProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.Serialization.cs new file mode 100644 index 000000000000..d5f81ad9a9a5 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.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.DatabaseFleetManager.Models +{ + internal partial class FleetTierListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FleetTierListResult)} 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 + } + } + } + + FleetTierListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetTierListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetTierListResult(document.RootElement, options); + } + + internal static FleetTierListResult DeserializeFleetTierListResult(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(FleetTierData.DeserializeFleetTierData(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 FleetTierListResult(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(FleetTierListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetTierListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetTierListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetTierListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.cs new file mode 100644 index 000000000000..b5e5af8cb162 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierListResult.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.DatabaseFleetManager.Models +{ + /// The response of a FleetTier list operation. + internal partial class FleetTierListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 FleetTier items on this page. + /// is null. + internal FleetTierListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FleetTier items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetTierListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetTierListResult() + { + } + + /// The FleetTier items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.Serialization.cs new file mode 100644 index 000000000000..ed01f9dd45c4 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.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.DatabaseFleetManager.Models +{ + public partial class FleetTierProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FleetTierProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Disabled)) + { + writer.WritePropertyName("disabled"u8); + writer.WriteBooleanValue(Disabled.Value); + } + if (Optional.IsDefined(Serverless)) + { + writer.WritePropertyName("serverless"u8); + writer.WriteBooleanValue(Serverless.Value); + } + if (Optional.IsDefined(Pooled)) + { + writer.WritePropertyName("pooled"u8); + writer.WriteBooleanValue(Pooled.Value); + } + if (Optional.IsDefined(ServiceTier)) + { + writer.WritePropertyName("serviceTier"u8); + writer.WriteStringValue(ServiceTier); + } + if (Optional.IsDefined(Family)) + { + writer.WritePropertyName("family"u8); + writer.WriteStringValue(Family); + } + if (Optional.IsDefined(Capacity)) + { + writer.WritePropertyName("capacity"u8); + writer.WriteNumberValue(Capacity.Value); + } + if (Optional.IsDefined(PoolNumOfDatabasesMax)) + { + writer.WritePropertyName("poolNumOfDatabasesMax"u8); + writer.WriteNumberValue(PoolNumOfDatabasesMax.Value); + } + if (Optional.IsDefined(HighAvailabilityReplicaCount)) + { + writer.WritePropertyName("highAvailabilityReplicaCount"u8); + writer.WriteNumberValue(HighAvailabilityReplicaCount.Value); + } + if (Optional.IsDefined(ZoneRedundancy)) + { + writer.WritePropertyName("zoneRedundancy"u8); + writer.WriteStringValue(ZoneRedundancy.Value.ToString()); + } + if (Optional.IsDefined(DatabaseCapacityMin)) + { + writer.WritePropertyName("databaseCapacityMin"u8); + writer.WriteNumberValue(DatabaseCapacityMin.Value); + } + if (Optional.IsDefined(DatabaseCapacityMax)) + { + writer.WritePropertyName("databaseCapacityMax"u8); + writer.WriteNumberValue(DatabaseCapacityMax.Value); + } + if (Optional.IsDefined(DatabaseSizeGbMax)) + { + writer.WritePropertyName("databaseSizeGbMax"u8); + writer.WriteNumberValue(DatabaseSizeGbMax.Value); + } + 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 + } + } + } + + FleetTierProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetTierProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetTierProperties(document.RootElement, options); + } + + internal static FleetTierProperties DeserializeFleetTierProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? disabled = default; + bool? serverless = default; + bool? pooled = default; + string serviceTier = default; + string family = default; + int? capacity = default; + int? poolNumOfDatabasesMax = default; + int? highAvailabilityReplicaCount = default; + ZoneRedundancy? zoneRedundancy = default; + double? databaseCapacityMin = default; + double? databaseCapacityMax = default; + int? databaseSizeGbMax = default; + AzureProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("disabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("serverless"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serverless = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("pooled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pooled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("serviceTier"u8)) + { + serviceTier = property.Value.GetString(); + continue; + } + if (property.NameEquals("family"u8)) + { + family = property.Value.GetString(); + continue; + } + if (property.NameEquals("capacity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacity = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("poolNumOfDatabasesMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + poolNumOfDatabasesMax = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("highAvailabilityReplicaCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highAvailabilityReplicaCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("zoneRedundancy"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoneRedundancy = new ZoneRedundancy(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseCapacityMin"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseCapacityMin = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("databaseCapacityMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseCapacityMax = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("databaseSizeGbMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseSizeGbMax = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new AzureProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetTierProperties( + disabled, + serverless, + pooled, + serviceTier, + family, + capacity, + poolNumOfDatabasesMax, + highAvailabilityReplicaCount, + zoneRedundancy, + databaseCapacityMin, + databaseCapacityMax, + databaseSizeGbMax, + 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(FleetTierProperties)} does not support writing '{options.Format}' format."); + } + } + + FleetTierProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetTierProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetTierProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.cs new file mode 100644 index 000000000000..35cb55d23201 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetTierProperties.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// A Fleet tier properties. + public partial class FleetTierProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 FleetTierProperties() + { + } + + /// Initializes a new instance of . + /// If true, tier is disabled. + /// If true, serverless resources are provisioned in the tier. + /// If true, databases are pooled. + /// Service tier of provisioned resources. Supported values: GeneralPurpose, Hyperscale. + /// Family of provisioned resources, for example Gen5. + /// Capacity of provisioned resources in the tier, in units matching the specified service tier, for example vCore for GeneralPurpose. + /// Maximum number of databases per pool. + /// Number of high availability replicas for databases in this tier. + /// Enable zone redundancy for all databases in this tier. + /// Minimum allocated capacity per database, in units matching the specified service tier. + /// Maximum allocated capacity per database, in units matching the specified service tier. + /// Maximum database size in Gb. + /// Provisioning state. + /// Keeps track of any properties unknown to the library. + internal FleetTierProperties(bool? disabled, bool? serverless, bool? pooled, string serviceTier, string family, int? capacity, int? poolNumOfDatabasesMax, int? highAvailabilityReplicaCount, ZoneRedundancy? zoneRedundancy, double? databaseCapacityMin, double? databaseCapacityMax, int? databaseSizeGbMax, AzureProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + Disabled = disabled; + Serverless = serverless; + Pooled = pooled; + ServiceTier = serviceTier; + Family = family; + Capacity = capacity; + PoolNumOfDatabasesMax = poolNumOfDatabasesMax; + HighAvailabilityReplicaCount = highAvailabilityReplicaCount; + ZoneRedundancy = zoneRedundancy; + DatabaseCapacityMin = databaseCapacityMin; + DatabaseCapacityMax = databaseCapacityMax; + DatabaseSizeGbMax = databaseSizeGbMax; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// If true, tier is disabled. + public bool? Disabled { get; } + /// If true, serverless resources are provisioned in the tier. + public bool? Serverless { get; set; } + /// If true, databases are pooled. + public bool? Pooled { get; set; } + /// Service tier of provisioned resources. Supported values: GeneralPurpose, Hyperscale. + public string ServiceTier { get; set; } + /// Family of provisioned resources, for example Gen5. + public string Family { get; set; } + /// Capacity of provisioned resources in the tier, in units matching the specified service tier, for example vCore for GeneralPurpose. + public int? Capacity { get; set; } + /// Maximum number of databases per pool. + public int? PoolNumOfDatabasesMax { get; set; } + /// Number of high availability replicas for databases in this tier. + public int? HighAvailabilityReplicaCount { get; set; } + /// Enable zone redundancy for all databases in this tier. + public ZoneRedundancy? ZoneRedundancy { get; set; } + /// Minimum allocated capacity per database, in units matching the specified service tier. + public double? DatabaseCapacityMin { get; set; } + /// Maximum allocated capacity per database, in units matching the specified service tier. + public double? DatabaseCapacityMax { get; set; } + /// Maximum database size in Gb. + public int? DatabaseSizeGbMax { get; set; } + /// Provisioning state. + public AzureProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.Serialization.cs new file mode 100644 index 000000000000..5119e07ccddf --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.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.DatabaseFleetManager.Models +{ + internal partial class FleetspaceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FleetspaceListResult)} 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 + } + } + } + + FleetspaceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceListResult(document.RootElement, options); + } + + internal static FleetspaceListResult DeserializeFleetspaceListResult(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(FleetspaceData.DeserializeFleetspaceData(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 FleetspaceListResult(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(FleetspaceListResult)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetspaceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.cs new file mode 100644 index 000000000000..3f4024c0a31f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceListResult.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.DatabaseFleetManager.Models +{ + /// The response of a Fleetspace list operation. + internal partial class FleetspaceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 Fleetspace items on this page. + /// is null. + internal FleetspaceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Fleetspace items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FleetspaceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FleetspaceListResult() + { + } + + /// The Fleetspace items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.Serialization.cs new file mode 100644 index 000000000000..a433a4024b6c --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.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.DatabaseFleetManager.Models +{ + public partial class FleetspaceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FleetspaceProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(CapacityMax)) + { + writer.WritePropertyName("capacityMax"u8); + writer.WriteNumberValue(CapacityMax.Value); + } + if (Optional.IsDefined(MainPrincipal)) + { + writer.WritePropertyName("mainPrincipal"u8); + writer.WriteObjectValue(MainPrincipal, 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 + } + } + } + + FleetspaceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FleetspaceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFleetspaceProperties(document.RootElement, options); + } + + internal static FleetspaceProperties DeserializeFleetspaceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureProvisioningState? provisioningState = default; + int? capacityMax = default; + MainPrincipal mainPrincipal = 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 AzureProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("capacityMax"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityMax = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("mainPrincipal"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mainPrincipal = MainPrincipal.DeserializeMainPrincipal(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FleetspaceProperties(provisioningState, capacityMax, mainPrincipal, serializedAdditionalRawData); + } + + BinaryData 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(FleetspaceProperties)} does not support writing '{options.Format}' format."); + } + } + + FleetspaceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFleetspaceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FleetspaceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.cs new file mode 100644 index 000000000000..e9289aa3cdc4 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/FleetspaceProperties.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.DatabaseFleetManager.Models +{ + /// A Fleetspace properties. + public partial class FleetspaceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 FleetspaceProperties() + { + } + + /// Initializes a new instance of . + /// Fleetspace state. + /// Maximum number of vCores database fleet manager is allowed to provision in the fleetspace. + /// Main Microsoft Entra ID principal that has admin access to all databases in the fleetspace. + /// Keeps track of any properties unknown to the library. + internal FleetspaceProperties(AzureProvisioningState? provisioningState, int? capacityMax, MainPrincipal mainPrincipal, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + CapacityMax = capacityMax; + MainPrincipal = mainPrincipal; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Fleetspace state. + public AzureProvisioningState? ProvisioningState { get; } + /// Maximum number of vCores database fleet manager is allowed to provision in the fleetspace. + public int? CapacityMax { get; set; } + /// Main Microsoft Entra ID principal that has admin access to all databases in the fleetspace. + public MainPrincipal MainPrincipal { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.Serialization.cs new file mode 100644 index 000000000000..488b4b2cfc27 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.DatabaseFleetManager.Models +{ + public partial class IdentityProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(IdentityProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IdentityType)) + { + writer.WritePropertyName("identityType"u8); + writer.WriteStringValue(IdentityType.Value.ToString()); + } + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteStartArray(); + foreach (var item in UserAssignedIdentities) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(FederatedClientId)) + { + writer.WritePropertyName("federatedClientId"u8); + writer.WriteStringValue(FederatedClientId.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 + } + } + } + + IdentityProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(IdentityProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeIdentityProperties(document.RootElement, options); + } + + internal static IdentityProperties DeserializeIdentityProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IdentityType? identityType = default; + IList userAssignedIdentities = default; + Guid? federatedClientId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("identityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identityType = new IdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DatabaseIdentity.DeserializeDatabaseIdentity(item, options)); + } + userAssignedIdentities = array; + continue; + } + if (property.NameEquals("federatedClientId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + federatedClientId = property.Value.GetGuid(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new IdentityProperties(identityType, userAssignedIdentities ?? new ChangeTrackingList(), federatedClientId, serializedAdditionalRawData); + } + + BinaryData 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(IdentityProperties)} does not support writing '{options.Format}' format."); + } + } + + IdentityProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeIdentityProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(IdentityProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.cs new file mode 100644 index 000000000000..c8aa59723fd3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Database Identity. + public partial class IdentityProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 IdentityProperties() + { + UserAssignedIdentities = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Identity type of the main principal. + /// User identity ids. + /// The federated client id for the SQL Database. It is used for cross tenant CMK scenario. + /// Keeps track of any properties unknown to the library. + internal IdentityProperties(IdentityType? identityType, IList userAssignedIdentities, Guid? federatedClientId, IDictionary serializedAdditionalRawData) + { + IdentityType = identityType; + UserAssignedIdentities = userAssignedIdentities; + FederatedClientId = federatedClientId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Identity type of the main principal. + public IdentityType? IdentityType { get; set; } + /// User identity ids. + public IList UserAssignedIdentities { get; } + /// The federated client id for the SQL Database. It is used for cross tenant CMK scenario. + public Guid? FederatedClientId { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityType.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityType.cs new file mode 100644 index 000000000000..4c18df457266 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/IdentityType.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.DatabaseFleetManager.Models +{ + /// Identity type of the main principal. + public readonly partial struct IdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public IdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string UserAssignedValue = "UserAssigned"; + + /// No identity. + public static IdentityType None { get; } = new IdentityType(NoneValue); + /// User assigned identity. + public static IdentityType UserAssigned { get; } = new IdentityType(UserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(IdentityType left, IdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(IdentityType left, IdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator IdentityType(string value) => new IdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is IdentityType other && Equals(other); + /// + public bool Equals(IdentityType 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.Serialization.cs new file mode 100644 index 000000000000..68c67e32b2d7 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.Serialization.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + public partial class MainPrincipal : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(MainPrincipal)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Login)) + { + writer.WritePropertyName("login"u8); + writer.WriteStringValue(Login); + } + if (Optional.IsDefined(ApplicationId)) + { + writer.WritePropertyName("applicationId"u8); + writer.WriteStringValue(ApplicationId.Value); + } + if (Optional.IsDefined(ObjectId)) + { + writer.WritePropertyName("objectId"u8); + writer.WriteStringValue(ObjectId.Value); + } + if (Optional.IsDefined(TenantId)) + { + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId.Value); + } + if (Optional.IsDefined(PrincipalType)) + { + writer.WritePropertyName("principalType"u8); + writer.WriteStringValue(PrincipalType.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 + } + } + } + + MainPrincipal IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MainPrincipal)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMainPrincipal(document.RootElement, options); + } + + internal static MainPrincipal DeserializeMainPrincipal(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string login = default; + Guid? applicationId = default; + Guid? objectId = default; + Guid? tenantId = default; + PrincipalType? principalType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("login"u8)) + { + login = property.Value.GetString(); + continue; + } + if (property.NameEquals("applicationId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applicationId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("objectId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + objectId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("tenantId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + tenantId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("principalType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + principalType = new PrincipalType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MainPrincipal( + login, + applicationId, + objectId, + tenantId, + principalType, + serializedAdditionalRawData); + } + + BinaryData 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(MainPrincipal)} does not support writing '{options.Format}' format."); + } + } + + MainPrincipal IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMainPrincipal(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MainPrincipal)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.cs new file mode 100644 index 000000000000..eb5d3839f132 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/MainPrincipal.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.DatabaseFleetManager.Models +{ + /// A main principal. + public partial class MainPrincipal + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 MainPrincipal() + { + } + + /// Initializes a new instance of . + /// Login name of the main principal. + /// Application Id of the main principal. + /// Object Id of the main principal. + /// Tenant Id of the main principal. + /// Principal type of the main principal. + /// Keeps track of any properties unknown to the library. + internal MainPrincipal(string login, Guid? applicationId, Guid? objectId, Guid? tenantId, PrincipalType? principalType, IDictionary serializedAdditionalRawData) + { + Login = login; + ApplicationId = applicationId; + ObjectId = objectId; + TenantId = tenantId; + PrincipalType = principalType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Login name of the main principal. + public string Login { get; set; } + /// Application Id of the main principal. + public Guid? ApplicationId { get; set; } + /// Object Id of the main principal. + public Guid? ObjectId { get; set; } + /// Tenant Id of the main principal. + public Guid? TenantId { get; set; } + /// Principal type of the main principal. + public PrincipalType? PrincipalType { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/PrincipalType.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/PrincipalType.cs new file mode 100644 index 000000000000..a8fe0c148ff2 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/PrincipalType.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.DatabaseFleetManager.Models +{ + /// Principal type of the authorized principal. + public readonly partial struct PrincipalType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public PrincipalType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApplicationValue = "Application"; + private const string UserValue = "User"; + + /// Application principal type. + public static PrincipalType Application { get; } = new PrincipalType(ApplicationValue); + /// User principal type. + public static PrincipalType User { get; } = new PrincipalType(UserValue); + /// Determines if two values are the same. + public static bool operator ==(PrincipalType left, PrincipalType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(PrincipalType left, PrincipalType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator PrincipalType(string value) => new PrincipalType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is PrincipalType other && Equals(other); + /// + public bool Equals(PrincipalType 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.Serialization.cs new file mode 100644 index 000000000000..1fba8d19e604 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.Serialization.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.DatabaseFleetManager.Models +{ + public partial class RegisterServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(RegisterServerProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TierName)) + { + writer.WritePropertyName("tierName"u8); + writer.WriteStringValue(TierName); + } + if (Optional.IsDefined(SourceSubscriptionId)) + { + writer.WritePropertyName("sourceSubscriptionId"u8); + writer.WriteStringValue(SourceSubscriptionId); + } + if (Optional.IsDefined(SourceResourceGroupName)) + { + writer.WritePropertyName("sourceResourceGroupName"u8); + writer.WriteStringValue(SourceResourceGroupName); + } + if (Optional.IsDefined(SourceServerName)) + { + writer.WritePropertyName("sourceServerName"u8); + writer.WriteStringValue(SourceServerName); + } + if (Optional.IsCollectionDefined(DestinationTierOverrides)) + { + writer.WritePropertyName("destinationTierOverrides"u8); + writer.WriteStartArray(); + foreach (var item in DestinationTierOverrides) + { + 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 + } + } + } + + RegisterServerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RegisterServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRegisterServerProperties(document.RootElement, options); + } + + internal static RegisterServerProperties DeserializeRegisterServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string tierName = default; + string sourceSubscriptionId = default; + string sourceResourceGroupName = default; + string sourceServerName = default; + IList destinationTierOverrides = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tierName"u8)) + { + tierName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceSubscriptionId"u8)) + { + sourceSubscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceResourceGroupName"u8)) + { + sourceResourceGroupName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceServerName"u8)) + { + sourceServerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("destinationTierOverrides"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DestinationTierOverride.DeserializeDestinationTierOverride(item, options)); + } + destinationTierOverrides = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RegisterServerProperties( + tierName, + sourceSubscriptionId, + sourceResourceGroupName, + sourceServerName, + destinationTierOverrides ?? 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(RegisterServerProperties)} does not support writing '{options.Format}' format."); + } + } + + RegisterServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRegisterServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RegisterServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.cs new file mode 100644 index 000000000000..83270ed1034b --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/RegisterServerProperties.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.DatabaseFleetManager.Models +{ + /// Server registration definition. + public partial class RegisterServerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 RegisterServerProperties() + { + DestinationTierOverrides = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Destination tier name. + /// Source subscription id. + /// Source resource group name. + /// Source SQL Server name. + /// Destination tier overrides. + /// Keeps track of any properties unknown to the library. + internal RegisterServerProperties(string tierName, string sourceSubscriptionId, string sourceResourceGroupName, string sourceServerName, IList destinationTierOverrides, IDictionary serializedAdditionalRawData) + { + TierName = tierName; + SourceSubscriptionId = sourceSubscriptionId; + SourceResourceGroupName = sourceResourceGroupName; + SourceServerName = sourceServerName; + DestinationTierOverrides = destinationTierOverrides; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Destination tier name. + public string TierName { get; set; } + /// Source subscription id. + public string SourceSubscriptionId { get; set; } + /// Source resource group name. + public string SourceResourceGroupName { get; set; } + /// Source SQL Server name. + public string SourceServerName { get; set; } + /// Destination tier overrides. + public IList DestinationTierOverrides { get; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ResourceType.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ResourceType.cs new file mode 100644 index 000000000000..47ce2d88086f --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ResourceType.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.DatabaseFleetManager.Models +{ + /// Resource type of the destination tier override. + public readonly partial struct ResourceType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ResourceType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DatabaseValue = "Database"; + private const string PoolValue = "Pool"; + + /// Database resource type. + public static ResourceType Database { get; } = new ResourceType(DatabaseValue); + /// Elastic pool resource type. + public static ResourceType Pool { get; } = new ResourceType(PoolValue); + /// Determines if two values are the same. + public static bool operator ==(ResourceType left, ResourceType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ResourceType left, ResourceType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ResourceType(string value) => new ResourceType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ResourceType other && Equals(other); + /// + public bool Equals(ResourceType 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.Serialization.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.Serialization.cs new file mode 100644 index 000000000000..4410e7d3a802 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.DatabaseFleetManager.Models +{ + public partial class TransparentDataEncryption : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(TransparentDataEncryption)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(KeyUri)) + { + writer.WritePropertyName("keyUri"u8); + writer.WriteStringValue(KeyUri.AbsoluteUri); + } + if (Optional.IsCollectionDefined(Keys)) + { + writer.WritePropertyName("keys"u8); + writer.WriteStartArray(); + foreach (var item in Keys) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(EnableAutoRotation)) + { + writer.WritePropertyName("enableAutoRotation"u8); + writer.WriteBooleanValue(EnableAutoRotation.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 + } + } + } + + TransparentDataEncryption IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TransparentDataEncryption)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTransparentDataEncryption(document.RootElement, options); + } + + internal static TransparentDataEncryption DeserializeTransparentDataEncryption(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Uri keyUri = default; + IList keys = default; + bool? enableAutoRotation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("keys"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + keys = array; + continue; + } + if (property.NameEquals("enableAutoRotation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableAutoRotation = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TransparentDataEncryption(keyUri, keys ?? new ChangeTrackingList(), enableAutoRotation, serializedAdditionalRawData); + } + + BinaryData 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(TransparentDataEncryption)} does not support writing '{options.Format}' format."); + } + } + + TransparentDataEncryption IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTransparentDataEncryption(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TransparentDataEncryption)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.cs new file mode 100644 index 000000000000..8cf2e72658ff --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/TransparentDataEncryption.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.DatabaseFleetManager.Models +{ + /// Transparent Data Encryption properties. + public partial class TransparentDataEncryption + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 TransparentDataEncryption() + { + Keys = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Customer Managed Key (CMK) Uri. + /// Additional Keys. + /// Enable key auto rotation. + /// Keeps track of any properties unknown to the library. + internal TransparentDataEncryption(Uri keyUri, IList keys, bool? enableAutoRotation, IDictionary serializedAdditionalRawData) + { + KeyUri = keyUri; + Keys = keys; + EnableAutoRotation = enableAutoRotation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Customer Managed Key (CMK) Uri. + public Uri KeyUri { get; set; } + /// Additional Keys. + public IList Keys { get; } + /// Enable key auto rotation. + public bool? EnableAutoRotation { get; set; } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ZoneRedundancy.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ZoneRedundancy.cs new file mode 100644 index 000000000000..5aaa4d259d0d --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/Models/ZoneRedundancy.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.DatabaseFleetManager.Models +{ + /// Status of zone redundancy in a tier. + public readonly partial struct ZoneRedundancy : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ZoneRedundancy(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnabledValue = "Enabled"; + private const string DisabledValue = "Disabled"; + + /// Zone redundancy enabled. + public static ZoneRedundancy Enabled { get; } = new ZoneRedundancy(EnabledValue); + /// Zone redundancy disabled. + public static ZoneRedundancy Disabled { get; } = new ZoneRedundancy(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(ZoneRedundancy left, ZoneRedundancy right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ZoneRedundancy left, ZoneRedundancy right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ZoneRedundancy(string value) => new ZoneRedundancy(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ZoneRedundancy other && Equals(other); + /// + public bool Equals(ZoneRedundancy 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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ProviderConstants.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..978185b579aa --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/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.DatabaseFleetManager +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FirewallRulesRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FirewallRulesRestOperations.cs new file mode 100644 index 000000000000..0f628e615d31 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FirewallRulesRestOperations.cs @@ -0,0 +1,585 @@ +// 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.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FirewallRulesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FirewallRulesRestOperations. + /// 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 FirewallRulesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// 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 fleetName, string fleetspaceName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FirewallRuleData.DeserializeFirewallRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FirewallRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// 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 fleetName, string fleetspaceName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FirewallRuleData.DeserializeFirewallRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FirewallRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, FirewallRuleData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName, FirewallRuleData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The firewall rule object to create or update. + /// 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 fleetName, string fleetspaceName, string firewallRuleName, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// The firewall rule object to create or update. + /// 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 fleetName, string fleetspaceName, string firewallRuleName, FirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string firewallRuleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// 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 fleetName, string fleetspaceName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a firewall rule. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the firewall rule. + /// 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 fleetName, string fleetspaceName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, firewallRuleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetspaceRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByFleetspaceRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/firewallRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all firewall rules in a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetspaceAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all firewall rules in a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByFleetspace(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetspaceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetspaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all firewall rules in a fleetspace. + /// 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. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetspaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all firewall rules in a fleetspace. + /// 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. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByFleetspaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetDatabasesRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetDatabasesRestOperations.cs new file mode 100644 index 000000000000..826cdc4cd6d5 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetDatabasesRestOperations.cs @@ -0,0 +1,1021 @@ +// 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.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FleetDatabasesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetDatabasesRestOperations. + /// 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 FleetDatabasesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// 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 fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetDatabaseData.DeserializeFleetDatabaseData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetDatabaseData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// 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 fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetDatabaseData.DeserializeFleetDatabaseData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetDatabaseData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The database object to create or update. + /// 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 fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The database object to create or update. + /// 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 fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, 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 fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, FleetDatabaseData 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/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, 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; + } + + /// Updates a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The database object to patch. + /// 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 fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, 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); + } + } + + /// Updates a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The database object to patch. + /// 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 fleetName, string fleetspaceName, string databaseName, FleetDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, data); + _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 fleetName, string fleetspaceName, string databaseName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// 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 fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a fleet database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// 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 fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetspaceRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string filter, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByFleetspaceRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string filter, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (filter != null) + { + uri.AppendQuery("$filter", filter, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleet databases in a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetspaceAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, filter, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetDatabaseListResult.DeserializeFleetDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleet databases in a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByFleetspace(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, filter, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetDatabaseListResult.DeserializeFleetDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateChangeTierRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseChangeTierProperties body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/changeTier", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateChangeTierRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseChangeTierProperties body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/changeTier", 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; + } + + /// Moves database to a different tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The details of the change tier operation. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task ChangeTierAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseChangeTierProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateChangeTierRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Moves database to a different tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The details of the change tier operation. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ChangeTier(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseChangeTierProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateChangeTierRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRenameRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseRenameProperties body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/rename", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRenameRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseRenameProperties body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/rename", 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; + } + + /// Renames a database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The details of the rename operation. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task RenameAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseRenameProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRenameRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Renames a database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The details of the rename operation. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Rename(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, DatabaseRenameProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRenameRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRevertRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/revert", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRevertRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/databases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/revert", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Revert a database transparent data encryption (TDE). + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task RevertAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateRevertRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Revert a database transparent data encryption (TDE). + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// Name of the database. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Revert(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, string databaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + + using var message = CreateRevertRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, databaseName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetspaceNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string filter, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetspaceNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip, long? top, string filter, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleet databases in a fleetspace. + /// 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. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetspaceNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, filter, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetDatabaseListResult.DeserializeFleetDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleet databases in a fleetspace. + /// 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. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An OData filter expression that filters elements in the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListByFleetspaceNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, long? skip = null, long? top = null, string filter = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateListByFleetspaceNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, fleetspaceName, skip, top, filter, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetDatabaseListResult.DeserializeFleetDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetTiersRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetTiersRestOperations.cs new file mode 100644 index 000000000000..03a7e139c584 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetTiersRestOperations.cs @@ -0,0 +1,751 @@ +// 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.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FleetTiersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetTiersRestOperations. + /// 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 FleetTiersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a tier resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// 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 fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, tierName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetTierData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetTierData.DeserializeFleetTierData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetTierData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a tier resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// 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 fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, tierName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetTierData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetTierData.DeserializeFleetTierData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetTierData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The tier object to create or update. + /// 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 fleetName, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, tierName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The tier object to create or update. + /// 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 fleetName, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, tierName, 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 fleetName, string tierName, FleetTierData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName, FleetTierData 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/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, 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; + } + + /// Updates a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// 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 fleetName, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, tierName, 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); + } + } + + /// Updates a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// 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 fleetName, string tierName, FleetTierData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, tierName, data); + _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 fleetName, string tierName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// 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 fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, tierName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// 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 fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, tierName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List tiers in a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetTierListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetTierListResult.DeserializeFleetTierListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List tiers in a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetTierListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetTierListResult.DeserializeFleetTierListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDisableRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendPath("/disable", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDisableRequest(string subscriptionId, string resourceGroupName, string fleetName, string tierName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/tiers/", false); + uri.AppendPath(tierName, true); + uri.AppendPath("/disable", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Disables a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> DisableAsync(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateDisableRequest(subscriptionId, resourceGroupName, fleetName, tierName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetTierData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetTierData.DeserializeFleetTierData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Disables a tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the tier. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Disable(string subscriptionId, string resourceGroupName, string fleetName, string tierName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(tierName, nameof(tierName)); + + using var message = CreateDisableRequest(subscriptionId, resourceGroupName, fleetName, tierName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetTierData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetTierData.DeserializeFleetTierData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + 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 tiers in a fleet. + /// 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. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetTierListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetTierListResult.DeserializeFleetTierListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List tiers in a fleet. + /// 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. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetTierListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetTierListResult.DeserializeFleetTierListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetsRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetsRestOperations.cs new file mode 100644 index 000000000000..0a6aa9468696 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetsRestOperations.cs @@ -0,0 +1,759 @@ +// 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.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FleetsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetsRestOperations. + /// 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 FleetsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// 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 fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetData.DeserializeFleetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// 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 fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetData.DeserializeFleetData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, FleetData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The fleet object to create or update. + /// 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 fleetName, FleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The fleet object to create or update. + /// 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 fleetName, FleetData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, 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 fleetName, FleetPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, FleetPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, 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; + } + + /// Modifies a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The fleet object to patch. + /// 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 fleetName, FleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, 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); + } + } + + /// Modifies a fleet resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The fleet object to patch. + /// 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 fleetName, FleetPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, 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 fleetName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// 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 fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// 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 fleetName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName); + _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, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleets in a 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 number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// 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, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleets in a 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 number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// 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, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleets in a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleets in a subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByResourceGroupNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleets in a 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 number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// 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, long? skip = null, long? top = null, string skiptoken = null, 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, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleets in a 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 number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// 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, long? skip = null, long? top = null, string skiptoken = null, 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, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all fleets in a subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all fleets in a subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetListResult.DeserializeFleetListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetspacesRestOperations.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetspacesRestOperations.cs new file mode 100644 index 000000000000..b090d734346c --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Generated/RestOperations/FleetspacesRestOperations.cs @@ -0,0 +1,841 @@ +// 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.DatabaseFleetManager.Models; + +namespace Azure.ResourceManager.DatabaseFleetManager +{ + internal partial class FleetspacesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FleetspacesRestOperations. + /// 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 FleetspacesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2025-02-01-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// 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 fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetspaceData.DeserializeFleetspaceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetspaceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// 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 fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetspaceData.DeserializeFleetspaceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((FleetspaceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates or updates a fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The fleet object to create or update. + /// 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 fleetName, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates or updates a fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The fleet object to create or update. + /// 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 fleetName, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, 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 fleetName, string fleetspaceName, FleetspaceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, FleetspaceData 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/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, 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; + } + + /// Modifies a fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// 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 fleetName, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, 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); + } + } + + /// Modifies a fleetspace resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// 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 fleetName, string fleetspaceName, FleetspaceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, data); + _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 fleetName, string fleetspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// 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 fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// 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 fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetRequestUri(string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + return uri; + } + + internal HttpMessage CreateListByFleetRequest(string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (skip != null) + { + uri.AppendQuery("$skip", skip.Value, true); + } + if (top != null) + { + uri.AppendQuery("$top", top.Value, true); + } + if (skiptoken != null) + { + uri.AppendQuery("$skiptoken", skiptoken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists fleetspaces in a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetAsync(string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists fleetspaces in a fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleet(string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetRequest(subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRegisterServerRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, RegisterServerProperties body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/registerServer", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRegisterServerRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, RegisterServerProperties body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/registerServer", 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; + } + + /// Migrates an existing logical server into fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The details of the register server operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task RegisterServerAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, RegisterServerProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRegisterServerRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Migrates an existing logical server into fleet. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The details of the register server operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response RegisterServer(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, RegisterServerProperties body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreateRegisterServerRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUnregisterRequestUri(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/unregister", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUnregisterRequest(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DatabaseFleetManager/fleets/", false); + uri.AppendPath(fleetName, true); + uri.AppendPath("/fleetspaces/", false); + uri.AppendPath(fleetspaceName, true); + uri.AppendPath("/unregister", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Unregisters all databases from a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UnregisterAsync(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateUnregisterRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Unregisters all databases from a fleetspace. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the database fleet. + /// Name of the fleetspace. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Unregister(string subscriptionId, string resourceGroupName, string fleetName, string fleetspaceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + Argument.AssertNotNullOrEmpty(fleetspaceName, nameof(fleetspaceName)); + + using var message = CreateUnregisterRequest(subscriptionId, resourceGroupName, fleetName, fleetspaceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByFleetNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByFleetNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip, long? top, string skiptoken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists fleetspaces in a fleet. + /// 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. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByFleetNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists fleetspaces in a fleet. + /// 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. + /// Name of the database fleet. + /// The number of elements in the collection to skip. + /// The number of elements to return from the collection. + /// An opaque token that identifies a starting point in the collection. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByFleetNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fleetName, long? skip = null, long? top = null, string skiptoken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fleetName, nameof(fleetName)); + + using var message = CreateListByFleetNextPageRequest(nextLink, subscriptionId, resourceGroupName, fleetName, skip, top, skiptoken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FleetspaceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FleetspaceListResult.DeserializeFleetspaceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Properties/AssemblyInfo.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..5054b8d16600 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/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.DatabaseFleetManager.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("DatabaseFleetManager")] diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/Azure.ResourceManager.DatabaseFleetManager.Tests.csproj b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/Azure.ResourceManager.DatabaseFleetManager.Tests.csproj new file mode 100644 index 000000000000..0d3762ddbdc3 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/Azure.ResourceManager.DatabaseFleetManager.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestBase.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestBase.cs new file mode 100644 index 000000000000..7ffd79d94660 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestBase.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.DatabaseFleetManager.Tests +{ + public class DatabaseFleetManagerManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected DatabaseFleetManagerManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected DatabaseFleetManagerManagementTestBase(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/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestEnvironment.cs b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestEnvironment.cs new file mode 100644 index 000000000000..9582ae45e94a --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tests/DatabaseFleetManagerManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.DatabaseFleetManager.Tests +{ + public class DatabaseFleetManagerManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tsp-location.yaml b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tsp-location.yaml new file mode 100644 index 000000000000..d8581f70f126 --- /dev/null +++ b/sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/databasefleetmanager/DatabaseFleetManager.Management +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/databasefleetmanager/ci.mgmt.yml b/sdk/databasefleetmanager/ci.mgmt.yml new file mode 100644 index 000000000000..97b2f849f23c --- /dev/null +++ b/sdk/databasefleetmanager/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/databasefleetmanager /ci.mgmt.yml + - sdk/databasefleetmanager /Azure.ResourceManager.DatabaseFleetManager / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: databasefleetmanager + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.DatabaseFleetManager + safeName: AzureResourceManagerDatabaseFleetManager diff --git a/sdk/durabletask/Azure.ResourceManager.DurableTask/tsp-location.yaml b/sdk/durabletask/Azure.ResourceManager.DurableTask/tsp-location.yaml index 98bf66c0879a..fb360621bfa4 100644 --- a/sdk/durabletask/Azure.ResourceManager.DurableTask/tsp-location.yaml +++ b/sdk/durabletask/Azure.ResourceManager.DurableTask/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/durabletask/DurableTask.Management -commit: fe26b288981160b839d6d50464f12757f5487721 +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/durabletask/ci.mgmt.yml b/sdk/durabletask/ci.mgmt.yml index 5f63204cd804..32b11e75b082 100644 --- a/sdk/durabletask/ci.mgmt.yml +++ b/sdk/durabletask/ci.mgmt.yml @@ -1,7 +1,6 @@ # NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. trigger: none - pr: branches: include: diff --git a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/tsp-location.yaml b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/tsp-location.yaml index 2b3e253ddbf3..8d6a4bbd118e 100644 --- a/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/tsp-location.yaml +++ b/sdk/informaticadatamanagement/Azure.ResourceManager.InformaticaDataManagement/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/informatica/Informatica.DataManagement.Management -commit: 462574dbd02088c209bb1da3eef0d93f699e8de2 -repo: Azure/azure-rest-api-specs \ No newline at end of file +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.net8.0.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.net8.0.cs index 69da539c4a18..518c7343ee09 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.net8.0.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.net8.0.cs @@ -476,7 +476,7 @@ public static partial class ArmIotOperationsModelFactory public static Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProfileProperties IotOperationsDataflowProfileProperties(Azure.ResourceManager.IotOperations.Models.DataflowProfileDiagnostics diagnostics = null, int? instanceCount = default(int?), Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } public static Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProperties IotOperationsDataflowProperties(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? mode = default(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode?), System.Collections.Generic.IEnumerable operations = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } public static Azure.ResourceManager.IotOperations.IotOperationsInstanceData IotOperationsInstanceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties IotOperationsInstanceProperties(string description = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?), string version = null, Azure.Core.ResourceIdentifier schemaRegistryRefResourceId = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties IotOperationsInstanceProperties(string description = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?), string version = null, Azure.Core.ResourceIdentifier schemaRegistryRefResourceId = null, System.Collections.Generic.IDictionary features = null) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct BlockerListenerServiceType : System.IEquatable @@ -1485,6 +1485,37 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod left, Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod right) { throw null; } public override string ToString() { throw null; } } + public partial class InstanceFeature : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InstanceFeature() { } + public Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode? Mode { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Settings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.InstanceFeature System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.InstanceFeature System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct InstanceFeatureMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public InstanceFeatureMode(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode Disabled { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode Preview { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode Stable { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode left, Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode left, Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode right) { throw null; } + public override string ToString() { throw null; } + } public partial class IotOperationsBatchingConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public IotOperationsBatchingConfig() { } @@ -1641,6 +1672,7 @@ public partial class IotOperationsInstanceProperties : System.ClientModel.Primit { public IotOperationsInstanceProperties(Azure.ResourceManager.IotOperations.Models.SchemaRegistryRef schemaRegistryRef) { } public string Description { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Features { get { throw null; } } public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } public Azure.Core.ResourceIdentifier SchemaRegistryRefResourceId { get { throw null; } set { } } public string Version { get { throw null; } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.netstandard2.0.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.netstandard2.0.cs index 69da539c4a18..518c7343ee09 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.netstandard2.0.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/api/Azure.ResourceManager.IotOperations.netstandard2.0.cs @@ -476,7 +476,7 @@ public static partial class ArmIotOperationsModelFactory public static Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProfileProperties IotOperationsDataflowProfileProperties(Azure.ResourceManager.IotOperations.Models.DataflowProfileDiagnostics diagnostics = null, int? instanceCount = default(int?), Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } public static Azure.ResourceManager.IotOperations.Models.IotOperationsDataflowProperties IotOperationsDataflowProperties(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode? mode = default(Azure.ResourceManager.IotOperations.Models.IotOperationsOperationalMode?), System.Collections.Generic.IEnumerable operations = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?)) { throw null; } public static Azure.ResourceManager.IotOperations.IotOperationsInstanceData IotOperationsInstanceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties properties = null, Azure.ResourceManager.IotOperations.Models.IotOperationsExtendedLocation extendedLocation = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties IotOperationsInstanceProperties(string description = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?), string version = null, Azure.Core.ResourceIdentifier schemaRegistryRefResourceId = null) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.IotOperationsInstanceProperties IotOperationsInstanceProperties(string description = null, Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? provisioningState = default(Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState?), string version = null, Azure.Core.ResourceIdentifier schemaRegistryRefResourceId = null, System.Collections.Generic.IDictionary features = null) { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct BlockerListenerServiceType : System.IEquatable @@ -1485,6 +1485,37 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod left, Azure.ResourceManager.IotOperations.Models.FabricOneLakeAuthMethod right) { throw null; } public override string ToString() { throw null; } } + public partial class InstanceFeature : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public InstanceFeature() { } + public Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode? Mode { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Settings { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.InstanceFeature System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.IotOperations.Models.InstanceFeature System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct InstanceFeatureMode : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public InstanceFeatureMode(string value) { throw null; } + public static Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode Disabled { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode Preview { get { throw null; } } + public static Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode Stable { get { throw null; } } + public bool Equals(Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode left, Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode right) { throw null; } + public static implicit operator Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode left, Azure.ResourceManager.IotOperations.Models.InstanceFeatureMode right) { throw null; } + public override string ToString() { throw null; } + } public partial class IotOperationsBatchingConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public IotOperationsBatchingConfig() { } @@ -1641,6 +1672,7 @@ public partial class IotOperationsInstanceProperties : System.ClientModel.Primit { public IotOperationsInstanceProperties(Azure.ResourceManager.IotOperations.Models.SchemaRegistryRef schemaRegistryRef) { } public string Description { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Features { get { throw null; } } public Azure.ResourceManager.IotOperations.Models.IotOperationsProvisioningState? ProvisioningState { get { throw null; } } public Azure.Core.ResourceIdentifier SchemaRegistryRefResourceId { get { throw null; } set { } } public string Version { get { throw null; } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationCollection.cs index 9f121cef1865..8621e0f7d59f 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_IotOperationsBrokerAuthenticationCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_BrokerAuthenticationCreateOrUpdateComplex() { - // Generated from example definition: 2024-11-01/BrokerAuthentication_CreateOrUpdate_Complex.json + // Generated from example definition: 2025-04-01/BrokerAuthentication_CreateOrUpdate_Complex.json // this example is just showing the usage of "BrokerAuthenticationResource_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 @@ -90,7 +90,7 @@ public async Task CreateOrUpdate_BrokerAuthenticationCreateOrUpdateComplex() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_BrokerAuthenticationCreateOrUpdate() { - // Generated from example definition: 2024-11-01/BrokerAuthentication_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthentication_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthenticationResource_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 @@ -156,7 +156,7 @@ public async Task CreateOrUpdate_BrokerAuthenticationCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_BrokerAuthenticationGet() { - // Generated from example definition: 2024-11-01/BrokerAuthentication_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthentication_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthenticationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 +191,7 @@ public async Task Get_BrokerAuthenticationGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_BrokerAuthenticationListByResourceGroup() { - // Generated from example definition: 2024-11-01/BrokerAuthentication_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthentication_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthenticationResource_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 @@ -228,7 +228,7 @@ public async Task GetAll_BrokerAuthenticationListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_BrokerAuthenticationGet() { - // Generated from example definition: 2024-11-01/BrokerAuthentication_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthentication_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthenticationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -259,7 +259,7 @@ public async Task Exists_BrokerAuthenticationGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_BrokerAuthenticationGet() { - // Generated from example definition: 2024-11-01/BrokerAuthentication_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthentication_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthenticationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationResource.cs index 6058e48bf430..0daca18d7293 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthenticationResource.cs @@ -21,7 +21,7 @@ public partial class Sample_IotOperationsBrokerAuthenticationResource [Ignore("Only validating compilation of examples")] public async Task Get_BrokerAuthenticationGet() { - // Generated from example definition: 2024-11-01/BrokerAuthentication_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthentication_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthenticationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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_BrokerAuthenticationGet() [Ignore("Only validating compilation of examples")] public async Task Delete_BrokerAuthenticationDelete() { - // Generated from example definition: 2024-11-01/BrokerAuthentication_Delete_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthentication_Delete_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthenticationResource_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +81,7 @@ public async Task Delete_BrokerAuthenticationDelete() [Ignore("Only validating compilation of examples")] public async Task Update_BrokerAuthenticationCreateOrUpdateComplex() { - // Generated from example definition: 2024-11-01/BrokerAuthentication_CreateOrUpdate_Complex.json + // Generated from example definition: 2025-04-01/BrokerAuthentication_CreateOrUpdate_Complex.json // this example is just showing the usage of "BrokerAuthenticationResource_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 @@ -147,7 +147,7 @@ public async Task Update_BrokerAuthenticationCreateOrUpdateComplex() [Ignore("Only validating compilation of examples")] public async Task Update_BrokerAuthenticationCreateOrUpdate() { - // Generated from example definition: 2024-11-01/BrokerAuthentication_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthentication_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthenticationResource_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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthorizationCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthorizationCollection.cs index 8c81822dcbba..7f9098e197fd 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthorizationCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthorizationCollection.cs @@ -21,7 +21,7 @@ public partial class Sample_IotOperationsBrokerAuthorizationCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_BrokerAuthorizationCreateOrUpdateComplex() { - // Generated from example definition: 2024-11-01/BrokerAuthorization_CreateOrUpdate_Complex.json + // Generated from example definition: 2025-04-01/BrokerAuthorization_CreateOrUpdate_Complex.json // this example is just showing the usage of "BrokerAuthorizationResource_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 @@ -90,7 +90,7 @@ public async Task CreateOrUpdate_BrokerAuthorizationCreateOrUpdateComplex() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_BrokerAuthorizationCreateOrUpdate() { - // Generated from example definition: 2024-11-01/BrokerAuthorization_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthorization_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthorizationResource_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 @@ -152,7 +152,7 @@ public async Task CreateOrUpdate_BrokerAuthorizationCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_BrokerAuthorizationCreateOrUpdateSimple() { - // Generated from example definition: 2024-11-01/BrokerAuthorization_CreateOrUpdate_Simple.json + // Generated from example definition: 2025-04-01/BrokerAuthorization_CreateOrUpdate_Simple.json // this example is just showing the usage of "BrokerAuthorizationResource_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 @@ -214,7 +214,7 @@ public async Task CreateOrUpdate_BrokerAuthorizationCreateOrUpdateSimple() [Ignore("Only validating compilation of examples")] public async Task Get_BrokerAuthorizationGet() { - // Generated from example definition: 2024-11-01/BrokerAuthorization_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthorization_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthorizationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -249,7 +249,7 @@ public async Task Get_BrokerAuthorizationGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_BrokerAuthorizationListByResourceGroup() { - // Generated from example definition: 2024-11-01/BrokerAuthorization_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthorization_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthorizationResource_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 @@ -286,7 +286,7 @@ public async Task GetAll_BrokerAuthorizationListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_BrokerAuthorizationGet() { - // Generated from example definition: 2024-11-01/BrokerAuthorization_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthorization_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthorizationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -317,7 +317,7 @@ public async Task Exists_BrokerAuthorizationGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_BrokerAuthorizationGet() { - // Generated from example definition: 2024-11-01/BrokerAuthorization_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthorization_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthorizationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthorizationResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthorizationResource.cs index 8284be4044ef..3e2b2d23115d 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthorizationResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerAuthorizationResource.cs @@ -21,7 +21,7 @@ public partial class Sample_IotOperationsBrokerAuthorizationResource [Ignore("Only validating compilation of examples")] public async Task Get_BrokerAuthorizationGet() { - // Generated from example definition: 2024-11-01/BrokerAuthorization_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthorization_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthorizationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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_BrokerAuthorizationGet() [Ignore("Only validating compilation of examples")] public async Task Delete_BrokerAuthorizationDelete() { - // Generated from example definition: 2024-11-01/BrokerAuthorization_Delete_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthorization_Delete_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthorizationResource_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -81,7 +81,7 @@ public async Task Delete_BrokerAuthorizationDelete() [Ignore("Only validating compilation of examples")] public async Task Update_BrokerAuthorizationCreateOrUpdateComplex() { - // Generated from example definition: 2024-11-01/BrokerAuthorization_CreateOrUpdate_Complex.json + // Generated from example definition: 2025-04-01/BrokerAuthorization_CreateOrUpdate_Complex.json // this example is just showing the usage of "BrokerAuthorizationResource_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 @@ -147,7 +147,7 @@ public async Task Update_BrokerAuthorizationCreateOrUpdateComplex() [Ignore("Only validating compilation of examples")] public async Task Update_BrokerAuthorizationCreateOrUpdate() { - // Generated from example definition: 2024-11-01/BrokerAuthorization_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerAuthorization_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "BrokerAuthorizationResource_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 @@ -206,7 +206,7 @@ public async Task Update_BrokerAuthorizationCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Update_BrokerAuthorizationCreateOrUpdateSimple() { - // Generated from example definition: 2024-11-01/BrokerAuthorization_CreateOrUpdate_Simple.json + // Generated from example definition: 2025-04-01/BrokerAuthorization_CreateOrUpdate_Simple.json // this example is just showing the usage of "BrokerAuthorizationResource_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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerCollection.cs index 2162fc3a56a4..852bfa4d7f69 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_IotOperationsBrokerCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_BrokerCreateOrUpdateComplex() { - // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Complex.json + // Generated from example definition: 2025-04-01/Broker_CreateOrUpdate_Complex.json // this example is just showing the usage of "BrokerResource_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,7 +71,7 @@ public async Task CreateOrUpdate_BrokerCreateOrUpdateComplex() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_BrokerCreateOrUpdate() { - // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Broker_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "BrokerResource_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 @@ -240,7 +240,7 @@ public async Task CreateOrUpdate_BrokerCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_BrokerCreateOrUpdateMinimal() { - // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Minimal.json + // Generated from example definition: 2025-04-01/Broker_CreateOrUpdate_Minimal.json // this example is just showing the usage of "BrokerResource_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 @@ -282,7 +282,7 @@ public async Task CreateOrUpdate_BrokerCreateOrUpdateMinimal() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_BrokerCreateOrUpdateSimple() { - // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Simple.json + // Generated from example definition: 2025-04-01/Broker_CreateOrUpdate_Simple.json // this example is just showing the usage of "BrokerResource_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 @@ -332,7 +332,7 @@ public async Task CreateOrUpdate_BrokerCreateOrUpdateSimple() [Ignore("Only validating compilation of examples")] public async Task Get_BrokerGet() { - // Generated from example definition: 2024-11-01/Broker_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Broker_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -366,7 +366,7 @@ public async Task Get_BrokerGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_BrokerListByResourceGroup() { - // Generated from example definition: 2024-11-01/Broker_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Broker_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "BrokerResource_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 @@ -402,7 +402,7 @@ public async Task GetAll_BrokerListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_BrokerGet() { - // Generated from example definition: 2024-11-01/Broker_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Broker_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -432,7 +432,7 @@ public async Task Exists_BrokerGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_BrokerGet() { - // Generated from example definition: 2024-11-01/Broker_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Broker_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerCollection.cs index 2b711a83140c..a93a530063fd 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_IotOperationsBrokerListenerCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_BrokerListenerCreateOrUpdateComplex() { - // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_Complex.json + // Generated from example definition: 2025-04-01/BrokerListener_CreateOrUpdate_Complex.json // this example is just showing the usage of "BrokerListenerResource_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 @@ -91,7 +91,7 @@ public async Task CreateOrUpdate_BrokerListenerCreateOrUpdateComplex() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_BrokerListenerCreateOrUpdate() { - // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerListener_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "BrokerListenerResource_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 @@ -156,7 +156,7 @@ public async Task CreateOrUpdate_BrokerListenerCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_BrokerListenerCreateOrUpdateSimple() { - // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_Simple.json + // Generated from example definition: 2025-04-01/BrokerListener_CreateOrUpdate_Simple.json // this example is just showing the usage of "BrokerListenerResource_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 @@ -199,7 +199,7 @@ public async Task CreateOrUpdate_BrokerListenerCreateOrUpdateSimple() [Ignore("Only validating compilation of examples")] public async Task Get_BrokerListenerGet() { - // Generated from example definition: 2024-11-01/BrokerListener_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerListener_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerListenerResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -234,7 +234,7 @@ public async Task Get_BrokerListenerGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_BrokerListenerListByResourceGroup() { - // Generated from example definition: 2024-11-01/BrokerListener_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerListener_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "BrokerListenerResource_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 @@ -271,7 +271,7 @@ public async Task GetAll_BrokerListenerListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_BrokerListenerGet() { - // Generated from example definition: 2024-11-01/BrokerListener_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerListener_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerListenerResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -302,7 +302,7 @@ public async Task Exists_BrokerListenerGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_BrokerListenerGet() { - // Generated from example definition: 2024-11-01/BrokerListener_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerListener_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerListenerResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerResource.cs index cba233d24ac7..c5d662793df1 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerListenerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_IotOperationsBrokerListenerResource [Ignore("Only validating compilation of examples")] public async Task Get_BrokerListenerGet() { - // Generated from example definition: 2024-11-01/BrokerListener_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerListener_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerListenerResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_BrokerListenerGet() [Ignore("Only validating compilation of examples")] public async Task Delete_BrokerListenerDelete() { - // Generated from example definition: 2024-11-01/BrokerListener_Delete_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerListener_Delete_MaximumSet_Gen.json // this example is just showing the usage of "BrokerListenerResource_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Delete_BrokerListenerDelete() [Ignore("Only validating compilation of examples")] public async Task Update_BrokerListenerCreateOrUpdateComplex() { - // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_Complex.json + // Generated from example definition: 2025-04-01/BrokerListener_CreateOrUpdate_Complex.json // this example is just showing the usage of "BrokerListenerResource_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 @@ -148,7 +148,7 @@ public async Task Update_BrokerListenerCreateOrUpdateComplex() [Ignore("Only validating compilation of examples")] public async Task Update_BrokerListenerCreateOrUpdate() { - // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/BrokerListener_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "BrokerListenerResource_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 @@ -210,7 +210,7 @@ public async Task Update_BrokerListenerCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Update_BrokerListenerCreateOrUpdateSimple() { - // Generated from example definition: 2024-11-01/BrokerListener_CreateOrUpdate_Simple.json + // Generated from example definition: 2025-04-01/BrokerListener_CreateOrUpdate_Simple.json // this example is just showing the usage of "BrokerListenerResource_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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerResource.cs index 47157e7c8f23..465b2d6f0560 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsBrokerResource.cs @@ -20,7 +20,7 @@ public partial class Sample_IotOperationsBrokerResource [Ignore("Only validating compilation of examples")] public async Task Get_BrokerGet() { - // Generated from example definition: 2024-11-01/Broker_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Broker_Get_MaximumSet_Gen.json // this example is just showing the usage of "BrokerResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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_BrokerGet() [Ignore("Only validating compilation of examples")] public async Task Delete_BrokerDelete() { - // Generated from example definition: 2024-11-01/Broker_Delete_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Broker_Delete_MaximumSet_Gen.json // this example is just showing the usage of "BrokerResource_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_BrokerDelete() [Ignore("Only validating compilation of examples")] public async Task Update_BrokerCreateOrUpdateComplex() { - // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Complex.json + // Generated from example definition: 2025-04-01/Broker_CreateOrUpdate_Complex.json // this example is just showing the usage of "BrokerResource_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 @@ -126,7 +126,7 @@ public async Task Update_BrokerCreateOrUpdateComplex() [Ignore("Only validating compilation of examples")] public async Task Update_BrokerCreateOrUpdate() { - // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Broker_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "BrokerResource_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 @@ -292,7 +292,7 @@ public async Task Update_BrokerCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Update_BrokerCreateOrUpdateMinimal() { - // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Minimal.json + // Generated from example definition: 2025-04-01/Broker_CreateOrUpdate_Minimal.json // this example is just showing the usage of "BrokerResource_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 @@ -331,7 +331,7 @@ public async Task Update_BrokerCreateOrUpdateMinimal() [Ignore("Only validating compilation of examples")] public async Task Update_BrokerCreateOrUpdateSimple() { - // Generated from example definition: 2024-11-01/Broker_CreateOrUpdate_Simple.json + // Generated from example definition: 2025-04-01/Broker_CreateOrUpdate_Simple.json // this example is just showing the usage of "BrokerResource_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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowCollection.cs index 728994d656b3..9dfd9f14bc2c 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_IotOperationsDataflowCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowCreateOrUpdateComplexContextualization() { - // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_ComplexContextualization.json + // Generated from example definition: 2025-04-01/Dataflow_CreateOrUpdate_ComplexContextualization.json // this example is just showing the usage of "DataflowResource_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 @@ -87,7 +87,7 @@ public async Task CreateOrUpdate_DataflowCreateOrUpdateComplexContextualization( [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowCreateOrUpdateComplexEventHub() { - // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_ComplexEventHub.json + // Generated from example definition: 2025-04-01/Dataflow_CreateOrUpdate_ComplexEventHub.json // this example is just showing the usage of "DataflowResource_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 @@ -168,7 +168,7 @@ public async Task CreateOrUpdate_DataflowCreateOrUpdateComplexEventHub() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowCreateOrUpdateFilterToTopic() { - // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_FilterToTopic.json + // Generated from example definition: 2025-04-01/Dataflow_CreateOrUpdate_FilterToTopic.json // this example is just showing the usage of "DataflowResource_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 @@ -239,7 +239,7 @@ public async Task CreateOrUpdate_DataflowCreateOrUpdateFilterToTopic() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowCreateOrUpdate() { - // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Dataflow_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "DataflowResource_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 @@ -317,7 +317,7 @@ public async Task CreateOrUpdate_DataflowCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowCreateOrUpdateSimpleEventGrid() { - // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_SimpleEventGrid.json + // Generated from example definition: 2025-04-01/Dataflow_CreateOrUpdate_SimpleEventGrid.json // this example is just showing the usage of "DataflowResource_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 @@ -372,7 +372,7 @@ public async Task CreateOrUpdate_DataflowCreateOrUpdateSimpleEventGrid() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowCreateOrUpdateSimpleFabric() { - // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_SimpleFabric.json + // Generated from example definition: 2025-04-01/Dataflow_CreateOrUpdate_SimpleFabric.json // this example is just showing the usage of "DataflowResource_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 @@ -435,7 +435,7 @@ public async Task CreateOrUpdate_DataflowCreateOrUpdateSimpleFabric() [Ignore("Only validating compilation of examples")] public async Task Get_DataflowGet() { - // Generated from example definition: 2024-11-01/Dataflow_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Dataflow_Get_MaximumSet_Gen.json // this example is just showing the usage of "DataflowResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -470,7 +470,7 @@ public async Task Get_DataflowGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_DataflowListByProfileResource() { - // Generated from example definition: 2024-11-01/Dataflow_ListByProfileResource_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Dataflow_ListByProfileResource_MaximumSet_Gen.json // this example is just showing the usage of "DataflowResource_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 @@ -507,7 +507,7 @@ public async Task GetAll_DataflowListByProfileResource() [Ignore("Only validating compilation of examples")] public async Task Exists_DataflowGet() { - // Generated from example definition: 2024-11-01/Dataflow_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Dataflow_Get_MaximumSet_Gen.json // this example is just showing the usage of "DataflowResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -538,7 +538,7 @@ public async Task Exists_DataflowGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_DataflowGet() { - // Generated from example definition: 2024-11-01/Dataflow_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Dataflow_Get_MaximumSet_Gen.json // this example is just showing the usage of "DataflowResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointCollection.cs index 5a7b23188428..fe8f4f1b05bc 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_IotOperationsDataflowEndpointCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateADLSv2() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_ADLSv2.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_ADLSv2.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -65,7 +65,7 @@ public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateADLSv2() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateADX() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_ADX.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_ADX.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -114,7 +114,7 @@ public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateADX() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateAIO() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_AIO.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_AIO.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -167,7 +167,7 @@ public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateAIO() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateEventGrid() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_EventGrid.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_EventGrid.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -216,7 +216,7 @@ public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateEventGrid() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateEventHub() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_EventHub.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_EventHub.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -265,7 +265,7 @@ public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateEventHub() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateFabric() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_Fabric.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_Fabric.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -307,7 +307,7 @@ public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateFabric() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateKafka() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_Kafka.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_Kafka.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -372,7 +372,7 @@ public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateKafka() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateLocalStorage() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_LocalStorage.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_LocalStorage.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -414,7 +414,7 @@ public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateLocalStorage() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateMQTT() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MQTT.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_MQTT.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -473,7 +473,7 @@ public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdateMQTT() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdate() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -617,7 +617,7 @@ public async Task CreateOrUpdate_DataflowEndpointCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_DataflowEndpointGet() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_Get_MaximumSet_Gen.json // this example is just showing the usage of "DataflowEndpointResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -651,7 +651,7 @@ public async Task Get_DataflowEndpointGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_DataflowEndpointListByResourceGroup() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -687,7 +687,7 @@ public async Task GetAll_DataflowEndpointListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_DataflowEndpointGet() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_Get_MaximumSet_Gen.json // this example is just showing the usage of "DataflowEndpointResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -717,7 +717,7 @@ public async Task Exists_DataflowEndpointGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_DataflowEndpointGet() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_Get_MaximumSet_Gen.json // this example is just showing the usage of "DataflowEndpointResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointResource.cs index a625776d2c9d..ac51f4fb1e4f 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowEndpointResource.cs @@ -20,7 +20,7 @@ public partial class Sample_IotOperationsDataflowEndpointResource [Ignore("Only validating compilation of examples")] public async Task Get_DataflowEndpointGet() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_Get_MaximumSet_Gen.json // this example is just showing the usage of "DataflowEndpointResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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_DataflowEndpointGet() [Ignore("Only validating compilation of examples")] public async Task Delete_DataflowEndpointDelete() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_Delete_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_Delete_MaximumSet_Gen.json // this example is just showing the usage of "DataflowEndpointResource_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_DataflowEndpointDelete() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowEndpointCreateOrUpdateADLSv2() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_ADLSv2.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_ADLSv2.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -120,7 +120,7 @@ public async Task Update_DataflowEndpointCreateOrUpdateADLSv2() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowEndpointCreateOrUpdateADX() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_ADX.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_ADX.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -166,7 +166,7 @@ public async Task Update_DataflowEndpointCreateOrUpdateADX() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowEndpointCreateOrUpdateAIO() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_AIO.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_AIO.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -216,7 +216,7 @@ public async Task Update_DataflowEndpointCreateOrUpdateAIO() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowEndpointCreateOrUpdateEventGrid() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_EventGrid.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_EventGrid.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -262,7 +262,7 @@ public async Task Update_DataflowEndpointCreateOrUpdateEventGrid() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowEndpointCreateOrUpdateEventHub() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_EventHub.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_EventHub.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -308,7 +308,7 @@ public async Task Update_DataflowEndpointCreateOrUpdateEventHub() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowEndpointCreateOrUpdateFabric() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_Fabric.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_Fabric.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -347,7 +347,7 @@ public async Task Update_DataflowEndpointCreateOrUpdateFabric() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowEndpointCreateOrUpdateKafka() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_Kafka.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_Kafka.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -409,7 +409,7 @@ public async Task Update_DataflowEndpointCreateOrUpdateKafka() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowEndpointCreateOrUpdateLocalStorage() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_LocalStorage.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_LocalStorage.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -448,7 +448,7 @@ public async Task Update_DataflowEndpointCreateOrUpdateLocalStorage() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowEndpointCreateOrUpdateMQTT() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MQTT.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_MQTT.json // this example is just showing the usage of "DataflowEndpointResource_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 @@ -504,7 +504,7 @@ public async Task Update_DataflowEndpointCreateOrUpdateMQTT() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowEndpointCreateOrUpdate() { - // Generated from example definition: 2024-11-01/DataflowEndpoint_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowEndpoint_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "DataflowEndpointResource_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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileCollection.cs index ab1001d1c18b..3a52b10c42ed 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileCollection.cs @@ -20,7 +20,7 @@ public partial class Sample_IotOperationsDataflowProfileCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowProfileCreateOrUpdate() { - // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowProfile_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "DataflowProfileResource_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_DataflowProfileCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowProfileCreateOrUpdateMinimal() { - // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_Minimal.json + // Generated from example definition: 2025-04-01/DataflowProfile_CreateOrUpdate_Minimal.json // this example is just showing the usage of "DataflowProfileResource_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 @@ -109,7 +109,7 @@ public async Task CreateOrUpdate_DataflowProfileCreateOrUpdateMinimal() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_DataflowProfileCreateOrUpdateMulti() { - // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_Multi.json + // Generated from example definition: 2025-04-01/DataflowProfile_CreateOrUpdate_Multi.json // this example is just showing the usage of "DataflowProfileResource_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 @@ -151,7 +151,7 @@ public async Task CreateOrUpdate_DataflowProfileCreateOrUpdateMulti() [Ignore("Only validating compilation of examples")] public async Task Get_DataflowProfileGet() { - // Generated from example definition: 2024-11-01/DataflowProfile_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowProfile_Get_MaximumSet_Gen.json // this example is just showing the usage of "DataflowProfileResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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 Get_DataflowProfileGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_DataflowProfileListByResourceGroup() { - // Generated from example definition: 2024-11-01/DataflowProfile_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowProfile_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "DataflowProfileResource_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 @@ -221,7 +221,7 @@ public async Task GetAll_DataflowProfileListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_DataflowProfileGet() { - // Generated from example definition: 2024-11-01/DataflowProfile_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowProfile_Get_MaximumSet_Gen.json // this example is just showing the usage of "DataflowProfileResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -251,7 +251,7 @@ public async Task Exists_DataflowProfileGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_DataflowProfileGet() { - // Generated from example definition: 2024-11-01/DataflowProfile_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowProfile_Get_MaximumSet_Gen.json // this example is just showing the usage of "DataflowProfileResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileResource.cs index 7f685cfb02cd..2f26b4ceb91f 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowProfileResource.cs @@ -20,7 +20,7 @@ public partial class Sample_IotOperationsDataflowProfileResource [Ignore("Only validating compilation of examples")] public async Task Get_DataflowProfileGet() { - // Generated from example definition: 2024-11-01/DataflowProfile_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowProfile_Get_MaximumSet_Gen.json // this example is just showing the usage of "DataflowProfileResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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_DataflowProfileGet() [Ignore("Only validating compilation of examples")] public async Task Delete_DataflowProfileDelete() { - // Generated from example definition: 2024-11-01/DataflowProfile_Delete_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowProfile_Delete_MaximumSet_Gen.json // this example is just showing the usage of "DataflowProfileResource_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_DataflowProfileDelete() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowProfileCreateOrUpdate() { - // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/DataflowProfile_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "DataflowProfileResource_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 @@ -122,7 +122,7 @@ public async Task Update_DataflowProfileCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowProfileCreateOrUpdateMinimal() { - // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_Minimal.json + // Generated from example definition: 2025-04-01/DataflowProfile_CreateOrUpdate_Minimal.json // this example is just showing the usage of "DataflowProfileResource_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 @@ -161,7 +161,7 @@ public async Task Update_DataflowProfileCreateOrUpdateMinimal() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowProfileCreateOrUpdateMulti() { - // Generated from example definition: 2024-11-01/DataflowProfile_CreateOrUpdate_Multi.json + // Generated from example definition: 2025-04-01/DataflowProfile_CreateOrUpdate_Multi.json // this example is just showing the usage of "DataflowProfileResource_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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowResource.cs index 399b936a023e..03e045ff8ab0 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsDataflowResource.cs @@ -20,7 +20,7 @@ public partial class Sample_IotOperationsDataflowResource [Ignore("Only validating compilation of examples")] public async Task Get_DataflowGet() { - // Generated from example definition: 2024-11-01/Dataflow_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Dataflow_Get_MaximumSet_Gen.json // this example is just showing the usage of "DataflowResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -52,7 +52,7 @@ public async Task Get_DataflowGet() [Ignore("Only validating compilation of examples")] public async Task Delete_DataflowDelete() { - // Generated from example definition: 2024-11-01/Dataflow_Delete_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Dataflow_Delete_MaximumSet_Gen.json // this example is just showing the usage of "DataflowResource_Delete" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -80,7 +80,7 @@ public async Task Delete_DataflowDelete() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowCreateOrUpdateComplexContextualization() { - // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_ComplexContextualization.json + // Generated from example definition: 2025-04-01/Dataflow_CreateOrUpdate_ComplexContextualization.json // this example is just showing the usage of "DataflowResource_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 @@ -144,7 +144,7 @@ public async Task Update_DataflowCreateOrUpdateComplexContextualization() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowCreateOrUpdateComplexEventHub() { - // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_ComplexEventHub.json + // Generated from example definition: 2025-04-01/Dataflow_CreateOrUpdate_ComplexEventHub.json // this example is just showing the usage of "DataflowResource_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 @@ -222,7 +222,7 @@ public async Task Update_DataflowCreateOrUpdateComplexEventHub() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowCreateOrUpdateFilterToTopic() { - // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_FilterToTopic.json + // Generated from example definition: 2025-04-01/Dataflow_CreateOrUpdate_FilterToTopic.json // this example is just showing the usage of "DataflowResource_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 @@ -290,7 +290,7 @@ public async Task Update_DataflowCreateOrUpdateFilterToTopic() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowCreateOrUpdate() { - // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Dataflow_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "DataflowResource_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 @@ -365,7 +365,7 @@ public async Task Update_DataflowCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowCreateOrUpdateSimpleEventGrid() { - // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_SimpleEventGrid.json + // Generated from example definition: 2025-04-01/Dataflow_CreateOrUpdate_SimpleEventGrid.json // this example is just showing the usage of "DataflowResource_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 @@ -417,7 +417,7 @@ public async Task Update_DataflowCreateOrUpdateSimpleEventGrid() [Ignore("Only validating compilation of examples")] public async Task Update_DataflowCreateOrUpdateSimpleFabric() { - // Generated from example definition: 2024-11-01/Dataflow_CreateOrUpdate_SimpleFabric.json + // Generated from example definition: 2025-04-01/Dataflow_CreateOrUpdate_SimpleFabric.json // this example is just showing the usage of "DataflowResource_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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceCollection.cs index 8ccae2220ee2..daef37664495 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceCollection.cs @@ -22,7 +22,7 @@ public partial class Sample_IotOperationsInstanceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_InstanceCreateOrUpdate() { - // Generated from example definition: 2024-11-01/Instance_CreateOrUpdate_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Instance_CreateOrUpdate_MaximumSet_Gen.json // this example is just showing the usage of "InstanceResource_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 @@ -68,7 +68,7 @@ public async Task CreateOrUpdate_InstanceCreateOrUpdate() [Ignore("Only validating compilation of examples")] public async Task Get_InstanceGet() { - // Generated from example definition: 2024-11-01/Instance_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Instance_Get_MaximumSet_Gen.json // this example is just showing the usage of "InstanceResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -101,7 +101,7 @@ public async Task Get_InstanceGet() [Ignore("Only validating compilation of examples")] public async Task GetAll_InstanceListByResourceGroup() { - // Generated from example definition: 2024-11-01/Instance_ListByResourceGroup_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Instance_ListByResourceGroup_MaximumSet_Gen.json // this example is just showing the usage of "InstanceResource_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 @@ -136,7 +136,7 @@ public async Task GetAll_InstanceListByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_InstanceGet() { - // Generated from example definition: 2024-11-01/Instance_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Instance_Get_MaximumSet_Gen.json // this example is just showing the usage of "InstanceResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -165,7 +165,7 @@ public async Task Exists_InstanceGet() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_InstanceGet() { - // Generated from example definition: 2024-11-01/Instance_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Instance_Get_MaximumSet_Gen.json // this example is just showing the usage of "InstanceResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceResource.cs index 00889943d261..5386224484b7 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_IotOperationsInstanceResource.cs @@ -21,7 +21,7 @@ public partial class Sample_IotOperationsInstanceResource [Ignore("Only validating compilation of examples")] public async Task Get_InstanceGet() { - // Generated from example definition: 2024-11-01/Instance_Get_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Instance_Get_MaximumSet_Gen.json // this example is just showing the usage of "InstanceResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details 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_InstanceGet() [Ignore("Only validating compilation of examples")] public async Task Delete_InstanceDelete() { - // Generated from example definition: 2024-11-01/Instance_Delete_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Instance_Delete_MaximumSet_Gen.json // this example is just showing the usage of "InstanceResource_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 @@ -77,7 +77,7 @@ public async Task Delete_InstanceDelete() [Ignore("Only validating compilation of examples")] public async Task Update_InstanceUpdate() { - // Generated from example definition: 2024-11-01/Instance_Update_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Instance_Update_MaximumSet_Gen.json // this example is just showing the usage of "InstanceResource_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/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 07082aafb691..1536d8db0927 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -20,7 +20,7 @@ public partial class Sample_SubscriptionResourceExtensions [Ignore("Only validating compilation of examples")] public async Task GetIotOperationsInstances_InstanceListBySubscription() { - // Generated from example definition: 2024-11-01/Instance_ListBySubscription_MaximumSet_Gen.json + // Generated from example definition: 2025-04-01/Instance_ListBySubscription_MaximumSet_Gen.json // this example is just showing the usage of "InstanceResource_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 diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/ArmIotOperationsModelFactory.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/ArmIotOperationsModelFactory.cs index 81a2f6961d81..257a1dfd23ea 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/ArmIotOperationsModelFactory.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/ArmIotOperationsModelFactory.cs @@ -49,10 +49,19 @@ public static IotOperationsInstanceData IotOperationsInstanceData(ResourceIdenti /// The status of the last operation. /// The Azure IoT Operations version. /// The reference to the Schema Registry for this AIO Instance. + /// The features of the AIO Instance. /// A new instance for mocking. - public static IotOperationsInstanceProperties IotOperationsInstanceProperties(string description = null, IotOperationsProvisioningState? provisioningState = null, string version = null, ResourceIdentifier schemaRegistryRefResourceId = null) + public static IotOperationsInstanceProperties IotOperationsInstanceProperties(string description = null, IotOperationsProvisioningState? provisioningState = null, string version = null, ResourceIdentifier schemaRegistryRefResourceId = null, IDictionary features = null) { - return new IotOperationsInstanceProperties(description, provisioningState, version, schemaRegistryRefResourceId != null ? new SchemaRegistryRef(schemaRegistryRefResourceId, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); + features ??= new Dictionary(); + + return new IotOperationsInstanceProperties( + description, + provisioningState, + version, + schemaRegistryRefResourceId != null ? new SchemaRegistryRef(schemaRegistryRefResourceId, serializedAdditionalRawData: null) : null, + features, + serializedAdditionalRawData: null); } /// Initializes a new instance of . diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/IotOperationsExtensions.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/IotOperationsExtensions.cs index 76652d258092..ee46f33feb99 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/IotOperationsExtensions.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/IotOperationsExtensions.cs @@ -214,7 +214,7 @@ public static IotOperationsInstanceCollection GetIotOperationsInstances(this Res /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -252,7 +252,7 @@ public static async Task> GetIotOperatio /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -290,7 +290,7 @@ public static Response GetIotOperationsInstance(t /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -326,7 +326,7 @@ public static AsyncPageable GetIotOperationsInsta /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsResourceGroupResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsResourceGroupResource.cs index c61784d10f4a..e72dca208313 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsResourceGroupResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsResourceGroupResource.cs @@ -53,7 +53,7 @@ public virtual IotOperationsInstanceCollection GetIotOperationsInstances() /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -84,7 +84,7 @@ public virtual async Task> GetIotOperati /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsSubscriptionResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsSubscriptionResource.cs index af819a8e6e37..afa3ce873b0c 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsSubscriptionResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Extensions/MockableIotOperationsSubscriptionResource.cs @@ -52,7 +52,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -82,7 +82,7 @@ public virtual AsyncPageable GetIotOperationsInst /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationCollection.cs index 2a905732e2dd..c1fb3713a3df 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrU /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string au /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAs /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancel /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string authenticationName, /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string authenticationName, CancellationToke /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationResource.cs index 2cb2a50a0086..1059b33131d8 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthenticationResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Cancellat /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationCollection.cs index 93e0d25c6b5f..8816d5d02efa 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUp /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string aut /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsy /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancell /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string authorizationName, /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string authorizationName, CancellationToken /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationResource.cs index 54adbeb12365..392f26166f6a 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerAuthorizationResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(Cancellati /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerCollection.cs index 5331bfff92f5..3dc365b079c1 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrUpd /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUnti /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(string /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string brokerName, Canc /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancellati /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken ca /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string brokerName, Cancell /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string brokerName, CancellationToken cancel /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIfEx /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerCollection.cs index c68e6df73e83..fd360f84f115 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Cre /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate( /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string listener /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Ca /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancellation /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string listenerName, Cance /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string listenerName, CancellationToken canc /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerResource.cs index 4f9676032a2c..db36be170e6d 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerListenerResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsyn /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationTok /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> Upd /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerResource.cs index 21c066d6a4fd..4fc9c3126d0d 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsBrokerResource.cs @@ -108,7 +108,7 @@ public virtual IotOperationsBrokerListenerCollection GetIotOperationsBrokerListe /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> GetIotO /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -177,7 +177,7 @@ public virtual IotOperationsBrokerAuthenticationCollection GetIotOperationsBroke /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> G /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -246,7 +246,7 @@ public virtual IotOperationsBrokerAuthorizationCollection GetIotOperationsBroker /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -277,7 +277,7 @@ public virtual async Task> Ge /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -308,7 +308,7 @@ public virtual Response GetIotOperatio /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -348,7 +348,7 @@ public virtual async Task> GetAsync(Cancel /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -388,7 +388,7 @@ public virtual Response Get(CancellationToken cance /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -430,7 +430,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -472,7 +472,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -518,7 +518,7 @@ public virtual async Task> UpdateAsync /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowCollection.cs index ea521ae9658e..10ec511cf9e4 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string dataflowName, /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string dataflowName, Cance /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string dataflowName, CancellationToken canc /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointCollection.cs index 79d1d438bc3f..37c17566dcce 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> C /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdat /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string datafl /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync( /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancellati /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string dataflowEndpointNam /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string dataflowEndpointName, CancellationTo /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointResource.cs index ec4dc201e2ef..4e47c8fa7046 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowEndpointResource.cs @@ -101,7 +101,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetAs /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -181,7 +181,7 @@ public virtual Response Get(CancellationT /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -223,7 +223,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -265,7 +265,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -311,7 +311,7 @@ public virtual async Task> U /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileCollection.cs index 1fe882d17472..87c493e11842 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileCollection.cs @@ -64,7 +64,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -113,7 +113,7 @@ public virtual async Task> Cr /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -162,7 +162,7 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -207,7 +207,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -252,7 +252,7 @@ public virtual Response Get(string dataflo /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -282,7 +282,7 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -355,7 +355,7 @@ public virtual async Task> ExistsAsync(string dataflowProfileName /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -398,7 +398,7 @@ public virtual Response Exists(string dataflowProfileName, CancellationTok /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -443,7 +443,7 @@ public virtual async Task /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileResource.cs index 291abc4283b7..2d9e22660860 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowProfileResource.cs @@ -108,7 +108,7 @@ public virtual IotOperationsDataflowCollection GetIotOperationsDataflows() /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -139,7 +139,7 @@ public virtual async Task> GetIotOperati /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -170,7 +170,7 @@ public virtual Response GetIotOperationsDataflow( /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> GetAsy /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -250,7 +250,7 @@ public virtual Response Get(CancellationTo /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -292,7 +292,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -334,7 +334,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -380,7 +380,7 @@ public virtual async Task> Up /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowResource.cs index 779f4114c9f1..0774f12ca11f 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsDataflowResource.cs @@ -102,7 +102,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -142,7 +142,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -182,7 +182,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -224,7 +224,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -266,7 +266,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -312,7 +312,7 @@ public virtual async Task> UpdateAsy /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceCollection.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceCollection.cs index 31af78f0ebba..5f8c104b5112 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceCollection.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrU /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUn /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(stri /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string instanceName, /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(Cancella /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string instanceName, Cance /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string instanceName, CancellationToken canc /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIf /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceResource.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceResource.cs index eb00248a5e78..69888259a67f 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceResource.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/IotOperationsInstanceResource.cs @@ -110,7 +110,7 @@ public virtual IotOperationsBrokerCollection GetIotOperationsBrokers() /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -141,7 +141,7 @@ public virtual async Task> GetIotOperation /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -179,7 +179,7 @@ public virtual IotOperationsDataflowProfileCollection GetIotOperationsDataflowPr /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -210,7 +210,7 @@ public virtual async Task> GetIot /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -248,7 +248,7 @@ public virtual IotOperationsDataflowEndpointCollection GetIotOperationsDataflowE /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -279,7 +279,7 @@ public virtual async Task> GetIo /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -310,7 +310,7 @@ public virtual Response GetIotOperationsD /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -350,7 +350,7 @@ public virtual async Task> GetAsync(Canc /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -390,7 +390,7 @@ public virtual Response Get(CancellationToken can /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -432,7 +432,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -474,7 +474,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -516,7 +516,7 @@ public virtual async Task> UpdateAsync(I /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -558,7 +558,7 @@ public virtual Response Update(IotOperationsInsta /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -620,7 +620,7 @@ public virtual async Task> AddTagAsync(s /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -682,7 +682,7 @@ public virtual Response AddTag(string key, string /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -739,7 +739,7 @@ public virtual async Task> SetTagsAsync( /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -796,7 +796,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource @@ -856,7 +856,7 @@ public virtual async Task> RemoveTagAsyn /// /// /// Default Api Version - /// 2024-11-01 + /// 2025-04-01 /// /// /// Resource diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceFeature.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceFeature.Serialization.cs new file mode 100644 index 000000000000..f64eababbcd6 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceFeature.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.IotOperations.Models +{ + public partial class InstanceFeature : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(InstanceFeature)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Mode)) + { + writer.WritePropertyName("mode"u8); + writer.WriteStringValue(Mode.Value.ToString()); + } + if (Optional.IsCollectionDefined(Settings)) + { + writer.WritePropertyName("settings"u8); + writer.WriteStartObject(); + foreach (var item in Settings) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value.ToString()); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + InstanceFeature IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InstanceFeature)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInstanceFeature(document.RootElement, options); + } + + internal static InstanceFeature DeserializeInstanceFeature(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + InstanceFeatureMode? mode = default; + IDictionary settings = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("mode"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mode = new InstanceFeatureMode(property.Value.GetString()); + continue; + } + if (property.NameEquals("settings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, new IotOperationsOperationalMode(property0.Value.GetString())); + } + settings = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new InstanceFeature(mode, settings ?? 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(InstanceFeature)} does not support writing '{options.Format}' format."); + } + } + + InstanceFeature IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInstanceFeature(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InstanceFeature)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceFeature.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceFeature.cs new file mode 100644 index 000000000000..7c3a878a78de --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceFeature.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.IotOperations.Models +{ + /// The features of the AIO Instance. + public partial class InstanceFeature + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 InstanceFeature() + { + Settings = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The state of the feature. + /// The settings of the feature. + /// Keeps track of any properties unknown to the library. + internal InstanceFeature(InstanceFeatureMode? mode, IDictionary settings, IDictionary serializedAdditionalRawData) + { + Mode = mode; + Settings = settings; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The state of the feature. + public InstanceFeatureMode? Mode { get; set; } + /// The settings of the feature. + public IDictionary Settings { get; } + } +} diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceFeatureMode.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceFeatureMode.cs new file mode 100644 index 000000000000..f32fc9dcb482 --- /dev/null +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/InstanceFeatureMode.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.IotOperations.Models +{ + /// The enum defining mode of a feature. + public readonly partial struct InstanceFeatureMode : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public InstanceFeatureMode(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StableValue = "Stable"; + private const string PreviewValue = "Preview"; + private const string DisabledValue = "Disabled"; + + /// Opt in to enable a stable feature. + public static InstanceFeatureMode Stable { get; } = new InstanceFeatureMode(StableValue); + /// Opt in to enable a preview feature. + public static InstanceFeatureMode Preview { get; } = new InstanceFeatureMode(PreviewValue); + /// Opt out of a feature. + public static InstanceFeatureMode Disabled { get; } = new InstanceFeatureMode(DisabledValue); + /// Determines if two values are the same. + public static bool operator ==(InstanceFeatureMode left, InstanceFeatureMode right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(InstanceFeatureMode left, InstanceFeatureMode right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator InstanceFeatureMode(string value) => new InstanceFeatureMode(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is InstanceFeatureMode other && Equals(other); + /// + public bool Equals(InstanceFeatureMode 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/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.Serialization.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.Serialization.cs index ef79a1fab63c..b2504926eb02 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.Serialization.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.Serialization.cs @@ -51,6 +51,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("schemaRegistryRef"u8); writer.WriteObjectValue(SchemaRegistryRef, options); + if (Optional.IsCollectionDefined(Features)) + { + writer.WritePropertyName("features"u8); + writer.WriteStartObject(); + foreach (var item in Features) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -92,6 +103,7 @@ internal static IotOperationsInstanceProperties DeserializeIotOperationsInstance IotOperationsProvisioningState? provisioningState = default; string version = default; SchemaRegistryRef schemaRegistryRef = default; + IDictionary features = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -120,13 +132,33 @@ internal static IotOperationsInstanceProperties DeserializeIotOperationsInstance schemaRegistryRef = SchemaRegistryRef.DeserializeSchemaRegistryRef(property.Value, options); continue; } + if (property.NameEquals("features"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, InstanceFeature.DeserializeInstanceFeature(property0.Value, options)); + } + features = dictionary; + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); } } serializedAdditionalRawData = rawDataDictionary; - return new IotOperationsInstanceProperties(description, provisioningState, version, schemaRegistryRef, serializedAdditionalRawData); + return new IotOperationsInstanceProperties( + description, + provisioningState, + version, + schemaRegistryRef, + features ?? new ChangeTrackingDictionary(), + serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.cs index da45d642b4d5..f58c2515caa6 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/Models/IotOperationsInstanceProperties.cs @@ -54,6 +54,7 @@ public IotOperationsInstanceProperties(SchemaRegistryRef schemaRegistryRef) Argument.AssertNotNull(schemaRegistryRef, nameof(schemaRegistryRef)); SchemaRegistryRef = schemaRegistryRef; + Features = new ChangeTrackingDictionary(); } /// Initializes a new instance of . @@ -61,13 +62,15 @@ public IotOperationsInstanceProperties(SchemaRegistryRef schemaRegistryRef) /// The status of the last operation. /// The Azure IoT Operations version. /// The reference to the Schema Registry for this AIO Instance. + /// The features of the AIO Instance. /// Keeps track of any properties unknown to the library. - internal IotOperationsInstanceProperties(string description, IotOperationsProvisioningState? provisioningState, string version, SchemaRegistryRef schemaRegistryRef, IDictionary serializedAdditionalRawData) + internal IotOperationsInstanceProperties(string description, IotOperationsProvisioningState? provisioningState, string version, SchemaRegistryRef schemaRegistryRef, IDictionary features, IDictionary serializedAdditionalRawData) { Description = description; ProvisioningState = provisioningState; Version = version; SchemaRegistryRef = schemaRegistryRef; + Features = features; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -90,5 +93,8 @@ public ResourceIdentifier SchemaRegistryRefResourceId get => SchemaRegistryRef is null ? default : SchemaRegistryRef.ResourceId; set => SchemaRegistryRef = new SchemaRegistryRef(value); } + + /// The features of the AIO Instance. + public IDictionary Features { get; } } } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthenticationRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthenticationRestOperations.cs index f8249f3cc94d..2c606fe20796 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthenticationRestOperations.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthenticationRestOperations.cs @@ -32,7 +32,7 @@ public BrokerAuthenticationRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-11-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthorizationRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthorizationRestOperations.cs index 5b465eb60fc6..512491218cb8 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthorizationRestOperations.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerAuthorizationRestOperations.cs @@ -32,7 +32,7 @@ public BrokerAuthorizationRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-11-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerListenerRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerListenerRestOperations.cs index 21c3440b6825..09cae3c99478 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerListenerRestOperations.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerListenerRestOperations.cs @@ -32,7 +32,7 @@ public BrokerListenerRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-11-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerRestOperations.cs index a97d1d01f335..95a0e7153976 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerRestOperations.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/BrokerRestOperations.cs @@ -32,7 +32,7 @@ public BrokerRestOperations(HttpPipeline pipeline, string applicationId, Uri end { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-11-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowEndpointRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowEndpointRestOperations.cs index 4006f7a48b9a..4c03cdab6af6 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowEndpointRestOperations.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowEndpointRestOperations.cs @@ -32,7 +32,7 @@ public DataflowEndpointRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-11-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowProfileRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowProfileRestOperations.cs index de82bbd53d59..058ff6f38625 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowProfileRestOperations.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowProfileRestOperations.cs @@ -32,7 +32,7 @@ public DataflowProfileRestOperations(HttpPipeline pipeline, string applicationId { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-11-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowRestOperations.cs index 47da4ba3f339..f72f5c92d829 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowRestOperations.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/DataflowRestOperations.cs @@ -32,7 +32,7 @@ public DataflowRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-11-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/InstanceRestOperations.cs b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/InstanceRestOperations.cs index 902afd49c1a7..e1a0a6a5d518 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/InstanceRestOperations.cs +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/src/Generated/RestOperations/InstanceRestOperations.cs @@ -32,7 +32,7 @@ public InstanceRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-11-01"; + _apiVersion = apiVersion ?? "2025-04-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tsp-location.yaml b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tsp-location.yaml index 25a72265e2a6..84d62743012b 100644 --- a/sdk/iotoperations/Azure.ResourceManager.IotOperations/tsp-location.yaml +++ b/sdk/iotoperations/Azure.ResourceManager.IotOperations/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/iotoperations/IoTOperations.Management -commit: 81f881effe41b9bdad29bc449dbf8a99ca894f2d +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/Azure.ResourceManager.Migrate.sln b/sdk/migrate/Azure.ResourceManager.Migrate/Azure.ResourceManager.Migrate.sln new file mode 100644 index 000000000000..495165badd49 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/Azure.ResourceManager.Migrate.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.Migrate.Samples", "samples\Azure.ResourceManager.Migrate.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Migrate", "src\Azure.ResourceManager.Migrate.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.Migrate.Tests", "tests\Azure.ResourceManager.Migrate.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/migrate/Azure.ResourceManager.Migrate/CHANGELOG.md b/sdk/migrate/Azure.ResourceManager.Migrate/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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/migrate/Azure.ResourceManager.Migrate/Directory.Build.props b/sdk/migrate/Azure.ResourceManager.Migrate/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/README.md b/sdk/migrate/Azure.ResourceManager.Migrate/README.md new file mode 100644 index 000000000000..63c311d9cf81 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure Migrate 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 Migrate management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.Migrate --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/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.net8.0.cs b/sdk/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.net8.0.cs new file mode 100644 index 000000000000..2ca976931e2b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.net8.0.cs @@ -0,0 +1,747 @@ +namespace Azure.ResourceManager.Migrate +{ + public partial class CompoundAssessmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected CompoundAssessmentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string compoundAssessmentName, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string compoundAssessmentName, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class CompoundAssessmentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CompoundAssessmentData() { } + public Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CompoundAssessmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected CompoundAssessmentResource() { } + public virtual Azure.ResourceManager.Migrate.CompoundAssessmentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DownloadUrl(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.Models.DownloadUrlContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadUrlAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.Models.DownloadUrlContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryCollection GetWebAppCompoundAssessmentSummaries() { throw null; } + public virtual Azure.Response GetWebAppCompoundAssessmentSummary(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWebAppCompoundAssessmentSummaryAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class MigrateExtensions + { + public static Azure.Response GetCompoundAssessment(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetCompoundAssessmentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Migrate.CompoundAssessmentResource GetCompoundAssessmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migrate.CompoundAssessmentCollection GetCompoundAssessments(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName) { throw null; } + public static Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryResource GetWebAppCompoundAssessmentSummaryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WebAppCompoundAssessmentSummaryCollection() { } + public virtual Azure.Response Exists(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebAppCompoundAssessmentSummaryData() { } + public Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WebAppCompoundAssessmentSummaryResource() { } + public virtual Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, string summaryName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} +namespace Azure.ResourceManager.Migrate.Mocking +{ + public partial class MockableMigrateArmClient : Azure.ResourceManager.ArmResource + { + protected MockableMigrateArmClient() { } + public virtual Azure.ResourceManager.Migrate.CompoundAssessmentResource GetCompoundAssessmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryResource GetWebAppCompoundAssessmentSummaryResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableMigrateResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableMigrateResourceGroupResource() { } + public virtual Azure.Response GetCompoundAssessment(string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCompoundAssessmentAsync(string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.CompoundAssessmentCollection GetCompoundAssessments(string projectName) { throw null; } + } +} +namespace Azure.ResourceManager.Migrate.Models +{ + public static partial class ArmMigrateModelFactory + { + public static Azure.ResourceManager.Migrate.CompoundAssessmentData CompoundAssessmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties properties = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails CompoundAssessmentDetails(System.DateTimeOffset? createdTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? updatedTimestamp = default(System.DateTimeOffset?), Azure.ResourceManager.Migrate.Models.AssessmentStatus status = default(Azure.ResourceManager.Migrate.Models.AssessmentStatus)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties CompoundAssessmentProperties(Azure.ResourceManager.Migrate.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Migrate.Models.ProvisioningState?), Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds targetAssessmentArmIds = null, string fallbackMachineAssessmentArmId = null, Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails details = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CostDetailsCommon CostDetailsCommon(Azure.ResourceManager.Migrate.Models.SavingsOption? savingOptions = default(Azure.ResourceManager.Migrate.Models.SavingsOption?), System.Collections.Generic.IEnumerable costDetail = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary DiscoveredLightSummary(int numberOfWebApps = 0, System.Collections.Generic.IEnumerable numberOfWebAppsPerType = null, System.Collections.Generic.IEnumerable numberOfWebServersPerType = null, int numberOfWebServers = 0, int numberOfServers = 0) { throw null; } + public static Azure.ResourceManager.Migrate.Models.DownloadUri DownloadUri(string assessmentReportUri = null, System.DateTimeOffset expireOn = default(System.DateTimeOffset)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.ManagementDetails ManagementDetails(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType? name = default(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType?), System.Collections.Generic.IEnumerable readinessSummary = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrationDetails MigrationDetails(System.Collections.Generic.IEnumerable readinessSummary = null, Azure.ResourceManager.Migrate.Models.MigrationType? migrationType = default(Azure.ResourceManager.Migrate.Models.MigrationType?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.NameValuePairCloudSuitabilityCommon NameValuePairCloudSuitabilityCommon(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon? name = default(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon?), int? value = default(int?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.NameValuePairCostType NameValuePairCostType(Azure.ResourceManager.Migrate.Models.CostType? name = default(Azure.ResourceManager.Migrate.Models.CostType?), float? value = default(float?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.NameValuePairSavingsType NameValuePairSavingsType(Azure.ResourceManager.Migrate.Models.SavingsType? name = default(Azure.ResourceManager.Migrate.Models.SavingsType?), float? value = default(float?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SavingsDetailsCommon SavingsDetailsCommon(Azure.ResourceManager.Migrate.Models.SavingsOption? savingOptions = default(Azure.ResourceManager.Migrate.Models.SavingsOption?), System.Collections.Generic.IEnumerable savingsDetail = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SourceDetails SourceDetails(Azure.ResourceManager.Migrate.Models.AssessmentSource? sourceName = default(Azure.ResourceManager.Migrate.Models.AssessmentSource?), Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? sourceType = default(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType?), Azure.ResourceManager.Migrate.Models.MigrationPlatform? platform = default(Azure.ResourceManager.Migrate.Models.MigrationPlatform?), int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.TargetDetails TargetDetails(Azure.ResourceManager.Migrate.Models.AzureTarget? targetName = default(Azure.ResourceManager.Migrate.Models.AzureTarget?), Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? targetType = default(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType?), Azure.ResourceManager.Migrate.Models.MigrationPlatform? platform = default(Azure.ResourceManager.Migrate.Models.MigrationPlatform?), int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.TargetSourcePair TargetSourcePair(Azure.ResourceManager.Migrate.Models.AssessmentSource? sourceRef = default(Azure.ResourceManager.Migrate.Models.AssessmentSource?), Azure.ResourceManager.Migrate.Models.AzureTarget? targetRef = default(Azure.ResourceManager.Migrate.Models.AzureTarget?), int? sourceCount = default(int?), int? targetCount = default(int?), Azure.ResourceManager.Migrate.Models.MigrationDetails migrationDetails = null, System.Collections.Generic.IEnumerable managementDetails = null, System.Collections.Generic.IEnumerable costDetails = null, System.Collections.Generic.IEnumerable savingsDetails = null, double? confidenceScore = default(double?)) { throw null; } + public static Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData WebAppCompoundAssessmentSummaryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties properties = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties WebAppCompoundAssessmentSummaryProperties(Azure.ResourceManager.Migrate.Models.SummaryType? summaryType = default(Azure.ResourceManager.Migrate.Models.SummaryType?), string summaryName = null, System.Collections.Generic.IEnumerable sources = null, System.Collections.Generic.IEnumerable targets = null, System.Collections.Generic.IEnumerable targetSourceMapping = null, System.Collections.Generic.IEnumerable costComponents = null, System.Collections.Generic.IEnumerable savingsComponents = null, string assessmentName = null, Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary discoveredLightSummary = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebAppsPerType WebAppsPerType(Azure.ResourceManager.Migrate.Models.WebAppType webAppType = default(Azure.ResourceManager.Migrate.Models.WebAppType), int count = 0) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebServersPerType WebServersPerType(Azure.ResourceManager.Migrate.Models.WebServerType webServerType = default(Azure.ResourceManager.Migrate.Models.WebServerType), int count = 0) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentSource : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentSource(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource IIS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource Machine { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource MySQLServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource OracleDatabase { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource OracleServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SAPInstance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SpringbootApplication { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SqlDatabase { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SqlInstance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource TomCat { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource Unknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource WebApps { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AssessmentSource other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.AssessmentSource left, Azure.ResourceManager.Migrate.Models.AssessmentSource right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AssessmentSource (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AssessmentSource left, Azure.ResourceManager.Migrate.Models.AssessmentSource right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentStatus(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Completed { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Created { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Deleted { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Failed { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Invalid { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus OutDated { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus OutOfSync { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Running { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Updated { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AssessmentStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.AssessmentStatus left, Azure.ResourceManager.Migrate.Models.AssessmentStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AssessmentStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AssessmentStatus left, Azure.ResourceManager.Migrate.Models.AssessmentStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureManagementOfferingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureManagementOfferingType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType AUM { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType AzMon { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType AzureBackup { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType No { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType SCOMMI { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType left, Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType left, Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureTarget : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureTarget(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AKS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget Avs { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureAppService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureAppServiceContainer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureSpringApps { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureSQLVM { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureVm { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget FlexServerPG { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget MySQLAzureFlexServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget OracleIaasVm { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget SAPAzureInstance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget SqlDatabase { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget SqlMI { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AzureTarget other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.AzureTarget left, Azure.ResourceManager.Migrate.Models.AzureTarget right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureTarget (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureTarget left, Azure.ResourceManager.Migrate.Models.AzureTarget right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CloudSuitabilityCommon : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CloudSuitabilityCommon(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon ConditionallySuitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon NotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon ReadinessUnknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon Suitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon SuitableWithWarnings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon left, Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon left, Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CompoundAssessmentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CompoundAssessmentDetails() { } + public System.DateTimeOffset? CreatedTimestamp { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessmentStatus Status { get { throw null; } } + public System.DateTimeOffset? UpdatedTimestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CompoundAssessmentProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CompoundAssessmentProperties(Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds targetAssessmentArmIds) { } + public Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails Details { get { throw null; } } + public string FallbackMachineAssessmentArmId { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds TargetAssessmentArmIds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CostDetailsCommon : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CostDetailsCommon() { } + public System.Collections.Generic.IReadOnlyList CostDetail { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.SavingsOption? SavingOptions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CostDetailsCommon System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CostDetailsCommon System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CostType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CostType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CostType DataProtectionService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonitoringService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAvsExternalStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAvsNetworkCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAvsNodeCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAzureHybridCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyBandwidthCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyComputeCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyLicensingCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyLinuxAzureHybridCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyManagementCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyPremiumStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyPremiumV2StorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlySecurityCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyStandardHddStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyStandardSsdStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyUltraDiskCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyUltraStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType PatchingService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType TotalMonthlyCost { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.CostType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.CostType left, Azure.ResourceManager.Migrate.Models.CostType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.CostType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.CostType left, Azure.ResourceManager.Migrate.Models.CostType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DiscoveredLightSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DiscoveredLightSummary() { } + public int NumberOfServers { get { throw null; } } + public int NumberOfWebApps { get { throw null; } } + public System.Collections.Generic.IReadOnlyList NumberOfWebAppsPerType { get { throw null; } } + public int NumberOfWebServers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList NumberOfWebServersPerType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DownloadUri : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DownloadUri() { } + public string AssessmentReportUri { get { throw null; } } + public System.DateTimeOffset ExpireOn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUri System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUri System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DownloadUrlContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DownloadUrlContent() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUrlContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUrlContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ManagementDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ManagementDetails() { } + public Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType? Name { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReadinessSummary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.ManagementDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.ManagementDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrateWorkloadType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrateWorkloadType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Database { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Host { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Instance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Machine { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType ManagementServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Server { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Unknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType WebApplication { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType WebServer { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType left, Azure.ResourceManager.Migrate.Models.MigrateWorkloadType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.MigrateWorkloadType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType left, Azure.ResourceManager.Migrate.Models.MigrateWorkloadType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MigrationDetails() { } + public Azure.ResourceManager.Migrate.Models.MigrationType? MigrationType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReadinessSummary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.MigrationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.MigrationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationPlatform : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationPlatform(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform IaaS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform PaaS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform SaaS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.MigrationPlatform other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.MigrationPlatform left, Azure.ResourceManager.Migrate.Models.MigrationPlatform right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.MigrationPlatform (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.MigrationPlatform left, Azure.ResourceManager.Migrate.Models.MigrationPlatform right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrationType Rearchitect { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Rehost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Replatform { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Retain { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.MigrationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.MigrationType left, Azure.ResourceManager.Migrate.Models.MigrationType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.MigrationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.MigrationType left, Azure.ResourceManager.Migrate.Models.MigrationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NameValuePairCloudSuitabilityCommon : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NameValuePairCloudSuitabilityCommon() { } + public Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon? Name { get { throw null; } } + public int? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCloudSuitabilityCommon System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCloudSuitabilityCommon System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NameValuePairCostType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NameValuePairCostType() { } + public Azure.ResourceManager.Migrate.Models.CostType? Name { get { throw null; } } + public float? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCostType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCostType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NameValuePairSavingsType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NameValuePairSavingsType() { } + public Azure.ResourceManager.Migrate.Models.SavingsType? Name { get { throw null; } } + public float? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairSavingsType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairSavingsType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.ProvisioningState left, Azure.ResourceManager.Migrate.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.ProvisioningState left, Azure.ResourceManager.Migrate.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SavingsDetailsCommon : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SavingsDetailsCommon() { } + public Azure.ResourceManager.Migrate.Models.SavingsOption? SavingOptions { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsDetail { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SavingsDetailsCommon System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SavingsDetailsCommon System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SavingsOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SavingsOption(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SavingsOption CustomAzureOfferCode { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption None { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption RI1Year { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption RI3Year { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption SavingsPlan1Year { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption SavingsPlan3Year { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.SavingsOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.SavingsOption left, Azure.ResourceManager.Migrate.Models.SavingsOption right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.SavingsOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.SavingsOption left, Azure.ResourceManager.Migrate.Models.SavingsOption right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SavingsType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SavingsType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyAhubSqlCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyAzureHybridCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyLinuxAzureHybridCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyVcfByolCostDifference { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.SavingsType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.SavingsType left, Azure.ResourceManager.Migrate.Models.SavingsType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.SavingsType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.SavingsType left, Azure.ResourceManager.Migrate.Models.SavingsType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SourceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SourceDetails() { } + public int? Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrationPlatform? Platform { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessmentSource? SourceName { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? SourceType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SourceDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SourceDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SummaryType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SummaryType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SummaryType Strategy { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SummaryType Target { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SummaryType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.SummaryType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.SummaryType left, Azure.ResourceManager.Migrate.Models.SummaryType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.SummaryType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.SummaryType left, Azure.ResourceManager.Migrate.Models.SummaryType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TargetAssessmentArmIds : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TargetAssessmentArmIds() { } + public string Aks { get { throw null; } set { } } + public string AzureAppService { get { throw null; } set { } } + public string AzureAppServiceContainer { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TargetDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TargetDetails() { } + public int? Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrationPlatform? Platform { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureTarget? TargetName { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? TargetType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TargetSourcePair : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TargetSourcePair() { } + public double? ConfidenceScore { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostDetails { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ManagementDetails { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrationDetails MigrationDetails { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsDetails { get { throw null; } } + public int? SourceCount { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessmentSource? SourceRef { get { throw null; } } + public int? TargetCount { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureTarget? TargetRef { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetSourcePair System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetSourcePair System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebAppCompoundAssessmentSummaryProperties() { } + public string AssessmentName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostComponents { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary DiscoveredLightSummary { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsComponents { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Sources { get { throw null; } } + public string SummaryName { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.SummaryType? SummaryType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Targets { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TargetSourceMapping { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebAppsPerType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebAppsPerType() { } + public int Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.WebAppType WebAppType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppsPerType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppsPerType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WebAppType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WebAppType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebAppType ASPNET { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebAppType Java { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebAppType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.WebAppType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.WebAppType left, Azure.ResourceManager.Migrate.Models.WebAppType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.WebAppType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.WebAppType left, Azure.ResourceManager.Migrate.Models.WebAppType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class WebServersPerType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebServersPerType() { } + public int Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.WebServerType WebServerType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebServersPerType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebServersPerType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WebServerType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WebServerType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebServerType IIS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebServerType Tomcat { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebServerType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.WebServerType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.WebServerType left, Azure.ResourceManager.Migrate.Models.WebServerType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.WebServerType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.WebServerType left, Azure.ResourceManager.Migrate.Models.WebServerType right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.netstandard2.0.cs b/sdk/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.netstandard2.0.cs new file mode 100644 index 000000000000..2ca976931e2b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/api/Azure.ResourceManager.Migrate.netstandard2.0.cs @@ -0,0 +1,747 @@ +namespace Azure.ResourceManager.Migrate +{ + public partial class CompoundAssessmentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected CompoundAssessmentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string compoundAssessmentName, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string compoundAssessmentName, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class CompoundAssessmentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CompoundAssessmentData() { } + public Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CompoundAssessmentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected CompoundAssessmentResource() { } + public virtual Azure.ResourceManager.Migrate.CompoundAssessmentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation DownloadUrl(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.Models.DownloadUrlContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> DownloadUrlAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.Models.DownloadUrlContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryCollection GetWebAppCompoundAssessmentSummaries() { throw null; } + public virtual Azure.Response GetWebAppCompoundAssessmentSummary(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetWebAppCompoundAssessmentSummaryAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.CompoundAssessmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.Migrate.CompoundAssessmentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class MigrateExtensions + { + public static Azure.Response GetCompoundAssessment(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetCompoundAssessmentAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.Migrate.CompoundAssessmentResource GetCompoundAssessmentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.Migrate.CompoundAssessmentCollection GetCompoundAssessments(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string projectName) { throw null; } + public static Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryResource GetWebAppCompoundAssessmentSummaryResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected WebAppCompoundAssessmentSummaryCollection() { } + public virtual Azure.Response Exists(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string summaryName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebAppCompoundAssessmentSummaryData() { } + public Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected WebAppCompoundAssessmentSummaryResource() { } + public virtual Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, string summaryName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } +} +namespace Azure.ResourceManager.Migrate.Mocking +{ + public partial class MockableMigrateArmClient : Azure.ResourceManager.ArmResource + { + protected MockableMigrateArmClient() { } + public virtual Azure.ResourceManager.Migrate.CompoundAssessmentResource GetCompoundAssessmentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryResource GetWebAppCompoundAssessmentSummaryResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableMigrateResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableMigrateResourceGroupResource() { } + public virtual Azure.Response GetCompoundAssessment(string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCompoundAssessmentAsync(string projectName, string compoundAssessmentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.Migrate.CompoundAssessmentCollection GetCompoundAssessments(string projectName) { throw null; } + } +} +namespace Azure.ResourceManager.Migrate.Models +{ + public static partial class ArmMigrateModelFactory + { + public static Azure.ResourceManager.Migrate.CompoundAssessmentData CompoundAssessmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties properties = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails CompoundAssessmentDetails(System.DateTimeOffset? createdTimestamp = default(System.DateTimeOffset?), System.DateTimeOffset? updatedTimestamp = default(System.DateTimeOffset?), Azure.ResourceManager.Migrate.Models.AssessmentStatus status = default(Azure.ResourceManager.Migrate.Models.AssessmentStatus)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties CompoundAssessmentProperties(Azure.ResourceManager.Migrate.Models.ProvisioningState? provisioningState = default(Azure.ResourceManager.Migrate.Models.ProvisioningState?), Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds targetAssessmentArmIds = null, string fallbackMachineAssessmentArmId = null, Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails details = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CostDetailsCommon CostDetailsCommon(Azure.ResourceManager.Migrate.Models.SavingsOption? savingOptions = default(Azure.ResourceManager.Migrate.Models.SavingsOption?), System.Collections.Generic.IEnumerable costDetail = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary DiscoveredLightSummary(int numberOfWebApps = 0, System.Collections.Generic.IEnumerable numberOfWebAppsPerType = null, System.Collections.Generic.IEnumerable numberOfWebServersPerType = null, int numberOfWebServers = 0, int numberOfServers = 0) { throw null; } + public static Azure.ResourceManager.Migrate.Models.DownloadUri DownloadUri(string assessmentReportUri = null, System.DateTimeOffset expireOn = default(System.DateTimeOffset)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.ManagementDetails ManagementDetails(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType? name = default(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType?), System.Collections.Generic.IEnumerable readinessSummary = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrationDetails MigrationDetails(System.Collections.Generic.IEnumerable readinessSummary = null, Azure.ResourceManager.Migrate.Models.MigrationType? migrationType = default(Azure.ResourceManager.Migrate.Models.MigrationType?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.NameValuePairCloudSuitabilityCommon NameValuePairCloudSuitabilityCommon(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon? name = default(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon?), int? value = default(int?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.NameValuePairCostType NameValuePairCostType(Azure.ResourceManager.Migrate.Models.CostType? name = default(Azure.ResourceManager.Migrate.Models.CostType?), float? value = default(float?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.NameValuePairSavingsType NameValuePairSavingsType(Azure.ResourceManager.Migrate.Models.SavingsType? name = default(Azure.ResourceManager.Migrate.Models.SavingsType?), float? value = default(float?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SavingsDetailsCommon SavingsDetailsCommon(Azure.ResourceManager.Migrate.Models.SavingsOption? savingOptions = default(Azure.ResourceManager.Migrate.Models.SavingsOption?), System.Collections.Generic.IEnumerable savingsDetail = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SourceDetails SourceDetails(Azure.ResourceManager.Migrate.Models.AssessmentSource? sourceName = default(Azure.ResourceManager.Migrate.Models.AssessmentSource?), Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? sourceType = default(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType?), Azure.ResourceManager.Migrate.Models.MigrationPlatform? platform = default(Azure.ResourceManager.Migrate.Models.MigrationPlatform?), int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.TargetDetails TargetDetails(Azure.ResourceManager.Migrate.Models.AzureTarget? targetName = default(Azure.ResourceManager.Migrate.Models.AzureTarget?), Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? targetType = default(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType?), Azure.ResourceManager.Migrate.Models.MigrationPlatform? platform = default(Azure.ResourceManager.Migrate.Models.MigrationPlatform?), int? count = default(int?)) { throw null; } + public static Azure.ResourceManager.Migrate.Models.TargetSourcePair TargetSourcePair(Azure.ResourceManager.Migrate.Models.AssessmentSource? sourceRef = default(Azure.ResourceManager.Migrate.Models.AssessmentSource?), Azure.ResourceManager.Migrate.Models.AzureTarget? targetRef = default(Azure.ResourceManager.Migrate.Models.AzureTarget?), int? sourceCount = default(int?), int? targetCount = default(int?), Azure.ResourceManager.Migrate.Models.MigrationDetails migrationDetails = null, System.Collections.Generic.IEnumerable managementDetails = null, System.Collections.Generic.IEnumerable costDetails = null, System.Collections.Generic.IEnumerable savingsDetails = null, double? confidenceScore = default(double?)) { throw null; } + public static Azure.ResourceManager.Migrate.WebAppCompoundAssessmentSummaryData WebAppCompoundAssessmentSummaryData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties properties = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties WebAppCompoundAssessmentSummaryProperties(Azure.ResourceManager.Migrate.Models.SummaryType? summaryType = default(Azure.ResourceManager.Migrate.Models.SummaryType?), string summaryName = null, System.Collections.Generic.IEnumerable sources = null, System.Collections.Generic.IEnumerable targets = null, System.Collections.Generic.IEnumerable targetSourceMapping = null, System.Collections.Generic.IEnumerable costComponents = null, System.Collections.Generic.IEnumerable savingsComponents = null, string assessmentName = null, Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary discoveredLightSummary = null) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebAppsPerType WebAppsPerType(Azure.ResourceManager.Migrate.Models.WebAppType webAppType = default(Azure.ResourceManager.Migrate.Models.WebAppType), int count = 0) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebServersPerType WebServersPerType(Azure.ResourceManager.Migrate.Models.WebServerType webServerType = default(Azure.ResourceManager.Migrate.Models.WebServerType), int count = 0) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentSource : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentSource(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource IIS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource Machine { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource MySQLServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource OracleDatabase { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource OracleServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SAPInstance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SpringbootApplication { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SqlDatabase { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource SqlInstance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource TomCat { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource Unknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentSource WebApps { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AssessmentSource other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.AssessmentSource left, Azure.ResourceManager.Migrate.Models.AssessmentSource right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AssessmentSource (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AssessmentSource left, Azure.ResourceManager.Migrate.Models.AssessmentSource right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AssessmentStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AssessmentStatus(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Completed { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Created { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Deleted { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Failed { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Invalid { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus OutDated { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus OutOfSync { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Running { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AssessmentStatus Updated { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AssessmentStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.AssessmentStatus left, Azure.ResourceManager.Migrate.Models.AssessmentStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AssessmentStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AssessmentStatus left, Azure.ResourceManager.Migrate.Models.AssessmentStatus right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureManagementOfferingType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureManagementOfferingType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType AUM { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType AzMon { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType AzureBackup { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType No { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType SCOMMI { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType left, Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType left, Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct AzureTarget : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public AzureTarget(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AKS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget Avs { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureAppService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureAppServiceContainer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureSpringApps { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureSQLVM { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget AzureVm { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget FlexServerPG { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget MySQLAzureFlexServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget OracleIaasVm { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget SAPAzureInstance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget SqlDatabase { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget SqlMI { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.AzureTarget Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.AzureTarget other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.AzureTarget left, Azure.ResourceManager.Migrate.Models.AzureTarget right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.AzureTarget (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.AzureTarget left, Azure.ResourceManager.Migrate.Models.AzureTarget right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CloudSuitabilityCommon : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CloudSuitabilityCommon(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon ConditionallySuitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon NotSuitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon ReadinessUnknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon Suitable { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon SuitableWithWarnings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon left, Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon left, Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon right) { throw null; } + public override string ToString() { throw null; } + } + public partial class CompoundAssessmentDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CompoundAssessmentDetails() { } + public System.DateTimeOffset? CreatedTimestamp { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessmentStatus Status { get { throw null; } } + public System.DateTimeOffset? UpdatedTimestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CompoundAssessmentProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public CompoundAssessmentProperties(Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds targetAssessmentArmIds) { } + public Azure.ResourceManager.Migrate.Models.CompoundAssessmentDetails Details { get { throw null; } } + public string FallbackMachineAssessmentArmId { get { throw null; } set { } } + public Azure.ResourceManager.Migrate.Models.ProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds TargetAssessmentArmIds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CompoundAssessmentProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class CostDetailsCommon : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal CostDetailsCommon() { } + public System.Collections.Generic.IReadOnlyList CostDetail { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.SavingsOption? SavingOptions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CostDetailsCommon System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.CostDetailsCommon System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CostType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CostType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.CostType DataProtectionService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonitoringService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAvsExternalStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAvsNetworkCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAvsNodeCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyAzureHybridCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyBandwidthCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyComputeCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyLicensingCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyLinuxAzureHybridCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyManagementCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyPremiumStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyPremiumV2StorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlySecurityCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyStandardHddStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyStandardSsdStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyUltraDiskCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType MonthlyUltraStorageCost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType PatchingService { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.CostType TotalMonthlyCost { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.CostType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.CostType left, Azure.ResourceManager.Migrate.Models.CostType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.CostType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.CostType left, Azure.ResourceManager.Migrate.Models.CostType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DiscoveredLightSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DiscoveredLightSummary() { } + public int NumberOfServers { get { throw null; } } + public int NumberOfWebApps { get { throw null; } } + public System.Collections.Generic.IReadOnlyList NumberOfWebAppsPerType { get { throw null; } } + public int NumberOfWebServers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList NumberOfWebServersPerType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DownloadUri : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DownloadUri() { } + public string AssessmentReportUri { get { throw null; } } + public System.DateTimeOffset ExpireOn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUri System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUri System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DownloadUrlContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DownloadUrlContent() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUrlContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.DownloadUrlContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ManagementDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ManagementDetails() { } + public Azure.ResourceManager.Migrate.Models.AzureManagementOfferingType? Name { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReadinessSummary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.ManagementDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.ManagementDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrateWorkloadType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrateWorkloadType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Database { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Host { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Instance { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Machine { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType ManagementServer { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Server { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType Unknown { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType WebApplication { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrateWorkloadType WebServer { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType left, Azure.ResourceManager.Migrate.Models.MigrateWorkloadType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.MigrateWorkloadType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.MigrateWorkloadType left, Azure.ResourceManager.Migrate.Models.MigrateWorkloadType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class MigrationDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal MigrationDetails() { } + public Azure.ResourceManager.Migrate.Models.MigrationType? MigrationType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ReadinessSummary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.MigrationDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.MigrationDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationPlatform : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationPlatform(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform IaaS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform PaaS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform SaaS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationPlatform Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.MigrationPlatform other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.MigrationPlatform left, Azure.ResourceManager.Migrate.Models.MigrationPlatform right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.MigrationPlatform (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.MigrationPlatform left, Azure.ResourceManager.Migrate.Models.MigrationPlatform right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MigrationType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MigrationType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.MigrationType Rearchitect { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Rehost { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Replatform { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Retain { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.MigrationType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.MigrationType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.MigrationType left, Azure.ResourceManager.Migrate.Models.MigrationType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.MigrationType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.MigrationType left, Azure.ResourceManager.Migrate.Models.MigrationType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class NameValuePairCloudSuitabilityCommon : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NameValuePairCloudSuitabilityCommon() { } + public Azure.ResourceManager.Migrate.Models.CloudSuitabilityCommon? Name { get { throw null; } } + public int? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCloudSuitabilityCommon System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCloudSuitabilityCommon System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NameValuePairCostType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NameValuePairCostType() { } + public Azure.ResourceManager.Migrate.Models.CostType? Name { get { throw null; } } + public float? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCostType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairCostType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NameValuePairSavingsType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal NameValuePairSavingsType() { } + public Azure.ResourceManager.Migrate.Models.SavingsType? Name { get { throw null; } } + public float? Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairSavingsType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.NameValuePairSavingsType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Accepted { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Provisioning { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.ProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.ProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.ProvisioningState left, Azure.ResourceManager.Migrate.Models.ProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.ProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.ProvisioningState left, Azure.ResourceManager.Migrate.Models.ProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SavingsDetailsCommon : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SavingsDetailsCommon() { } + public Azure.ResourceManager.Migrate.Models.SavingsOption? SavingOptions { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsDetail { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SavingsDetailsCommon System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SavingsDetailsCommon System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SavingsOption : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SavingsOption(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SavingsOption CustomAzureOfferCode { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption None { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption RI1Year { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption RI3Year { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption SavingsPlan1Year { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsOption SavingsPlan3Year { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.SavingsOption other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.SavingsOption left, Azure.ResourceManager.Migrate.Models.SavingsOption right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.SavingsOption (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.SavingsOption left, Azure.ResourceManager.Migrate.Models.SavingsOption right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SavingsType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SavingsType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyAhubSqlCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyAzureHybridCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyLinuxAzureHybridCostSavings { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SavingsType MonthlyVcfByolCostDifference { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.SavingsType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.SavingsType left, Azure.ResourceManager.Migrate.Models.SavingsType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.SavingsType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.SavingsType left, Azure.ResourceManager.Migrate.Models.SavingsType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class SourceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal SourceDetails() { } + public int? Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrationPlatform? Platform { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessmentSource? SourceName { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? SourceType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SourceDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.SourceDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct SummaryType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public SummaryType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.SummaryType Strategy { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SummaryType Target { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.SummaryType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.SummaryType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.SummaryType left, Azure.ResourceManager.Migrate.Models.SummaryType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.SummaryType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.SummaryType left, Azure.ResourceManager.Migrate.Models.SummaryType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class TargetAssessmentArmIds : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public TargetAssessmentArmIds() { } + public string Aks { get { throw null; } set { } } + public string AzureAppService { get { throw null; } set { } } + public string AzureAppServiceContainer { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetAssessmentArmIds System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TargetDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TargetDetails() { } + public int? Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrationPlatform? Platform { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureTarget? TargetName { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrateWorkloadType? TargetType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TargetSourcePair : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TargetSourcePair() { } + public double? ConfidenceScore { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostDetails { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ManagementDetails { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.MigrationDetails MigrationDetails { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsDetails { get { throw null; } } + public int? SourceCount { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AssessmentSource? SourceRef { get { throw null; } } + public int? TargetCount { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.AzureTarget? TargetRef { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetSourcePair System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.TargetSourcePair System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebAppCompoundAssessmentSummaryProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebAppCompoundAssessmentSummaryProperties() { } + public string AssessmentName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList CostComponents { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.DiscoveredLightSummary DiscoveredLightSummary { get { throw null; } } + public System.Collections.Generic.IReadOnlyList SavingsComponents { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Sources { get { throw null; } } + public string SummaryName { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.SummaryType? SummaryType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Targets { get { throw null; } } + public System.Collections.Generic.IReadOnlyList TargetSourceMapping { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppCompoundAssessmentSummaryProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class WebAppsPerType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebAppsPerType() { } + public int Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.WebAppType WebAppType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppsPerType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebAppsPerType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WebAppType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WebAppType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebAppType ASPNET { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebAppType Java { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebAppType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.WebAppType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.WebAppType left, Azure.ResourceManager.Migrate.Models.WebAppType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.WebAppType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.WebAppType left, Azure.ResourceManager.Migrate.Models.WebAppType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class WebServersPerType : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal WebServersPerType() { } + public int Count { get { throw null; } } + public Azure.ResourceManager.Migrate.Models.WebServerType WebServerType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebServersPerType System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.Migrate.Models.WebServersPerType System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct WebServerType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public WebServerType(string value) { throw null; } + public static Azure.ResourceManager.Migrate.Models.WebServerType IIS { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebServerType Tomcat { get { throw null; } } + public static Azure.ResourceManager.Migrate.Models.WebServerType Unknown { get { throw null; } } + public bool Equals(Azure.ResourceManager.Migrate.Models.WebServerType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.Migrate.Models.WebServerType left, Azure.ResourceManager.Migrate.Models.WebServerType right) { throw null; } + public static implicit operator Azure.ResourceManager.Migrate.Models.WebServerType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.Migrate.Models.WebServerType left, Azure.ResourceManager.Migrate.Models.WebServerType right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/assets.json b/sdk/migrate/Azure.ResourceManager.Migrate/assets.json new file mode 100644 index 000000000000..7eb82a025442 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/migrate/Azure.ResourceManager.Migrate", + "Tag": "" +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Azure.ResourceManager.Migrate.Samples.csproj b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Azure.ResourceManager.Migrate.Samples.csproj new file mode 100644 index 000000000000..c8b72c599c4a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Azure.ResourceManager.Migrate.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Collection.cs new file mode 100644 index 000000000000..ceb677eed395 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Collection.cs @@ -0,0 +1,167 @@ +// 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.Migrate.Samples +{ + public partial class Sample_AssessedMachineV2Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this AssessedMachineV2Resource + AssessedMachineV2Collection collection = machineAssessmentV2.GetAssessedMachineV2s(); + + // invoke the operation + string assessedMachineName = "machine1"; + AssessedMachineV2Resource result = await collection.GetAsync(assessedMachineName); + + // 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 + AssessedMachineV2Data 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_AssessedMachinesV2OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedMachinesV2Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachineV2_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 MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this AssessedMachineV2Resource + AssessedMachineV2Collection collection = machineAssessmentV2.GetAssessedMachineV2s(); + + // invoke the operation and iterate over the result + int? pageSize = 13; + string continuationToken = "lsuhpxtnundds"; + int? totalRecordCount = 28; + await foreach (AssessedMachineV2Resource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // 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 + AssessedMachineV2Data 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_AssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this AssessedMachineV2Resource + AssessedMachineV2Collection collection = machineAssessmentV2.GetAssessedMachineV2s(); + + // invoke the operation + string assessedMachineName = "machine1"; + bool result = await collection.ExistsAsync(assessedMachineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this AssessedMachineV2Resource + AssessedMachineV2Collection collection = machineAssessmentV2.GetAssessedMachineV2s(); + + // invoke the operation + string assessedMachineName = "machine1"; + NullableResponse response = await collection.GetIfExistsAsync(assessedMachineName); + AssessedMachineV2Resource 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 + AssessedMachineV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Resource.cs new file mode 100644 index 000000000000..7966b6779ca5 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedMachineV2Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedMachineV2Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedMachineV2Resource created on azure + // for more information of creating AssessedMachineV2Resource, please refer to the document of AssessedMachineV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string assessedMachineName = "machine1"; + ResourceIdentifier assessedMachineV2ResourceId = AssessedMachineV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, assessedMachineName); + AssessedMachineV2Resource assessedMachineV2 = client.GetAssessedMachineV2Resource(assessedMachineV2ResourceId); + + // invoke the operation + AssessedMachineV2Resource result = await assessedMachineV2.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 + AssessedMachineV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Collection.cs new file mode 100644 index 000000000000..920e21ab0aaf --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Collection.cs @@ -0,0 +1,167 @@ +// 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.Migrate.Samples +{ + public partial class Sample_AssessedSqlDatabaseV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlDatabaseV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlDatabaseV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlDatabaseV3Resource + AssessedSqlDatabaseV3Collection collection = sqlAssessmentV3.GetAssessedSqlDatabaseV3s(); + + // invoke the operation + string assessedSqlDatabaseName = "db1"; + AssessedSqlDatabaseV3Resource result = await collection.GetAsync(assessedSqlDatabaseName); + + // 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 + AssessedSqlDatabaseV3Data 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_AssessedSqlDatabaseV3OperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlDatabaseV3Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV3_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 SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlDatabaseV3Resource + AssessedSqlDatabaseV3Collection collection = sqlAssessmentV3.GetAssessedSqlDatabaseV3s(); + + // invoke the operation and iterate over the result + int? pageSize = 11; + string continuationToken = "ahjkwi"; + int? totalRecordCount = 11; + await foreach (AssessedSqlDatabaseV3Resource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // 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 + AssessedSqlDatabaseV3Data 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_AssessedSqlDatabaseV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlDatabaseV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlDatabaseV3Resource + AssessedSqlDatabaseV3Collection collection = sqlAssessmentV3.GetAssessedSqlDatabaseV3s(); + + // invoke the operation + string assessedSqlDatabaseName = "db1"; + bool result = await collection.ExistsAsync(assessedSqlDatabaseName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedSqlDatabaseV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlDatabaseV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlDatabaseV3Resource + AssessedSqlDatabaseV3Collection collection = sqlAssessmentV3.GetAssessedSqlDatabaseV3s(); + + // invoke the operation + string assessedSqlDatabaseName = "db1"; + NullableResponse response = await collection.GetIfExistsAsync(assessedSqlDatabaseName); + AssessedSqlDatabaseV3Resource 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 + AssessedSqlDatabaseV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Resource.cs new file mode 100644 index 000000000000..ecce0772602a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlDatabaseV3Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedSqlDatabaseV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlDatabaseV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlDatabaseV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlDatabaseV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedSqlDatabaseV3Resource created on azure + // for more information of creating AssessedSqlDatabaseV3Resource, please refer to the document of AssessedSqlDatabaseV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string assessedSqlDatabaseName = "db1"; + ResourceIdentifier assessedSqlDatabaseV3ResourceId = AssessedSqlDatabaseV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, assessedSqlDatabaseName); + AssessedSqlDatabaseV3Resource assessedSqlDatabaseV3 = client.GetAssessedSqlDatabaseV3Resource(assessedSqlDatabaseV3ResourceId); + + // invoke the operation + AssessedSqlDatabaseV3Resource result = await assessedSqlDatabaseV3.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 + AssessedSqlDatabaseV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Collection.cs new file mode 100644 index 000000000000..f78028ae2435 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Collection.cs @@ -0,0 +1,167 @@ +// 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.Migrate.Samples +{ + public partial class Sample_AssessedSqlInstanceV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlInstanceV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlInstanceV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlInstanceV3Resource + AssessedSqlInstanceV3Collection collection = sqlAssessmentV3.GetAssessedSqlInstanceV3s(); + + // invoke the operation + string assessedSqlInstanceName = "sql1"; + AssessedSqlInstanceV3Resource result = await collection.GetAsync(assessedSqlInstanceName); + + // 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 + AssessedSqlInstanceV3Data 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_AssessedSqlInstanceV3OperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlInstanceV3Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV3_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 SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlInstanceV3Resource + AssessedSqlInstanceV3Collection collection = sqlAssessmentV3.GetAssessedSqlInstanceV3s(); + + // invoke the operation and iterate over the result + int? pageSize = 30; + string continuationToken = "tvblslp"; + int? totalRecordCount = 29; + await foreach (AssessedSqlInstanceV3Resource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // 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 + AssessedSqlInstanceV3Data 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_AssessedSqlInstanceV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlInstanceV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlInstanceV3Resource + AssessedSqlInstanceV3Collection collection = sqlAssessmentV3.GetAssessedSqlInstanceV3s(); + + // invoke the operation + string assessedSqlInstanceName = "sql1"; + bool result = await collection.ExistsAsync(assessedSqlInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedSqlInstanceV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlInstanceV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlInstanceV3Resource + AssessedSqlInstanceV3Collection collection = sqlAssessmentV3.GetAssessedSqlInstanceV3s(); + + // invoke the operation + string assessedSqlInstanceName = "sql1"; + NullableResponse response = await collection.GetIfExistsAsync(assessedSqlInstanceName); + AssessedSqlInstanceV3Resource 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 + AssessedSqlInstanceV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Resource.cs new file mode 100644 index 000000000000..f2e8bcf2a4d6 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlInstanceV3Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedSqlInstanceV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlInstanceV3OperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlInstanceV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlInstanceV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedSqlInstanceV3Resource created on azure + // for more information of creating AssessedSqlInstanceV3Resource, please refer to the document of AssessedSqlInstanceV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string assessedSqlInstanceName = "sql1"; + ResourceIdentifier assessedSqlInstanceV3ResourceId = AssessedSqlInstanceV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, assessedSqlInstanceName); + AssessedSqlInstanceV3Resource assessedSqlInstanceV3 = client.GetAssessedSqlInstanceV3Resource(assessedSqlInstanceV3ResourceId); + + // invoke the operation + AssessedSqlInstanceV3Resource result = await assessedSqlInstanceV3.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 + AssessedSqlInstanceV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Collection.cs new file mode 100644 index 000000000000..e55cd17b650b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Collection.cs @@ -0,0 +1,167 @@ +// 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.Migrate.Samples +{ + public partial class Sample_AssessedSqlMachineV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlMachinesV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlMachinesV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachineV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlMachineV3Resource + AssessedSqlMachineV3Collection collection = sqlAssessmentV3.GetAssessedSqlMachineV3s(); + + // invoke the operation + string assessedSqlMachineName = "machine1"; + AssessedSqlMachineV3Resource result = await collection.GetAsync(assessedSqlMachineName); + + // 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 + AssessedSqlMachineV3Data 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_AssessedSqlMachinesV3OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlMachinesV3Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachineV3_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 SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlMachineV3Resource + AssessedSqlMachineV3Collection collection = sqlAssessmentV3.GetAssessedSqlMachineV3s(); + + // invoke the operation and iterate over the result + int? pageSize = 27; + string continuationToken = "vzjkdmjvvkeuvm"; + int? totalRecordCount = 30; + await foreach (AssessedSqlMachineV3Resource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // 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 + AssessedSqlMachineV3Data 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_AssessedSqlMachinesV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlMachinesV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachineV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlMachineV3Resource + AssessedSqlMachineV3Collection collection = sqlAssessmentV3.GetAssessedSqlMachineV3s(); + + // invoke the operation + string assessedSqlMachineName = "machine1"; + bool result = await collection.ExistsAsync(assessedSqlMachineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedSqlMachinesV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlMachinesV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachineV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this AssessedSqlMachineV3Resource + AssessedSqlMachineV3Collection collection = sqlAssessmentV3.GetAssessedSqlMachineV3s(); + + // invoke the operation + string assessedSqlMachineName = "machine1"; + NullableResponse response = await collection.GetIfExistsAsync(assessedSqlMachineName); + AssessedSqlMachineV3Resource 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 + AssessedSqlMachineV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Resource.cs new file mode 100644 index 000000000000..9954c5daa2b4 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedSqlMachineV3Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedSqlMachineV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedSqlMachinesV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedSqlMachinesV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedSqlMachineV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedSqlMachineV3Resource created on azure + // for more information of creating AssessedSqlMachineV3Resource, please refer to the document of AssessedSqlMachineV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string assessedSqlMachineName = "machine1"; + ResourceIdentifier assessedSqlMachineV3ResourceId = AssessedSqlMachineV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, assessedSqlMachineName); + AssessedSqlMachineV3Resource assessedSqlMachineV3 = client.GetAssessedSqlMachineV3Resource(assessedSqlMachineV3ResourceId); + + // invoke the operation + AssessedSqlMachineV3Resource result = await assessedSqlMachineV3.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 + AssessedSqlMachineV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Collection.cs new file mode 100644 index 000000000000..4da4af3903e4 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Collection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedWebAppV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedWebAppsV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebAppsV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebAppV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this AssessedWebAppV3Resource + AssessedWebAppV3Collection collection = webAppAssessmentV3.GetAssessedWebAppV3s(); + + // invoke the operation + string assessedWebAppName = "webapp1"; + AssessedWebAppV3Resource result = await collection.GetAsync(assessedWebAppName); + + // 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 + AssessedWebAppV3Data 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_AssessedWebAppsV3OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebAppsV3Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebAppV3_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 WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this AssessedWebAppV3Resource + AssessedWebAppV3Collection collection = webAppAssessmentV3.GetAssessedWebAppV3s(); + + // invoke the operation and iterate over the result + await foreach (AssessedWebAppV3Resource 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 + AssessedWebAppV3Data 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_AssessedWebAppsV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebAppsV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebAppV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this AssessedWebAppV3Resource + AssessedWebAppV3Collection collection = webAppAssessmentV3.GetAssessedWebAppV3s(); + + // invoke the operation + string assessedWebAppName = "webapp1"; + bool result = await collection.ExistsAsync(assessedWebAppName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessedWebAppsV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebAppsV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebAppV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this AssessedWebAppV3Resource + AssessedWebAppV3Collection collection = webAppAssessmentV3.GetAssessedWebAppV3s(); + + // invoke the operation + string assessedWebAppName = "webapp1"; + NullableResponse response = await collection.GetIfExistsAsync(assessedWebAppName); + AssessedWebAppV3Resource 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 + AssessedWebAppV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Resource.cs new file mode 100644 index 000000000000..ae35dd024b6d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessedWebAppV3Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessedWebAppV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessedWebAppsV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AssessedWebAppsV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessedWebAppV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessedWebAppV3Resource created on azure + // for more information of creating AssessedWebAppV3Resource, please refer to the document of AssessedWebAppV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string assessedWebAppName = "webapp1"; + ResourceIdentifier assessedWebAppV3ResourceId = AssessedWebAppV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, assessedWebAppName); + AssessedWebAppV3Resource assessedWebAppV3 = client.GetAssessedWebAppV3Resource(assessedWebAppV3ResourceId); + + // invoke the operation + AssessedWebAppV3Resource result = await assessedWebAppV3.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 + AssessedWebAppV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectCollection.cs new file mode 100644 index 000000000000..d85aac7c6c34 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectCollection.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.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessmentProjectCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_AssessmentProjectsOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_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 = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AssessmentProjectResource + AssessmentProjectCollection collection = resourceGroupResource.GetAssessmentProjects(); + + // invoke the operation + string projectName = "sakanwar1204project"; + AssessmentProjectData data = new AssessmentProjectData(new AzureLocation("southeastasia")) + { + Properties = new ProjectProperties + { + AssessmentSolutionId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa", + ProjectStatus = ProjectStatus.Active, + PublicNetworkAccess = "Disabled", + CustomerStorageAccountArmId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa", + }, + Tags = +{ +["Migrate Project"] = "sakanwar-PE-SEA" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, projectName, data); + AssessmentProjectResource 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 + AssessmentProjectData 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_AssessmentProjectsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AssessmentProjectResource + AssessmentProjectCollection collection = resourceGroupResource.GetAssessmentProjects(); + + // invoke the operation + string projectName = "sakanwar1204project"; + AssessmentProjectResource result = await collection.GetAsync(projectName); + + // 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 + AssessmentProjectData 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_AssessmentProjectsOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AssessmentProjectResource + AssessmentProjectCollection collection = resourceGroupResource.GetAssessmentProjects(); + + // invoke the operation and iterate over the result + await foreach (AssessmentProjectResource 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 + AssessmentProjectData 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_AssessmentProjectsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AssessmentProjectResource + AssessmentProjectCollection collection = resourceGroupResource.GetAssessmentProjects(); + + // invoke the operation + string projectName = "sakanwar1204project"; + bool result = await collection.ExistsAsync(projectName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessmentProjectsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AssessmentProjectResource + AssessmentProjectCollection collection = resourceGroupResource.GetAssessmentProjects(); + + // invoke the operation + string projectName = "sakanwar1204project"; + NullableResponse response = await collection.GetIfExistsAsync(projectName); + AssessmentProjectResource 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 + AssessmentProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectResource.cs new file mode 100644 index 000000000000..9e95c5b17e0e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectResource.cs @@ -0,0 +1,120 @@ +// 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.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AssessmentProjectResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentProjectsOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // invoke the operation + AssessmentProjectResource result = await assessmentProject.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 + AssessmentProjectData 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_AssessmentProjectsOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_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 AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "A926B99C-7F4C-4556-871E-20CB8C6ADB56"; + string resourceGroupName = "rgmigrate"; + string projectName = "zqrsyncwahgydqvwuchkfd"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // invoke the operation + await assessmentProject.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AssessmentProjectsOperationsUpdate() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_Update_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_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 AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // invoke the operation + AssessmentProjectData data = new AssessmentProjectData(default) + { + Properties = new ProjectProperties + { + AssessmentSolutionId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa", + ProjectStatus = ProjectStatus.Active, + PublicNetworkAccess = "Disabled", + CustomerStorageAccountArmId = "/subscriptions/4bd2aa0f-2bd2-4d67-91a8-5a4533d58600/resourceGroups/sakanwar/providers/Microsoft.Storage/storageAccounts/sakanwar1204usa", + }, + Tags = +{ +["Migrate Project"] = "sakanwar-PE-SEA" +}, + }; + ArmOperation lro = await assessmentProject.UpdateAsync(WaitUntil.Completed, data); + AssessmentProjectResource 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 + AssessmentProjectData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryCollection.cs new file mode 100644 index 000000000000..00953c54cb68 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryCollection.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.Migrate.Samples +{ + public partial class Sample_AssessmentProjectSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentProjectSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this AssessmentProjectSummaryResource + AssessmentProjectSummaryCollection collection = assessmentProject.GetAssessmentProjectSummaries(); + + // invoke the operation + string projectSummaryName = "default"; + AssessmentProjectSummaryResource result = await collection.GetAsync(projectSummaryName); + + // 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 + AssessmentProjectSummaryData 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_AssessmentProjectSummaryOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummary_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 AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this AssessmentProjectSummaryResource + AssessmentProjectSummaryCollection collection = assessmentProject.GetAssessmentProjectSummaries(); + + // invoke the operation and iterate over the result + await foreach (AssessmentProjectSummaryResource 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 + AssessmentProjectSummaryData 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_AssessmentProjectSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this AssessmentProjectSummaryResource + AssessmentProjectSummaryCollection collection = assessmentProject.GetAssessmentProjectSummaries(); + + // invoke the operation + string projectSummaryName = "default"; + bool result = await collection.ExistsAsync(projectSummaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AssessmentProjectSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this AssessmentProjectSummaryResource + AssessmentProjectSummaryCollection collection = assessmentProject.GetAssessmentProjectSummaries(); + + // invoke the operation + string projectSummaryName = "default"; + NullableResponse response = await collection.GetIfExistsAsync(projectSummaryName); + AssessmentProjectSummaryResource 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 + AssessmentProjectSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryResource.cs new file mode 100644 index 000000000000..16db2ea0bc54 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AssessmentProjectSummaryResource.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.Migrate.Samples +{ + public partial class Sample_AssessmentProjectSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AssessmentProjectSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProjectSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectSummaryResource created on azure + // for more information of creating AssessmentProjectSummaryResource, please refer to the document of AssessmentProjectSummaryResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "piyushapp1"; + string projectName = "PiyushApp15328project"; + string projectSummaryName = "default"; + ResourceIdentifier assessmentProjectSummaryResourceId = AssessmentProjectSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, projectSummaryName); + AssessmentProjectSummaryResource assessmentProjectSummary = client.GetAssessmentProjectSummaryResource(assessmentProjectSummaryResourceId); + + // invoke the operation + AssessmentProjectSummaryResource result = await assessmentProjectSummary.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 + AssessmentProjectSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Collection.cs new file mode 100644 index 000000000000..435039d9d30c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Collection.cs @@ -0,0 +1,167 @@ +// 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.Migrate.Samples +{ + public partial class Sample_AvsAssessedMachineV2Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessedMachineV2Resource + AvsAssessedMachineV2Collection collection = avsAssessmentV2.GetAvsAssessedMachineV2s(); + + // invoke the operation + string avsAssessedMachineName = "machine1"; + AvsAssessedMachineV2Resource result = await collection.GetAsync(avsAssessedMachineName); + + // 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 + AvsAssessedMachineV2Data 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_AvsAssessedMachinesV2OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessedMachinesV2Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachineV2_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 AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessedMachineV2Resource + AvsAssessedMachineV2Collection collection = avsAssessmentV2.GetAvsAssessedMachineV2s(); + + // invoke the operation and iterate over the result + int? pageSize = 26; + string continuationToken = "vhdrqptyyromhgz"; + int? totalRecordCount = 7; + await foreach (AvsAssessedMachineV2Resource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // 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 + AvsAssessedMachineV2Data 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_AvsAssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessedMachineV2Resource + AvsAssessedMachineV2Collection collection = avsAssessmentV2.GetAvsAssessedMachineV2s(); + + // invoke the operation + string avsAssessedMachineName = "machine1"; + bool result = await collection.ExistsAsync(avsAssessedMachineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsAssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessedMachineV2Resource + AvsAssessedMachineV2Collection collection = avsAssessmentV2.GetAvsAssessedMachineV2s(); + + // invoke the operation + string avsAssessedMachineName = "machine1"; + NullableResponse response = await collection.GetIfExistsAsync(avsAssessedMachineName); + AvsAssessedMachineV2Resource 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 + AvsAssessedMachineV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Resource.cs new file mode 100644 index 000000000000..61cc94628207 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessedMachineV2Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsAssessedMachineV2Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessedMachinesV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessedMachinesV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessedMachineV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessedMachineV2Resource created on azure + // for more information of creating AvsAssessedMachineV2Resource, please refer to the document of AvsAssessedMachineV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string avsAssessedMachineName = "machine1"; + ResourceIdentifier avsAssessedMachineV2ResourceId = AvsAssessedMachineV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, avsAssessedMachineName); + AvsAssessedMachineV2Resource avsAssessedMachineV2 = client.GetAvsAssessedMachineV2Resource(avsAssessedMachineV2ResourceId); + + // invoke the operation + AvsAssessedMachineV2Resource result = await avsAssessedMachineV2.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 + AvsAssessedMachineV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Collection.cs new file mode 100644 index 000000000000..629cfccbc8df --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Collection.cs @@ -0,0 +1,247 @@ +// 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.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsAssessmentV2Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_AvsAssessmentsV2OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_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 = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsAssessmentV2Resource + string projectName = "contosoProject"; + AvsAssessmentV2Collection collection = resourceGroupResource.GetAvsAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + AvsAssessmentV2Data data = new AvsAssessmentV2Data + { + Properties = new AvsAssessmentPropertiesV2 + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "fxonspfmzfuiaepr", + AzureResourceGraphQuery = "ylnfwgptlyzwzkotmunbx", + }, + Settings = new AvsAssessmentSettings + { + AzureLocation = "actuloeieva", + Currency = AzureCurrency.Unknown, + ScalingFactor = 28F, + DiscountPercentage = 27F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T05:36:34.751Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T05:36:34.751Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "xvtuenxmmjuqlhgmvev", + }, + EnvironmentType = EnvironmentType.Production, + FailuresToTolerateAndRaidLevelList = { FttAndRaidLevel.Unknown }, + VcpuOversubscription = 25F, + NodeTypes = { AzureAvsNodeType.Unknown }, + AvsAssessmentScenario = AvsAssessmentScenario.Unknown, + ExternalStorageTypes = { ExternalStorageType.Unknown }, + CpuHeadroom = 27F, + IsVcfByolEnabled = true, + MemOvercommit = 11F, + DedupeCompression = 26F, + IsStretchClusterEnabled = true, + }, + Details = new AssessmentDetails(), + FallbackMachineAssessmentArmId = "tpjvxfcyxsgngqdxyrrfh", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + AvsAssessmentV2Resource 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 + AvsAssessmentV2Data 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_AvsAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsAssessmentV2Resource + string projectName = "contosoProject"; + AvsAssessmentV2Collection collection = resourceGroupResource.GetAvsAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + AvsAssessmentV2Resource result = await collection.GetAsync(assessmentName); + + // 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 + AvsAssessmentV2Data 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_AvsAssessmentsV2OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsAssessmentV2Resource + string projectName = "contosoProject"; + AvsAssessmentV2Collection collection = resourceGroupResource.GetAvsAssessmentV2s(projectName); + + // invoke the operation and iterate over the result + await foreach (AvsAssessmentV2Resource 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 + AvsAssessmentV2Data 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_AvsAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsAssessmentV2Resource + string projectName = "contosoProject"; + AvsAssessmentV2Collection collection = resourceGroupResource.GetAvsAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsAssessmentV2Resource + string projectName = "contosoProject"; + AvsAssessmentV2Collection collection = resourceGroupResource.GetAvsAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + AvsAssessmentV2Resource 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 + AvsAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Resource.cs new file mode 100644 index 000000000000..601aa062faa2 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2Resource.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.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsAssessmentV2Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // invoke the operation + AvsAssessmentV2Resource result = await avsAssessmentV2.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 + AvsAssessmentV2Data 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_AvsAssessmentsV2OperationsDeleteMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_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 AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // invoke the operation + await avsAssessmentV2.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_AvsAssessmentsV2OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2_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 AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // invoke the operation + AvsAssessmentV2Data data = new AvsAssessmentV2Data + { + Properties = new AvsAssessmentPropertiesV2 + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "fxonspfmzfuiaepr", + AzureResourceGraphQuery = "ylnfwgptlyzwzkotmunbx", + }, + Settings = new AvsAssessmentSettings + { + AzureLocation = "actuloeieva", + Currency = AzureCurrency.Unknown, + ScalingFactor = 28F, + DiscountPercentage = 27F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T05:36:34.751Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T05:36:34.751Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "xvtuenxmmjuqlhgmvev", + }, + EnvironmentType = EnvironmentType.Production, + FailuresToTolerateAndRaidLevelList = { FttAndRaidLevel.Unknown }, + VcpuOversubscription = 25F, + NodeTypes = { AzureAvsNodeType.Unknown }, + AvsAssessmentScenario = AvsAssessmentScenario.Unknown, + ExternalStorageTypes = { ExternalStorageType.Unknown }, + CpuHeadroom = 27F, + IsVcfByolEnabled = true, + MemOvercommit = 11F, + DedupeCompression = 26F, + IsStretchClusterEnabled = true, + }, + Details = new AssessmentDetails(), + FallbackMachineAssessmentArmId = "tpjvxfcyxsgngqdxyrrfh", + }, + }; + ArmOperation lro = await avsAssessmentV2.UpdateAsync(WaitUntil.Completed, data); + AvsAssessmentV2Resource 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 + AvsAssessmentV2Data 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 DownloadUrl_GetDownloadURLForTheAssessmentReport() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentsV2Operations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentsV2Operations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // invoke the operation + DownloadUrlContent content = new DownloadUrlContent(); + ArmOperation lro = await avsAssessmentV2.DownloadUrlAsync(WaitUntil.Completed, content); + DownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryCollection.cs new file mode 100644 index 000000000000..f7e880aa6171 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsAssessmentV2SummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessmentV2SummaryResource + AvsAssessmentV2SummaryCollection collection = avsAssessmentV2.GetAvsAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + AvsAssessmentV2SummaryResource result = await collection.GetAsync(summaryName); + + // 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 + AvsAssessmentV2SummaryData 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_AvsAssessmentV2SummaryOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentV2SummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2Summary_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 AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessmentV2SummaryResource + AvsAssessmentV2SummaryCollection collection = avsAssessmentV2.GetAvsAssessmentV2Summaries(); + + // invoke the operation and iterate over the result + await foreach (AvsAssessmentV2SummaryResource 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 + AvsAssessmentV2SummaryData 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_AvsAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessmentV2SummaryResource + AvsAssessmentV2SummaryCollection collection = avsAssessmentV2.GetAvsAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2Resource created on azure + // for more information of creating AvsAssessmentV2Resource, please refer to the document of AvsAssessmentV2Resource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier avsAssessmentV2ResourceId = AvsAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + AvsAssessmentV2Resource avsAssessmentV2 = client.GetAvsAssessmentV2Resource(avsAssessmentV2ResourceId); + + // get the collection of this AvsAssessmentV2SummaryResource + AvsAssessmentV2SummaryCollection collection = avsAssessmentV2.GetAvsAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + AvsAssessmentV2SummaryResource 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 + AvsAssessmentV2SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryResource.cs new file mode 100644 index 000000000000..57e0a7ddd7f3 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsAssessmentV2SummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsAssessmentV2SummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsAssessmentV2SummaryResource created on azure + // for more information of creating AvsAssessmentV2SummaryResource, please refer to the document of AvsAssessmentV2SummaryResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string summaryName = "PaaSPreferred"; + ResourceIdentifier avsAssessmentV2SummaryResourceId = AvsAssessmentV2SummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, summaryName); + AvsAssessmentV2SummaryResource avsAssessmentV2Summary = client.GetAvsAssessmentV2SummaryResource(avsAssessmentV2SummaryResourceId); + + // invoke the operation + AvsAssessmentV2SummaryResource result = await avsAssessmentV2Summary.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 + AvsAssessmentV2SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionCollection.cs new file mode 100644 index 000000000000..4ff9257e4c6c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionCollection.cs @@ -0,0 +1,158 @@ +// 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.Migrate.Samples +{ + public partial class Sample_AvsGraphAssessmentOptionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsGraphAssessmentOptionResource + string projectName = "contosoProject"; + AvsGraphAssessmentOptionCollection collection = resourceGroupResource.GetAvsGraphAssessmentOptions(projectName); + + // invoke the operation + AvsGraphAssessmentOptionResource result = await collection.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 + AvsGraphAssessmentOptionData 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_AvsGraphAssessmentOptionsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AvsGraphAssessmentOptions_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsGraphAssessmentOptionResource + string projectName = "contosoProject"; + AvsGraphAssessmentOptionCollection collection = resourceGroupResource.GetAvsGraphAssessmentOptions(projectName); + + // invoke the operation and iterate over the result + await foreach (AvsGraphAssessmentOptionResource 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 + AvsGraphAssessmentOptionData 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_AvsGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsGraphAssessmentOptionResource + string projectName = "contosoProject"; + AvsGraphAssessmentOptionCollection collection = resourceGroupResource.GetAvsGraphAssessmentOptions(projectName); + + // invoke the operation + bool result = await collection.ExistsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_AvsGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this AvsGraphAssessmentOptionResource + string projectName = "contosoProject"; + AvsGraphAssessmentOptionCollection collection = resourceGroupResource.GetAvsGraphAssessmentOptions(projectName); + + // invoke the operation + NullableResponse response = await collection.GetIfExistsAsync(); + AvsGraphAssessmentOptionResource 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 + AvsGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionResource.cs new file mode 100644 index 000000000000..c02bcabeadcb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsGraphAssessmentOptionResource.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.Migrate.Samples +{ + public partial class Sample_AvsGraphAssessmentOptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_AvsGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/AvsGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsGraphAssessmentOptionResource created on azure + // for more information of creating AvsGraphAssessmentOptionResource, please refer to the document of AvsGraphAssessmentOptionResource + string subscriptionId = "BF03674C-B4D0-4FC9-B964-175F4C6CBFDD"; + string resourceGroupName = "rgavsAssessments"; + string projectName = "contosoProject"; + ResourceIdentifier avsGraphAssessmentOptionResourceId = AvsGraphAssessmentOptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AvsGraphAssessmentOptionResource avsGraphAssessmentOption = client.GetAvsGraphAssessmentOptionResource(avsGraphAssessmentOptionResourceId); + + // invoke the operation + AvsGraphAssessmentOptionResource result = await avsGraphAssessmentOption.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 + AvsGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryCollection.cs new file mode 100644 index 000000000000..e247255583a2 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseAvsSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseAvsSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this AvsSummaryResource + AvsSummaryCollection collection = businessCase.GetAvsSummaries(); + + // invoke the operation + string avsSummaryName = "MySummary"; + AvsSummaryResource result = await collection.GetAsync(avsSummaryName); + + // 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 + AvsSummaryData 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_BusinessCaseAvsSummaryOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseAvsSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "AvsSummary_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 BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this AvsSummaryResource + AvsSummaryCollection collection = businessCase.GetAvsSummaries(); + + // invoke the operation and iterate over the result + await foreach (AvsSummaryResource 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 + AvsSummaryData 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_BusinessCaseAvsSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseAvsSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this AvsSummaryResource + AvsSummaryCollection collection = businessCase.GetAvsSummaries(); + + // invoke the operation + string avsSummaryName = "MySummary"; + bool result = await collection.ExistsAsync(avsSummaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BusinessCaseAvsSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseAvsSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this AvsSummaryResource + AvsSummaryCollection collection = businessCase.GetAvsSummaries(); + + // invoke the operation + string avsSummaryName = "MySummary"; + NullableResponse response = await collection.GetIfExistsAsync(avsSummaryName); + AvsSummaryResource 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 + AvsSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryResource.cs new file mode 100644 index 000000000000..6c6523791c57 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_AvsSummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_AvsSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseAvsSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseAvsSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "AvsSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AvsSummaryResource created on azure + // for more information of creating AvsSummaryResource, please refer to the document of AvsSummaryResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string avsSummaryName = "MySummary"; + ResourceIdentifier avsSummaryResourceId = AvsSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, avsSummaryName); + AvsSummaryResource avsSummary = client.GetAvsSummaryResource(avsSummaryResourceId); + + // invoke the operation + AvsSummaryResource result = await avsSummary.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 + AvsSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseCollection.cs new file mode 100644 index 000000000000..bfcdab882c04 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseCollection.cs @@ -0,0 +1,261 @@ +// 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.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_BusinessCaseCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_BusinessCaseOperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_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 = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BusinessCaseResource + string projectName = "MyMigrateProject"; + BusinessCaseCollection collection = resourceGroupResource.GetBusinessCases(projectName); + + // invoke the operation + string businessCaseName = "MyBusinessCase"; + BusinessCaseData data = new BusinessCaseData + { + Properties = new BusinessCaseProperties + { + Settings = new Settings(new AzureSettings("hpocokeckktxpzilk", BusinessCaseCurrency.Unknown) + { + DiscountPercentage = 48F, + BusinessCaseType = MigrationStrategy.Unknown, + WorkloadDiscoverySource = DiscoverySource.Unknown, + PerformanceDataStartOn = DateTimeOffset.Parse("2024-11-14T10:27:58.436Z"), + PerformanceDataEndOn = DateTimeOffset.Parse("2024-11-14T10:27:58.436Z"), + ComfortFactor = 19F, + PerformanceUtilizationPercentile = 93F, + PerYearMigrationCompletionPercentage = {new NameValuePair +{ +Name = "cthxvjhedpsnbddvyghswtgp", +Value = 13F, +}}, + InfrastructureGrowthRate = 79F, + Wacc = 43F, + NetworkCostPercentage = 81F, + IaasLaborCostPercentage = 51F, + PaasLaborCostPercentage = 13F, + AvsLaborCostPercentage = 2F, + SavingsOption = SavingsOption.Unknown, + }) + { + OnPremiseSettings = new OnPremiseSettings( + new ComputeSettings( + 26F, + 8F, + 1F, + 10F, + 10F, + new SqlServerLicensingSettings[] + { +new SqlServerLicensingSettings(SqlServerLicenseType.Unknown, 28F, 27F) + }, + new WindowsServerLicensingSettings(2F, 6F, 21), + new LinuxServerLicensingSettings(7F), + new LinuxServerLicensingSettings(7F), + new VirtualizationSoftwareSettings(23F)), + new StorageSettings(12F, 5F), + new NetworkSettings(84F, 18, 27F), + new FacilitySettings(25F) + { + FacilitiesCostPerKwh = 1F, + }, + new LaborSettings(16, 18, 22F), + new SecuritySettings(6F, 10F)) + { + ManagementSettings = new ManagementSettings(new HypervVirtualizationManagementSettings(8, 15F, new HypervLicense[] + { +new HypervLicense(1F, HyperVLicenseType.Unknown) + }), new ThirdPartyManagementSettings(1F, 13F), new OtherManagementCostsSettings(2F, 28F, 4F)), + }, + AzureArcSettings = new AzureArcSettings(AzureArcState.Disabled) + { + LaborCostPercentage = 46F, + ManagementMonitoringSettings = new AzureArcMonitoringSettings(17F, 19), + }, + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, businessCaseName, data); + BusinessCaseResource 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 + BusinessCaseData 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_BusinessCaseOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BusinessCaseResource + string projectName = "MyMigrateProject"; + BusinessCaseCollection collection = resourceGroupResource.GetBusinessCases(projectName); + + // invoke the operation + string businessCaseName = "MyBusinessCase"; + BusinessCaseResource result = await collection.GetAsync(businessCaseName); + + // 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 + BusinessCaseData 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_BusinessCaseOperationsListByParentMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BusinessCaseResource + string projectName = "MyMigrateProject"; + BusinessCaseCollection collection = resourceGroupResource.GetBusinessCases(projectName); + + // invoke the operation and iterate over the result + await foreach (BusinessCaseResource 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 + BusinessCaseData 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_BusinessCaseOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BusinessCaseResource + string projectName = "MyMigrateProject"; + BusinessCaseCollection collection = resourceGroupResource.GetBusinessCases(projectName); + + // invoke the operation + string businessCaseName = "MyBusinessCase"; + bool result = await collection.ExistsAsync(businessCaseName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BusinessCaseOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this BusinessCaseResource + string projectName = "MyMigrateProject"; + BusinessCaseCollection collection = resourceGroupResource.GetBusinessCases(projectName); + + // invoke the operation + string businessCaseName = "MyBusinessCase"; + NullableResponse response = await collection.GetIfExistsAsync(businessCaseName); + BusinessCaseResource 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 + BusinessCaseData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseResource.cs new file mode 100644 index 000000000000..c39f4f6e56fa --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_BusinessCaseResource.cs @@ -0,0 +1,231 @@ +// 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.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_BusinessCaseResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // invoke the operation + BusinessCaseResource result = await businessCase.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 + BusinessCaseData 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_BusinessCaseOperationsDeleteMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_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 BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // invoke the operation + await businessCase.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_BusinessCaseOperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCase_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 BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // invoke the operation + BusinessCaseData data = new BusinessCaseData + { + Properties = new BusinessCaseProperties + { + Settings = new Settings(new AzureSettings("hpocokeckktxpzilk", BusinessCaseCurrency.Unknown) + { + DiscountPercentage = 48F, + BusinessCaseType = MigrationStrategy.Unknown, + WorkloadDiscoverySource = DiscoverySource.Unknown, + PerformanceDataStartOn = DateTimeOffset.Parse("2024-11-14T10:27:58.436Z"), + PerformanceDataEndOn = DateTimeOffset.Parse("2024-11-14T10:27:58.436Z"), + ComfortFactor = 19F, + PerformanceUtilizationPercentile = 93F, + PerYearMigrationCompletionPercentage = {new NameValuePair +{ +Name = "cthxvjhedpsnbddvyghswtgp", +Value = 13F, +}}, + InfrastructureGrowthRate = 79F, + Wacc = 43F, + NetworkCostPercentage = 81F, + IaasLaborCostPercentage = 51F, + PaasLaborCostPercentage = 13F, + AvsLaborCostPercentage = 2F, + SavingsOption = SavingsOption.Unknown, + }) + { + OnPremiseSettings = new OnPremiseSettings( + new ComputeSettings( + 26F, + 8F, + 1F, + 10F, + 10F, + new SqlServerLicensingSettings[] + { +new SqlServerLicensingSettings(SqlServerLicenseType.Unknown, 28F, 27F) + }, + new WindowsServerLicensingSettings(2F, 6F, 21), + new LinuxServerLicensingSettings(7F), + new LinuxServerLicensingSettings(7F), + new VirtualizationSoftwareSettings(23F)), + new StorageSettings(12F, 5F), + new NetworkSettings(84F, 18, 27F), + new FacilitySettings(25F) + { + FacilitiesCostPerKwh = 1F, + }, + new LaborSettings(16, 18, 22F), + new SecuritySettings(6F, 10F)) + { + ManagementSettings = new ManagementSettings(new HypervVirtualizationManagementSettings(8, 15F, new HypervLicense[] + { +new HypervLicense(1F, HyperVLicenseType.Unknown) + }), new ThirdPartyManagementSettings(1F, 13F), new OtherManagementCostsSettings(2F, 28F, 4F)), + }, + AzureArcSettings = new AzureArcSettings(AzureArcState.Disabled) + { + LaborCostPercentage = 46F, + ManagementMonitoringSettings = new AzureArcMonitoringSettings(17F, 19), + }, + }, + }, + }; + ArmOperation lro = await businessCase.UpdateAsync(WaitUntil.Completed, data); + BusinessCaseResource 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 + BusinessCaseData 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 CompareSummary_GetCompareSummaryReportForBusinessCase() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_CompareSummary_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCaseOperations_CompareSummary" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // invoke the operation + CompareSummaryContent content = new CompareSummaryContent(); + ArmOperation lro = await businessCase.CompareSummaryAsync(WaitUntil.Completed, content); + CompareSummary result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetReportDownloadUrl_GetDownloadURLForTheBusinessCaseReportGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOperations_GetReportDownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "BusinessCaseOperations_GetReportDownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // invoke the operation + GetReportDownloadUrlContent content = new GetReportDownloadUrlContent(); + ArmOperation lro = await businessCase.GetReportDownloadUrlAsync(WaitUntil.Completed, content); + ReportDownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentCollection.cs new file mode 100644 index 000000000000..86d04d3073fb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentCollection.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_CompoundAssessmentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CompoundAssessmentOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_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 = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this CompoundAssessmentResource + string projectName = "contosoProject"; + CompoundAssessmentCollection collection = resourceGroupResource.GetCompoundAssessments(projectName); + + // invoke the operation + string compoundAssessmentName = "assessmentName"; + CompoundAssessmentData data = new CompoundAssessmentData + { + Properties = new CompoundAssessmentProperties(new TargetAssessmentArmIds + { + Aks = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/aksAssessments/nameOfAssessment", + AzureAppService = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/webAppAssessments/nameOfAssessment", + AzureAppServiceContainer = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/webAppAssessments/nameOfAssessment", + }) + { + FallbackMachineAssessmentArmId = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/assessments/nameOfAssessment", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, compoundAssessmentName, data); + CompoundAssessmentResource 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 + CompoundAssessmentData 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_CompoundAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this CompoundAssessmentResource + string projectName = "contosoProject"; + CompoundAssessmentCollection collection = resourceGroupResource.GetCompoundAssessments(projectName); + + // invoke the operation + string compoundAssessmentName = "assessmentName"; + CompoundAssessmentResource result = await collection.GetAsync(compoundAssessmentName); + + // 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 + CompoundAssessmentData 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_CompoundAssessmentOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this CompoundAssessmentResource + string projectName = "contosoProject"; + CompoundAssessmentCollection collection = resourceGroupResource.GetCompoundAssessments(projectName); + + // invoke the operation and iterate over the result + await foreach (CompoundAssessmentResource 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 + CompoundAssessmentData 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_CompoundAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this CompoundAssessmentResource + string projectName = "contosoProject"; + CompoundAssessmentCollection collection = resourceGroupResource.GetCompoundAssessments(projectName); + + // invoke the operation + string compoundAssessmentName = "assessmentName"; + bool result = await collection.ExistsAsync(compoundAssessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CompoundAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this CompoundAssessmentResource + string projectName = "contosoProject"; + CompoundAssessmentCollection collection = resourceGroupResource.GetCompoundAssessments(projectName); + + // invoke the operation + string compoundAssessmentName = "assessmentName"; + NullableResponse response = await collection.GetIfExistsAsync(compoundAssessmentName); + CompoundAssessmentResource 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 + CompoundAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentResource.cs new file mode 100644 index 000000000000..ac077129ae27 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_CompoundAssessmentResource.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.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_CompoundAssessmentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CompoundAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // invoke the operation + CompoundAssessmentResource result = await compoundAssessment.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 + CompoundAssessmentData 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_CompoundAssessmentOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_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 CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // invoke the operation + await compoundAssessment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CompoundAssessmentOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessment_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 CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // invoke the operation + CompoundAssessmentData data = new CompoundAssessmentData + { + Properties = new CompoundAssessmentProperties(new TargetAssessmentArmIds + { + Aks = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/aksAssessments/nameOfAssessment", + AzureAppService = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/webAppAssessments/nameOfAssessment", + AzureAppServiceContainer = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/webAppAssessments/nameOfAssessment", + }) + { + FallbackMachineAssessmentArmId = "/subscriptions/6898488D-BBF0-40FC-A5E3-3DF2C00C5F21/resourceGroups/rgwebAppCompoundAssessments/providers/Microsoft.Migrate/assessmentprojects/contosoProject/assessments/nameOfAssessment", + }, + }; + ArmOperation lro = await compoundAssessment.UpdateAsync(WaitUntil.Completed, data); + CompoundAssessmentResource 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 + CompoundAssessmentData 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 DownloadUrl_CompoundAssessmentOperationsDownloadUrl() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentOperations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "CompoundAssessmentOperations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // invoke the operation + DownloadUrlContent content = new DownloadUrlContent(); + ArmOperation lro = await compoundAssessment.DownloadUrlAsync(WaitUntil.Completed, content); + DownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineCollection.cs new file mode 100644 index 000000000000..5b00bb8813ad --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineCollection.cs @@ -0,0 +1,167 @@ +// 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.Migrate.Samples +{ + public partial class Sample_EvaluatedAvsMachineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedAvsMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedAvsMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedAvsMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedAvsMachineResource + EvaluatedAvsMachineCollection collection = businessCase.GetEvaluatedAvsMachines(); + + // invoke the operation + string evaluatedAvsMachineName = "MyMachine"; + EvaluatedAvsMachineResource result = await collection.GetAsync(evaluatedAvsMachineName); + + // 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 + EvaluatedAvsMachineData 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_EvaluatedAvsMachinesOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedAvsMachinesOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedAvsMachine_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 BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedAvsMachineResource + EvaluatedAvsMachineCollection collection = businessCase.GetEvaluatedAvsMachines(); + + // invoke the operation and iterate over the result + int? pageSize = 18; + string continuationToken = "kri"; + int? totalRecordCount = 12; + await foreach (EvaluatedAvsMachineResource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // 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 + EvaluatedAvsMachineData 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_EvaluatedAvsMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedAvsMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedAvsMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedAvsMachineResource + EvaluatedAvsMachineCollection collection = businessCase.GetEvaluatedAvsMachines(); + + // invoke the operation + string evaluatedAvsMachineName = "MyMachine"; + bool result = await collection.ExistsAsync(evaluatedAvsMachineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_EvaluatedAvsMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedAvsMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedAvsMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedAvsMachineResource + EvaluatedAvsMachineCollection collection = businessCase.GetEvaluatedAvsMachines(); + + // invoke the operation + string evaluatedAvsMachineName = "MyMachine"; + NullableResponse response = await collection.GetIfExistsAsync(evaluatedAvsMachineName); + EvaluatedAvsMachineResource 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 + EvaluatedAvsMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineResource.cs new file mode 100644 index 000000000000..055ff7c31512 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedAvsMachineResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_EvaluatedAvsMachineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedAvsMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedAvsMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedAvsMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EvaluatedAvsMachineResource created on azure + // for more information of creating EvaluatedAvsMachineResource, please refer to the document of EvaluatedAvsMachineResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string evaluatedAvsMachineName = "MyMachine"; + ResourceIdentifier evaluatedAvsMachineResourceId = EvaluatedAvsMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, evaluatedAvsMachineName); + EvaluatedAvsMachineResource evaluatedAvsMachine = client.GetEvaluatedAvsMachineResource(evaluatedAvsMachineResourceId); + + // invoke the operation + EvaluatedAvsMachineResource result = await evaluatedAvsMachine.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 + EvaluatedAvsMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineCollection.cs new file mode 100644 index 000000000000..d26eda4d8104 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineCollection.cs @@ -0,0 +1,167 @@ +// 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.Migrate.Samples +{ + public partial class Sample_EvaluatedMachineCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedMachineResource + EvaluatedMachineCollection collection = businessCase.GetEvaluatedMachines(); + + // invoke the operation + string evaluatedMachineName = "MyMachine"; + EvaluatedMachineResource result = await collection.GetAsync(evaluatedMachineName); + + // 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 + EvaluatedMachineData 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_EvaluatedMachinesOperationsListByParentMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedMachinesOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedMachine_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 BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedMachineResource + EvaluatedMachineCollection collection = businessCase.GetEvaluatedMachines(); + + // invoke the operation and iterate over the result + int? pageSize = 24; + string continuationToken = "eoevgdmtpkbhlgyglvsa"; + int? totalRecordCount = 6; + await foreach (EvaluatedMachineResource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // 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 + EvaluatedMachineData 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_EvaluatedMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedMachineResource + EvaluatedMachineCollection collection = businessCase.GetEvaluatedMachines(); + + // invoke the operation + string evaluatedMachineName = "MyMachine"; + bool result = await collection.ExistsAsync(evaluatedMachineName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_EvaluatedMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedMachineResource + EvaluatedMachineCollection collection = businessCase.GetEvaluatedMachines(); + + // invoke the operation + string evaluatedMachineName = "MyMachine"; + NullableResponse response = await collection.GetIfExistsAsync(evaluatedMachineName); + EvaluatedMachineResource 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 + EvaluatedMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineResource.cs new file mode 100644 index 000000000000..cd0e4381cd62 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedMachineResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_EvaluatedMachineResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedMachinesOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedMachinesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedMachine_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EvaluatedMachineResource created on azure + // for more information of creating EvaluatedMachineResource, please refer to the document of EvaluatedMachineResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string evaluatedMachineName = "MyMachine"; + ResourceIdentifier evaluatedMachineResourceId = EvaluatedMachineResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, evaluatedMachineName); + EvaluatedMachineResource evaluatedMachine = client.GetEvaluatedMachineResource(evaluatedMachineResourceId); + + // invoke the operation + EvaluatedMachineResource result = await evaluatedMachine.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 + EvaluatedMachineData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityCollection.cs new file mode 100644 index 000000000000..4ed56435890b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityCollection.cs @@ -0,0 +1,167 @@ +// 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.Migrate.Samples +{ + public partial class Sample_EvaluatedSqlEntityCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedSqlEntitiesOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedSqlEntitiesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedSqlEntity_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedSqlEntityResource + EvaluatedSqlEntityCollection collection = businessCase.GetEvaluatedSqlEntities(); + + // invoke the operation + string evaluatedSqlEntityName = "MyEntity"; + EvaluatedSqlEntityResource result = await collection.GetAsync(evaluatedSqlEntityName); + + // 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 + EvaluatedSqlEntityData 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_EvaluatedSqlEntitiesOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedSqlEntitiesOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedSqlEntity_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 BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedSqlEntityResource + EvaluatedSqlEntityCollection collection = businessCase.GetEvaluatedSqlEntities(); + + // invoke the operation and iterate over the result + int? pageSize = 13; + string continuationToken = "bnmyic"; + int? totalRecordCount = 23; + await foreach (EvaluatedSqlEntityResource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // 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 + EvaluatedSqlEntityData 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_EvaluatedSqlEntitiesOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedSqlEntitiesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedSqlEntity_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedSqlEntityResource + EvaluatedSqlEntityCollection collection = businessCase.GetEvaluatedSqlEntities(); + + // invoke the operation + string evaluatedSqlEntityName = "MyEntity"; + bool result = await collection.ExistsAsync(evaluatedSqlEntityName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_EvaluatedSqlEntitiesOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedSqlEntitiesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedSqlEntity_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedSqlEntityResource + EvaluatedSqlEntityCollection collection = businessCase.GetEvaluatedSqlEntities(); + + // invoke the operation + string evaluatedSqlEntityName = "MyEntity"; + NullableResponse response = await collection.GetIfExistsAsync(evaluatedSqlEntityName); + EvaluatedSqlEntityResource 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 + EvaluatedSqlEntityData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityResource.cs new file mode 100644 index 000000000000..019076fe6d4d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedSqlEntityResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_EvaluatedSqlEntityResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedSqlEntitiesOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedSqlEntitiesOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedSqlEntity_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EvaluatedSqlEntityResource created on azure + // for more information of creating EvaluatedSqlEntityResource, please refer to the document of EvaluatedSqlEntityResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string evaluatedSqlEntityName = "MyEntity"; + ResourceIdentifier evaluatedSqlEntityResourceId = EvaluatedSqlEntityResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, evaluatedSqlEntityName); + EvaluatedSqlEntityResource evaluatedSqlEntity = client.GetEvaluatedSqlEntityResource(evaluatedSqlEntityResourceId); + + // invoke the operation + EvaluatedSqlEntityResource result = await evaluatedSqlEntity.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 + EvaluatedSqlEntityData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppCollection.cs new file mode 100644 index 000000000000..a411b7c71a0f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppCollection.cs @@ -0,0 +1,167 @@ +// 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.Migrate.Samples +{ + public partial class Sample_EvaluatedWebAppCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedWebAppsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedWebAppsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedWebApp_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedWebAppResource + EvaluatedWebAppCollection collection = businessCase.GetEvaluatedWebApps(); + + // invoke the operation + string evaluatedWebAppName = "MyWebApp"; + EvaluatedWebAppResource result = await collection.GetAsync(evaluatedWebAppName); + + // 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 + EvaluatedWebAppData 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_EvaluatedWebAppsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedWebAppsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedWebApp_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 BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedWebAppResource + EvaluatedWebAppCollection collection = businessCase.GetEvaluatedWebApps(); + + // invoke the operation and iterate over the result + int? pageSize = 20; + string continuationToken = "giprsbjufkenlzmqf"; + int? totalRecordCount = 12; + await foreach (EvaluatedWebAppResource item in collection.GetAllAsync(pageSize: pageSize, continuationToken: continuationToken, totalRecordCount: totalRecordCount)) + { + // 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 + EvaluatedWebAppData 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_EvaluatedWebAppsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedWebAppsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedWebApp_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedWebAppResource + EvaluatedWebAppCollection collection = businessCase.GetEvaluatedWebApps(); + + // invoke the operation + string evaluatedWebAppName = "MyWebApp"; + bool result = await collection.ExistsAsync(evaluatedWebAppName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_EvaluatedWebAppsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedWebAppsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedWebApp_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this EvaluatedWebAppResource + EvaluatedWebAppCollection collection = businessCase.GetEvaluatedWebApps(); + + // invoke the operation + string evaluatedWebAppName = "MyWebApp"; + NullableResponse response = await collection.GetIfExistsAsync(evaluatedWebAppName); + EvaluatedWebAppResource 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 + EvaluatedWebAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppResource.cs new file mode 100644 index 000000000000..3ebf4f0822f0 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_EvaluatedWebAppResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_EvaluatedWebAppResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_EvaluatedWebAppsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/EvaluatedWebAppsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "EvaluatedWebApp_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this EvaluatedWebAppResource created on azure + // for more information of creating EvaluatedWebAppResource, please refer to the document of EvaluatedWebAppResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string evaluatedWebAppName = "MyWebApp"; + ResourceIdentifier evaluatedWebAppResourceId = EvaluatedWebAppResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, evaluatedWebAppName); + EvaluatedWebAppResource evaluatedWebApp = client.GetEvaluatedWebAppResource(evaluatedWebAppResourceId); + + // invoke the operation + EvaluatedWebAppResource result = await evaluatedWebApp.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 + EvaluatedWebAppData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentCollection.cs new file mode 100644 index 000000000000..de3126bc528c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_HeterogeneousAssessmentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_HeterogeneousAssessmentOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_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 = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HeterogeneousAssessmentResource + string projectName = "contosoProject"; + HeterogeneousAssessmentCollection collection = resourceGroupResource.GetHeterogeneousAssessments(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + HeterogeneousAssessmentData data = new HeterogeneousAssessmentData + { + Properties = new HeterogeneousAssessmentProperties + { + AssessmentArmIds = { "gartykxgfvqccfs" }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + HeterogeneousAssessmentResource 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 + HeterogeneousAssessmentData 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_HeterogeneousAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HeterogeneousAssessmentResource + string projectName = "contosoProject"; + HeterogeneousAssessmentCollection collection = resourceGroupResource.GetHeterogeneousAssessments(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + HeterogeneousAssessmentResource result = await collection.GetAsync(assessmentName); + + // 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 + HeterogeneousAssessmentData 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_HeterogeneousAssessmentOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HeterogeneousAssessmentResource + string projectName = "contosoProject"; + HeterogeneousAssessmentCollection collection = resourceGroupResource.GetHeterogeneousAssessments(projectName); + + // invoke the operation and iterate over the result + await foreach (HeterogeneousAssessmentResource 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 + HeterogeneousAssessmentData 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_HeterogeneousAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HeterogeneousAssessmentResource + string projectName = "contosoProject"; + HeterogeneousAssessmentCollection collection = resourceGroupResource.GetHeterogeneousAssessments(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_HeterogeneousAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this HeterogeneousAssessmentResource + string projectName = "contosoProject"; + HeterogeneousAssessmentCollection collection = resourceGroupResource.GetHeterogeneousAssessments(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + HeterogeneousAssessmentResource 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 + HeterogeneousAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentResource.cs new file mode 100644 index 000000000000..fc9135ee77cd --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentResource.cs @@ -0,0 +1,116 @@ +// 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.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_HeterogeneousAssessmentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HeterogeneousAssessmentOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // invoke the operation + HeterogeneousAssessmentResource result = await heterogeneousAssessment.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 + HeterogeneousAssessmentData 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_HeterogeneousAssessmentOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_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 HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // invoke the operation + await heterogeneousAssessment.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_HeterogeneousAssessmentOperationsCreate() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentOperations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessment_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 HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // invoke the operation + HeterogeneousAssessmentData data = new HeterogeneousAssessmentData + { + Properties = new HeterogeneousAssessmentProperties + { + AssessmentArmIds = { "gartykxgfvqccfs" }, + }, + }; + ArmOperation lro = await heterogeneousAssessment.UpdateAsync(WaitUntil.Completed, data); + HeterogeneousAssessmentResource 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 + HeterogeneousAssessmentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryCollection.cs new file mode 100644 index 000000000000..1731b0a1ae97 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_HeterogeneousAssessmentSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HeterogeneousAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // get the collection of this HeterogeneousAssessmentSummaryResource + HeterogeneousAssessmentSummaryCollection collection = heterogeneousAssessment.GetHeterogeneousAssessmentSummaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + HeterogeneousAssessmentSummaryResource result = await collection.GetAsync(summaryName); + + // 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 + HeterogeneousAssessmentSummaryData 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_HeterogeneousAssessmentSummaryOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessmentSummary_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 HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // get the collection of this HeterogeneousAssessmentSummaryResource + HeterogeneousAssessmentSummaryCollection collection = heterogeneousAssessment.GetHeterogeneousAssessmentSummaries(); + + // invoke the operation and iterate over the result + await foreach (HeterogeneousAssessmentSummaryResource 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 + HeterogeneousAssessmentSummaryData 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_HeterogeneousAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // get the collection of this HeterogeneousAssessmentSummaryResource + HeterogeneousAssessmentSummaryCollection collection = heterogeneousAssessment.GetHeterogeneousAssessmentSummaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_HeterogeneousAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HeterogeneousAssessmentResource created on azure + // for more information of creating HeterogeneousAssessmentResource, please refer to the document of HeterogeneousAssessmentResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier heterogeneousAssessmentResourceId = HeterogeneousAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + HeterogeneousAssessmentResource heterogeneousAssessment = client.GetHeterogeneousAssessmentResource(heterogeneousAssessmentResourceId); + + // get the collection of this HeterogeneousAssessmentSummaryResource + HeterogeneousAssessmentSummaryCollection collection = heterogeneousAssessment.GetHeterogeneousAssessmentSummaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + HeterogeneousAssessmentSummaryResource 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 + HeterogeneousAssessmentSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryResource.cs new file mode 100644 index 000000000000..8d60f7b81cd9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_HeterogeneousAssessmentSummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_HeterogeneousAssessmentSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_HeterogeneousAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/HeterogeneousAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "HeterogeneousAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this HeterogeneousAssessmentSummaryResource created on azure + // for more information of creating HeterogeneousAssessmentSummaryResource, please refer to the document of HeterogeneousAssessmentSummaryResource + string subscriptionId = "EC3B3DC9-A26C-468D-B5F2-9C775E8BBA5F"; + string resourceGroupName = "rgheterogeneousAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string summaryName = "PaaSPreferred"; + ResourceIdentifier heterogeneousAssessmentSummaryResourceId = HeterogeneousAssessmentSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, summaryName); + HeterogeneousAssessmentSummaryResource heterogeneousAssessmentSummary = client.GetHeterogeneousAssessmentSummaryResource(heterogeneousAssessmentSummaryResourceId); + + // invoke the operation + HeterogeneousAssessmentSummaryResource result = await heterogeneousAssessmentSummary.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 + HeterogeneousAssessmentSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryCollection.cs new file mode 100644 index 000000000000..36fb13618834 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_IaasSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseIaasSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseIaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this IaasSummaryResource + IaasSummaryCollection collection = businessCase.GetIaasSummaries(); + + // invoke the operation + string iaasSummaryName = "MySummary"; + IaasSummaryResource result = await collection.GetAsync(iaasSummaryName); + + // 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 + IaasSummaryData 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_BusinessCaseIaasSummaryOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseIaasSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "IaasSummary_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 BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this IaasSummaryResource + IaasSummaryCollection collection = businessCase.GetIaasSummaries(); + + // invoke the operation and iterate over the result + await foreach (IaasSummaryResource 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 + IaasSummaryData 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_BusinessCaseIaasSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseIaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this IaasSummaryResource + IaasSummaryCollection collection = businessCase.GetIaasSummaries(); + + // invoke the operation + string iaasSummaryName = "MySummary"; + bool result = await collection.ExistsAsync(iaasSummaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BusinessCaseIaasSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseIaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this IaasSummaryResource + IaasSummaryCollection collection = businessCase.GetIaasSummaries(); + + // invoke the operation + string iaasSummaryName = "MySummary"; + NullableResponse response = await collection.GetIfExistsAsync(iaasSummaryName); + IaasSummaryResource 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 + IaasSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryResource.cs new file mode 100644 index 000000000000..7cac5d617705 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_IaasSummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_IaasSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseIaasSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseIaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "IaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this IaasSummaryResource created on azure + // for more information of creating IaasSummaryResource, please refer to the document of IaasSummaryResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string iaasSummaryName = "MySummary"; + ResourceIdentifier iaasSummaryResourceId = IaasSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, iaasSummaryName); + IaasSummaryResource iaasSummary = client.GetIaasSummaryResource(iaasSummaryResourceId); + + // invoke the operation + IaasSummaryResource result = await iaasSummary.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 + IaasSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Collection.cs new file mode 100644 index 000000000000..5dea4351339d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Collection.cs @@ -0,0 +1,249 @@ +// 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.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MachineAssessmentV2Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_MachineAssessmentsV2OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_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 = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineAssessmentV2Resource + string projectName = "contosoProject"; + MachineAssessmentV2Collection collection = resourceGroupResource.GetMachineAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + MachineAssessmentV2Data data = new MachineAssessmentV2Data + { + Properties = new MachineAssessmentV2Properties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "f", + AzureResourceGraphQuery = "hfhwuqalmenpcttboxvo", + }, + Settings = new MachineAssessmentSettings + { + AzureLocation = "rsequlcso", + Currency = AzureCurrency.Unknown, + ScalingFactor = 9F, + DiscountPercentage = 5F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T05:47:51.336Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T05:47:51.336Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "lee", + }, + EnvironmentType = EnvironmentType.Production, + AzureSecurityOfferingType = AzureSecurityOfferingType.NO, + AzureDiskTypes = { AzureDiskType.Unknown }, + AzurePricingTier = AzurePricingTier.Standard, + AzureStorageRedundancy = AzureStorageRedundancy.Unknown, + AzureHybridUseBenefit = AzureHybridUseBenefit.Unknown, + LinuxAzureHybridUseBenefit = AzureHybridUseBenefit.Unknown, + AzureVmFamilies = { AzureVmFamily.Unknown }, + VmUptime = new VmUptime + { + DaysPerMonth = 9, + HoursPerDay = 10, + }, + AzureVmSecurityOptions = { AzureVmSecurityType.TVM }, + }, + Details = new AssessmentDetails(), + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + MachineAssessmentV2Resource 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 + MachineAssessmentV2Data 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_MachineAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineAssessmentV2Resource + string projectName = "contosoProject"; + MachineAssessmentV2Collection collection = resourceGroupResource.GetMachineAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + MachineAssessmentV2Resource result = await collection.GetAsync(assessmentName); + + // 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 + MachineAssessmentV2Data 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_MachineAssessmentsV2OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineAssessmentV2Resource + string projectName = "contosoProject"; + MachineAssessmentV2Collection collection = resourceGroupResource.GetMachineAssessmentV2s(projectName); + + // invoke the operation and iterate over the result + await foreach (MachineAssessmentV2Resource 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 + MachineAssessmentV2Data 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_MachineAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineAssessmentV2Resource + string projectName = "contosoProject"; + MachineAssessmentV2Collection collection = resourceGroupResource.GetMachineAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_MachineAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineAssessmentV2Resource + string projectName = "contosoProject"; + MachineAssessmentV2Collection collection = resourceGroupResource.GetMachineAssessmentV2s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + MachineAssessmentV2Resource 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 + MachineAssessmentV2Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Resource.cs new file mode 100644 index 000000000000..ba3a049f0cab --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2Resource.cs @@ -0,0 +1,190 @@ +// 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.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MachineAssessmentV2Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MachineAssessmentsV2OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // invoke the operation + MachineAssessmentV2Resource result = await machineAssessmentV2.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 + MachineAssessmentV2Data 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_MachineAssessmentsV2OperationsDeleteMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_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 MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // invoke the operation + await machineAssessmentV2.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_MachineAssessmentsV2OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2_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 MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // invoke the operation + MachineAssessmentV2Data data = new MachineAssessmentV2Data + { + Properties = new MachineAssessmentV2Properties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "f", + AzureResourceGraphQuery = "hfhwuqalmenpcttboxvo", + }, + Settings = new MachineAssessmentSettings + { + AzureLocation = "rsequlcso", + Currency = AzureCurrency.Unknown, + ScalingFactor = 9F, + DiscountPercentage = 5F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T05:47:51.336Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T05:47:51.336Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "lee", + }, + EnvironmentType = EnvironmentType.Production, + AzureSecurityOfferingType = AzureSecurityOfferingType.NO, + AzureDiskTypes = { AzureDiskType.Unknown }, + AzurePricingTier = AzurePricingTier.Standard, + AzureStorageRedundancy = AzureStorageRedundancy.Unknown, + AzureHybridUseBenefit = AzureHybridUseBenefit.Unknown, + LinuxAzureHybridUseBenefit = AzureHybridUseBenefit.Unknown, + AzureVmFamilies = { AzureVmFamily.Unknown }, + VmUptime = new VmUptime + { + DaysPerMonth = 9, + HoursPerDay = 10, + }, + AzureVmSecurityOptions = { AzureVmSecurityType.TVM }, + }, + Details = new AssessmentDetails(), + }, + }; + ArmOperation lro = await machineAssessmentV2.UpdateAsync(WaitUntil.Completed, data); + MachineAssessmentV2Resource 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 + MachineAssessmentV2Data 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 DownloadUrl_GetDownloadURLForTheAssessmentReport() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentsV2Operations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentsV2Operations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // invoke the operation + DownloadUrlContent content = new DownloadUrlContent(); + ArmOperation lro = await machineAssessmentV2.DownloadUrlAsync(WaitUntil.Completed, content); + DownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryCollection.cs new file mode 100644 index 000000000000..9d704d70c9dc --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MachineAssessmentV2SummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MachineAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this MachineAssessmentV2SummaryResource + MachineAssessmentV2SummaryCollection collection = machineAssessmentV2.GetMachineAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + MachineAssessmentV2SummaryResource result = await collection.GetAsync(summaryName); + + // 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 + MachineAssessmentV2SummaryData 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_MachineAssessmentV2SummaryOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2Summary_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 MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this MachineAssessmentV2SummaryResource + MachineAssessmentV2SummaryCollection collection = machineAssessmentV2.GetMachineAssessmentV2Summaries(); + + // invoke the operation and iterate over the result + await foreach (MachineAssessmentV2SummaryResource 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 + MachineAssessmentV2SummaryData 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_MachineAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this MachineAssessmentV2SummaryResource + MachineAssessmentV2SummaryCollection collection = machineAssessmentV2.GetMachineAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_MachineAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2Resource created on azure + // for more information of creating MachineAssessmentV2Resource, please refer to the document of MachineAssessmentV2Resource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier machineAssessmentV2ResourceId = MachineAssessmentV2Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + MachineAssessmentV2Resource machineAssessmentV2 = client.GetMachineAssessmentV2Resource(machineAssessmentV2ResourceId); + + // get the collection of this MachineAssessmentV2SummaryResource + MachineAssessmentV2SummaryCollection collection = machineAssessmentV2.GetMachineAssessmentV2Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + MachineAssessmentV2SummaryResource 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 + MachineAssessmentV2SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryResource.cs new file mode 100644 index 000000000000..ddec47394136 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineAssessmentV2SummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MachineAssessmentV2SummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MachineAssessmentV2SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineAssessmentV2SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineAssessmentV2Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineAssessmentV2SummaryResource created on azure + // for more information of creating MachineAssessmentV2SummaryResource, please refer to the document of MachineAssessmentV2SummaryResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string summaryName = "PaaSPreferred"; + ResourceIdentifier machineAssessmentV2SummaryResourceId = MachineAssessmentV2SummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, summaryName); + MachineAssessmentV2SummaryResource machineAssessmentV2Summary = client.GetMachineAssessmentV2SummaryResource(machineAssessmentV2SummaryResourceId); + + // invoke the operation + MachineAssessmentV2SummaryResource result = await machineAssessmentV2Summary.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 + MachineAssessmentV2SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionCollection.cs new file mode 100644 index 000000000000..c5ac346d6d0e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionCollection.cs @@ -0,0 +1,158 @@ +// 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.Migrate.Samples +{ + public partial class Sample_MachineGraphAssessmentOptionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MachineGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineGraphAssessmentOptionResource + string projectName = "contosoProject"; + MachineGraphAssessmentOptionCollection collection = resourceGroupResource.GetMachineGraphAssessmentOptions(projectName); + + // invoke the operation + MachineGraphAssessmentOptionResource result = await collection.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 + MachineGraphAssessmentOptionData 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_MachineGraphAssessmentOptionsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "MachineGraphAssessmentOptions_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineGraphAssessmentOptionResource + string projectName = "contosoProject"; + MachineGraphAssessmentOptionCollection collection = resourceGroupResource.GetMachineGraphAssessmentOptions(projectName); + + // invoke the operation and iterate over the result + await foreach (MachineGraphAssessmentOptionResource 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 + MachineGraphAssessmentOptionData 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_MachineGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineGraphAssessmentOptionResource + string projectName = "contosoProject"; + MachineGraphAssessmentOptionCollection collection = resourceGroupResource.GetMachineGraphAssessmentOptions(projectName); + + // invoke the operation + bool result = await collection.ExistsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_MachineGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this MachineGraphAssessmentOptionResource + string projectName = "contosoProject"; + MachineGraphAssessmentOptionCollection collection = resourceGroupResource.GetMachineGraphAssessmentOptions(projectName); + + // invoke the operation + NullableResponse response = await collection.GetIfExistsAsync(); + MachineGraphAssessmentOptionResource 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 + MachineGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionResource.cs new file mode 100644 index 000000000000..9c1d9800b130 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MachineGraphAssessmentOptionResource.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.Migrate.Samples +{ + public partial class Sample_MachineGraphAssessmentOptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_MachineGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/MachineGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "MachineGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MachineGraphAssessmentOptionResource created on azure + // for more information of creating MachineGraphAssessmentOptionResource, please refer to the document of MachineGraphAssessmentOptionResource + string subscriptionId = "AEDD0824-BBE9-4E7C-8909-F46C68EA6BB9"; + string resourceGroupName = "rgmachineAssessments"; + string projectName = "contosoProject"; + ResourceIdentifier machineGraphAssessmentOptionResourceId = MachineGraphAssessmentOptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + MachineGraphAssessmentOptionResource machineGraphAssessmentOption = client.GetMachineGraphAssessmentOptionResource(machineGraphAssessmentOptionResourceId); + + // invoke the operation + MachineGraphAssessmentOptionResource result = await machineGraphAssessmentOption.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 + MachineGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..1896cf67e173 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MigratePrivateEndpointConnectionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PrivateEndpointConnectionOperationsUpdate() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Update_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateEndpointConnectionResource + MigratePrivateEndpointConnectionCollection collection = assessmentProject.GetMigratePrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + MigratePrivateEndpointConnectionData data = new MigratePrivateEndpointConnectionData + { + Properties = new PrivateEndpointConnectionProperties(new MigratePrivateLinkServiceConnectionState + { + Status = MigratePrivateEndpointServiceConnectionStatus.Approved, + ActionsRequired = "", + }), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data); + MigratePrivateEndpointConnectionResource 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 + MigratePrivateEndpointConnectionData 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_PrivateEndpointConnectionOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateEndpointConnectionResource + MigratePrivateEndpointConnectionCollection collection = assessmentProject.GetMigratePrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + MigratePrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigratePrivateEndpointConnectionData 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_PrivateEndpointConnectionOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_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 AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateEndpointConnectionResource + MigratePrivateEndpointConnectionCollection collection = assessmentProject.GetMigratePrivateEndpointConnections(); + + // invoke the operation and iterate over the result + await foreach (MigratePrivateEndpointConnectionResource 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 + MigratePrivateEndpointConnectionData 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_PrivateEndpointConnectionOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateEndpointConnectionResource + MigratePrivateEndpointConnectionCollection collection = assessmentProject.GetMigratePrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + bool result = await collection.ExistsAsync(privateEndpointConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_PrivateEndpointConnectionOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateEndpointConnectionResource + MigratePrivateEndpointConnectionCollection collection = assessmentProject.GetMigratePrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + NullableResponse response = await collection.GetIfExistsAsync(privateEndpointConnectionName); + MigratePrivateEndpointConnectionResource 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 + MigratePrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..f5d8185fafcf --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateEndpointConnectionResource.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_MigratePrivateEndpointConnectionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PrivateEndpointConnectionOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigratePrivateEndpointConnectionResource created on azure + // for more information of creating MigratePrivateEndpointConnectionResource, please refer to the document of MigratePrivateEndpointConnectionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + ResourceIdentifier migratePrivateEndpointConnectionResourceId = MigratePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName); + MigratePrivateEndpointConnectionResource migratePrivateEndpointConnection = client.GetMigratePrivateEndpointConnectionResource(migratePrivateEndpointConnectionResourceId); + + // invoke the operation + MigratePrivateEndpointConnectionResource result = await migratePrivateEndpointConnection.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 + MigratePrivateEndpointConnectionData 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_PrivateEndpointConnectionOperationsDelete() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigratePrivateEndpointConnectionResource created on azure + // for more information of creating MigratePrivateEndpointConnectionResource, please refer to the document of MigratePrivateEndpointConnectionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + ResourceIdentifier migratePrivateEndpointConnectionResourceId = MigratePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName); + MigratePrivateEndpointConnectionResource migratePrivateEndpointConnection = client.GetMigratePrivateEndpointConnectionResource(migratePrivateEndpointConnectionResourceId); + + // invoke the operation + await migratePrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PrivateEndpointConnectionOperationsUpdate() + { + // Generated from example definition: 2024-03-03-preview/PrivateEndpointConnectionOperations_Update_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateEndpointConnection_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigratePrivateEndpointConnectionResource created on azure + // for more information of creating MigratePrivateEndpointConnectionResource, please refer to the document of MigratePrivateEndpointConnectionResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + string privateEndpointConnectionName = "sakanwar1204project1634pe.bf42f8a1-09f5-4ee4-aea6-a019cc60f9d7"; + ResourceIdentifier migratePrivateEndpointConnectionResourceId = MigratePrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, privateEndpointConnectionName); + MigratePrivateEndpointConnectionResource migratePrivateEndpointConnection = client.GetMigratePrivateEndpointConnectionResource(migratePrivateEndpointConnectionResourceId); + + // invoke the operation + MigratePrivateEndpointConnectionData data = new MigratePrivateEndpointConnectionData + { + Properties = new PrivateEndpointConnectionProperties(new MigratePrivateLinkServiceConnectionState + { + Status = MigratePrivateEndpointServiceConnectionStatus.Approved, + ActionsRequired = "", + }), + }; + ArmOperation lro = await migratePrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); + MigratePrivateEndpointConnectionResource 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 + MigratePrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataCollection.cs new file mode 100644 index 000000000000..f9f2b4e97472 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataCollection.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.Migrate.Samples +{ + public partial class Sample_MigratePrivateLinkResourceDataCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PrivateLinkResourceOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateLinkResourceDataResource + MigratePrivateLinkResourceDataCollection collection = assessmentProject.GetAllMigratePrivateLinkResourceData(); + + // invoke the operation + string privateLinkResourceName = "Default"; + MigratePrivateLinkResourceDataResource result = await collection.GetAsync(privateLinkResourceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + MigratePrivateLinkResourceDataData 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_PrivateLinkResourceOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/PrivateLinkResourceOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResource_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 AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateLinkResourceDataResource + MigratePrivateLinkResourceDataCollection collection = assessmentProject.GetAllMigratePrivateLinkResourceData(); + + // invoke the operation and iterate over the result + await foreach (MigratePrivateLinkResourceDataResource 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 + MigratePrivateLinkResourceDataData 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_PrivateLinkResourceOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateLinkResourceDataResource + MigratePrivateLinkResourceDataCollection collection = assessmentProject.GetAllMigratePrivateLinkResourceData(); + + // invoke the operation + string privateLinkResourceName = "Default"; + bool result = await collection.ExistsAsync(privateLinkResourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_PrivateLinkResourceOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this AssessmentProjectResource created on azure + // for more information of creating AssessmentProjectResource, please refer to the document of AssessmentProjectResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + ResourceIdentifier assessmentProjectResourceId = AssessmentProjectResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + AssessmentProjectResource assessmentProject = client.GetAssessmentProjectResource(assessmentProjectResourceId); + + // get the collection of this MigratePrivateLinkResourceDataResource + MigratePrivateLinkResourceDataCollection collection = assessmentProject.GetAllMigratePrivateLinkResourceData(); + + // invoke the operation + string privateLinkResourceName = "Default"; + NullableResponse response = await collection.GetIfExistsAsync(privateLinkResourceName); + MigratePrivateLinkResourceDataResource 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 + MigratePrivateLinkResourceDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataResource.cs new file mode 100644 index 000000000000..1df86a0dd65d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_MigratePrivateLinkResourceDataResource.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.Migrate.Samples +{ + public partial class Sample_MigratePrivateLinkResourceDataResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_PrivateLinkResourceOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/PrivateLinkResourceOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this MigratePrivateLinkResourceDataResource created on azure + // for more information of creating MigratePrivateLinkResourceDataResource, please refer to the document of MigratePrivateLinkResourceDataResource + string subscriptionId = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + string resourceGroupName = "sakanwar"; + string projectName = "sakanwar1204project"; + string privateLinkResourceName = "Default"; + ResourceIdentifier migratePrivateLinkResourceDataResourceId = MigratePrivateLinkResourceDataResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, privateLinkResourceName); + MigratePrivateLinkResourceDataResource migratePrivateLinkResourceData = client.GetMigratePrivateLinkResourceDataResource(migratePrivateLinkResourceDataResourceId); + + // invoke the operation + MigratePrivateLinkResourceDataResource result = await migratePrivateLinkResourceData.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 + MigratePrivateLinkResourceDataData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryCollection.cs new file mode 100644 index 000000000000..b3bd231ff47f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_OverviewSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseOverviewSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOverviewSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OverviewSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this OverviewSummaryResource + OverviewSummaryCollection collection = businessCase.GetOverviewSummaries(); + + // invoke the operation + string overviewSummaryName = "MySummary"; + OverviewSummaryResource result = await collection.GetAsync(overviewSummaryName); + + // 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 + OverviewSummaryData 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_BusinessCaseOverviewSummaryOperationsListByParentMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOverviewSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "OverviewSummary_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 BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this OverviewSummaryResource + OverviewSummaryCollection collection = businessCase.GetOverviewSummaries(); + + // invoke the operation and iterate over the result + await foreach (OverviewSummaryResource 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 + OverviewSummaryData 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_BusinessCaseOverviewSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOverviewSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OverviewSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this OverviewSummaryResource + OverviewSummaryCollection collection = businessCase.GetOverviewSummaries(); + + // invoke the operation + string overviewSummaryName = "MySummary"; + bool result = await collection.ExistsAsync(overviewSummaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BusinessCaseOverviewSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOverviewSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OverviewSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this OverviewSummaryResource + OverviewSummaryCollection collection = businessCase.GetOverviewSummaries(); + + // invoke the operation + string overviewSummaryName = "MySummary"; + NullableResponse response = await collection.GetIfExistsAsync(overviewSummaryName); + OverviewSummaryResource 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 + OverviewSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryResource.cs new file mode 100644 index 000000000000..d68466a4639c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_OverviewSummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_OverviewSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCaseOverviewSummaryOperationsGetMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCaseOverviewSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "OverviewSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this OverviewSummaryResource created on azure + // for more information of creating OverviewSummaryResource, please refer to the document of OverviewSummaryResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string overviewSummaryName = "MySummary"; + ResourceIdentifier overviewSummaryResourceId = OverviewSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, overviewSummaryName); + OverviewSummaryResource overviewSummary = client.GetOverviewSummaryResource(overviewSummaryResourceId); + + // invoke the operation + OverviewSummaryResource result = await overviewSummary.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 + OverviewSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryCollection.cs new file mode 100644 index 000000000000..be326b3c0dea --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_PaasSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCasePaasSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCasePaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this PaasSummaryResource + PaasSummaryCollection collection = businessCase.GetPaasSummaries(); + + // invoke the operation + string paasSummaryName = "MySummary"; + PaasSummaryResource result = await collection.GetAsync(paasSummaryName); + + // 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 + PaasSummaryData 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_BusinessCasePaasSummaryOperationsListByParentMaximumSetGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-03-03-preview/BusinessCasePaasSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "PaasSummary_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 BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this PaasSummaryResource + PaasSummaryCollection collection = businessCase.GetPaasSummaries(); + + // invoke the operation and iterate over the result + await foreach (PaasSummaryResource 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 + PaasSummaryData 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_BusinessCasePaasSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCasePaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this PaasSummaryResource + PaasSummaryCollection collection = businessCase.GetPaasSummaries(); + + // invoke the operation + string paasSummaryName = "MySummary"; + bool result = await collection.ExistsAsync(paasSummaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_BusinessCasePaasSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCasePaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this BusinessCaseResource created on azure + // for more information of creating BusinessCaseResource, please refer to the document of BusinessCaseResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + ResourceIdentifier businessCaseResourceId = BusinessCaseResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName); + BusinessCaseResource businessCase = client.GetBusinessCaseResource(businessCaseResourceId); + + // get the collection of this PaasSummaryResource + PaasSummaryCollection collection = businessCase.GetPaasSummaries(); + + // invoke the operation + string paasSummaryName = "MySummary"; + NullableResponse response = await collection.GetIfExistsAsync(paasSummaryName); + PaasSummaryResource 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 + PaasSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryResource.cs new file mode 100644 index 000000000000..ad0ec059bd3e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_PaasSummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_PaasSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_BusinessCasePaasSummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/BusinessCasePaasSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "PaasSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this PaasSummaryResource created on azure + // for more information of creating PaasSummaryResource, please refer to the document of PaasSummaryResource + string subscriptionId = "ADC896AD-6A38-454E-9A62-AFC618F5F4BC"; + string resourceGroupName = "rgbusinessCases"; + string projectName = "MyMigrateProject"; + string businessCaseName = "MyBusinessCase"; + string paasSummaryName = "MySummary"; + ResourceIdentifier paasSummaryResourceId = PaasSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, businessCaseName, paasSummaryName); + PaasSummaryResource paasSummary = client.GetPaasSummaryResource(paasSummaryResourceId); + + // invoke the operation + PaasSummaryResource result = await paasSummary.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 + PaasSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Collection.cs new file mode 100644 index 000000000000..974d4666a0a8 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Collection.cs @@ -0,0 +1,264 @@ +// 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.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_SqlAssessmentV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SqlAssessmentV3OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_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 = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlAssessmentV3Resource + string projectName = "contosoProject"; + SqlAssessmentV3Collection collection = resourceGroupResource.GetSqlAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + SqlAssessmentV3Data data = new SqlAssessmentV3Data + { + Properties = new SqlAssessmentV3Properties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "ppxcjyrxfmpm", + AzureResourceGraphQuery = "ddqs", + }, + Settings = new SqlAssessmentSettings + { + AzureLocation = "vtpazagckatiezkiwol", + Currency = AzureCurrency.Unknown, + ScalingFactor = 27F, + DiscountPercentage = 8F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T05:15:28.133Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T05:15:28.133Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "sp", + }, + EnvironmentType = EnvironmentType.Production, + OSLicense = OSLicense.Unknown, + EntityUptime = new EntityUptime + { + DaysPerMonth = 2, + HoursPerDay = 28, + }, + PreferredTargets = { AzureTarget.Unknown }, + AzureSqlManagedInstanceSettings = new SqlMiSettingsV3 + { + AzureSqlServiceTier = AzureSqlServiceTierV3.SqlServiceUnknown, + AzureSqlInstanceType = AzureSqlInstanceType.Unknown, + }, + AzureSqlDatabaseSettings = new SqlDbSettingsV3 + { + AzureSqlServiceTier = AzureSqlServiceTierV3.SqlServiceUnknown, + AzureSqlDataBaseType = AzureSqlDataBaseType.Unknown, + AzureSqlComputeTier = ComputeTier.Unknown, + AzureSqlPurchaseModel = AzureSqlPurchaseModel.Unknown, + }, + AzureSqlVmInstanceSeries = { AzureVmFamily.Unknown }, + MultiSubnetIntent = MultiSubnetIntent.None, + AsyncCommitModeIntent = AsyncCommitModeIntent.None, + IsInternetAccessAvailable = true, + DisasterRecoveryLocation = Models.AzureLocation.Unknown, + EnableHadrAssessment = true, + AzureSecurityOfferingType = AzureSecurityOfferingType.NO, + SqlServerLicense = SqlServerLicense.Unknown, + }, + Details = new AssessmentDetails(), + FallbackMachineAssessmentArmId = "jfwkifsuigza", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + SqlAssessmentV3Resource 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 + SqlAssessmentV3Data 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_SqlAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlAssessmentV3Resource + string projectName = "contosoProject"; + SqlAssessmentV3Collection collection = resourceGroupResource.GetSqlAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + SqlAssessmentV3Resource result = await collection.GetAsync(assessmentName); + + // 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 + SqlAssessmentV3Data 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_SqlAssessmentV3OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlAssessmentV3Resource + string projectName = "contosoProject"; + SqlAssessmentV3Collection collection = resourceGroupResource.GetSqlAssessmentV3s(projectName); + + // invoke the operation and iterate over the result + await foreach (SqlAssessmentV3Resource 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 + SqlAssessmentV3Data 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_SqlAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlAssessmentV3Resource + string projectName = "contosoProject"; + SqlAssessmentV3Collection collection = resourceGroupResource.GetSqlAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SqlAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlAssessmentV3Resource + string projectName = "contosoProject"; + SqlAssessmentV3Collection collection = resourceGroupResource.GetSqlAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + SqlAssessmentV3Resource 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 + SqlAssessmentV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Resource.cs new file mode 100644 index 000000000000..d68c968d5264 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3Resource.cs @@ -0,0 +1,205 @@ +// 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.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_SqlAssessmentV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // invoke the operation + SqlAssessmentV3Resource result = await sqlAssessmentV3.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 + SqlAssessmentV3Data 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_SqlAssessmentV3OperationsDeleteMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_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 SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // invoke the operation + await sqlAssessmentV3.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SqlAssessmentV3OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3_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 SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // invoke the operation + SqlAssessmentV3Data data = new SqlAssessmentV3Data + { + Properties = new SqlAssessmentV3Properties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "ppxcjyrxfmpm", + AzureResourceGraphQuery = "ddqs", + }, + Settings = new SqlAssessmentSettings + { + AzureLocation = "vtpazagckatiezkiwol", + Currency = AzureCurrency.Unknown, + ScalingFactor = 27F, + DiscountPercentage = 8F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T05:15:28.133Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T05:15:28.133Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "sp", + }, + EnvironmentType = EnvironmentType.Production, + OSLicense = OSLicense.Unknown, + EntityUptime = new EntityUptime + { + DaysPerMonth = 2, + HoursPerDay = 28, + }, + PreferredTargets = { AzureTarget.Unknown }, + AzureSqlManagedInstanceSettings = new SqlMiSettingsV3 + { + AzureSqlServiceTier = AzureSqlServiceTierV3.SqlServiceUnknown, + AzureSqlInstanceType = AzureSqlInstanceType.Unknown, + }, + AzureSqlDatabaseSettings = new SqlDbSettingsV3 + { + AzureSqlServiceTier = AzureSqlServiceTierV3.SqlServiceUnknown, + AzureSqlDataBaseType = AzureSqlDataBaseType.Unknown, + AzureSqlComputeTier = ComputeTier.Unknown, + AzureSqlPurchaseModel = AzureSqlPurchaseModel.Unknown, + }, + AzureSqlVmInstanceSeries = { AzureVmFamily.Unknown }, + MultiSubnetIntent = MultiSubnetIntent.None, + AsyncCommitModeIntent = AsyncCommitModeIntent.None, + IsInternetAccessAvailable = true, + DisasterRecoveryLocation = Models.AzureLocation.Unknown, + EnableHadrAssessment = true, + AzureSecurityOfferingType = AzureSecurityOfferingType.NO, + SqlServerLicense = SqlServerLicense.Unknown, + }, + Details = new AssessmentDetails(), + FallbackMachineAssessmentArmId = "jfwkifsuigza", + }, + }; + ArmOperation lro = await sqlAssessmentV3.UpdateAsync(WaitUntil.Completed, data); + SqlAssessmentV3Resource 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 + SqlAssessmentV3Data 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 DownloadUrl_GetDownloadURLForTheAssessmentReport() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3Operations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3Operations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // invoke the operation + DownloadUrlContent content = new DownloadUrlContent(); + ArmOperation lro = await sqlAssessmentV3.DownloadUrlAsync(WaitUntil.Completed, content); + DownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryCollection.cs new file mode 100644 index 000000000000..9ecb94f3038a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_SqlAssessmentV3SummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this SqlAssessmentV3SummaryResource + SqlAssessmentV3SummaryCollection collection = sqlAssessmentV3.GetSqlAssessmentV3Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + SqlAssessmentV3SummaryResource result = await collection.GetAsync(summaryName); + + // 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 + SqlAssessmentV3SummaryData 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_SqlAssessmentV3SummaryOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3SummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3Summary_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 SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this SqlAssessmentV3SummaryResource + SqlAssessmentV3SummaryCollection collection = sqlAssessmentV3.GetSqlAssessmentV3Summaries(); + + // invoke the operation and iterate over the result + await foreach (SqlAssessmentV3SummaryResource 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 + SqlAssessmentV3SummaryData 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_SqlAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this SqlAssessmentV3SummaryResource + SqlAssessmentV3SummaryCollection collection = sqlAssessmentV3.GetSqlAssessmentV3Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SqlAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3Resource created on azure + // for more information of creating SqlAssessmentV3Resource, please refer to the document of SqlAssessmentV3Resource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier sqlAssessmentV3ResourceId = SqlAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + SqlAssessmentV3Resource sqlAssessmentV3 = client.GetSqlAssessmentV3Resource(sqlAssessmentV3ResourceId); + + // get the collection of this SqlAssessmentV3SummaryResource + SqlAssessmentV3SummaryCollection collection = sqlAssessmentV3.GetSqlAssessmentV3Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + SqlAssessmentV3SummaryResource 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 + SqlAssessmentV3SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryResource.cs new file mode 100644 index 000000000000..0ef7810da944 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlAssessmentV3SummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_SqlAssessmentV3SummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlAssessmentV3SummaryResource created on azure + // for more information of creating SqlAssessmentV3SummaryResource, please refer to the document of SqlAssessmentV3SummaryResource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string summaryName = "PaaSPreferred"; + ResourceIdentifier sqlAssessmentV3SummaryResourceId = SqlAssessmentV3SummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, summaryName); + SqlAssessmentV3SummaryResource sqlAssessmentV3Summary = client.GetSqlAssessmentV3SummaryResource(sqlAssessmentV3SummaryResourceId); + + // invoke the operation + SqlAssessmentV3SummaryResource result = await sqlAssessmentV3Summary.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 + SqlAssessmentV3SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionCollection.cs new file mode 100644 index 000000000000..f0ae6c5db983 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionCollection.cs @@ -0,0 +1,158 @@ +// 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.Migrate.Samples +{ + public partial class Sample_SqlGraphAssessmentOptionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlGraphAssessmentOptionResource + string projectName = "contosoProject"; + SqlGraphAssessmentOptionCollection collection = resourceGroupResource.GetSqlGraphAssessmentOptions(projectName); + + // invoke the operation + SqlGraphAssessmentOptionResource result = await collection.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 + SqlGraphAssessmentOptionData 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_SqlGraphAssessmentOptionsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "SqlGraphAssessmentOptions_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "C1DB66AE-BCF9-42FD-ADC2-390E0721C351"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlGraphAssessmentOptionResource + string projectName = "contosoProject"; + SqlGraphAssessmentOptionCollection collection = resourceGroupResource.GetSqlGraphAssessmentOptions(projectName); + + // invoke the operation and iterate over the result + await foreach (SqlGraphAssessmentOptionResource 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 + SqlGraphAssessmentOptionData 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_SqlGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlGraphAssessmentOptionResource + string projectName = "contosoProject"; + SqlGraphAssessmentOptionCollection collection = resourceGroupResource.GetSqlGraphAssessmentOptions(projectName); + + // invoke the operation + bool result = await collection.ExistsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SqlGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SqlGraphAssessmentOptionResource + string projectName = "contosoProject"; + SqlGraphAssessmentOptionCollection collection = resourceGroupResource.GetSqlGraphAssessmentOptions(projectName); + + // invoke the operation + NullableResponse response = await collection.GetIfExistsAsync(); + SqlGraphAssessmentOptionResource 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 + SqlGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionResource.cs new file mode 100644 index 000000000000..59cbf2f76266 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SqlGraphAssessmentOptionResource.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.Migrate.Samples +{ + public partial class Sample_SqlGraphAssessmentOptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SqlGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/SqlGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "SqlGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SqlGraphAssessmentOptionResource created on azure + // for more information of creating SqlGraphAssessmentOptionResource, please refer to the document of SqlGraphAssessmentOptionResource + string subscriptionId = "C9266982-8528-4ED9-B481-C264A7164AB9"; + string resourceGroupName = "rgsqlAssessments"; + string projectName = "contosoProject"; + ResourceIdentifier sqlGraphAssessmentOptionResourceId = SqlGraphAssessmentOptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + SqlGraphAssessmentOptionResource sqlGraphAssessmentOption = client.GetSqlGraphAssessmentOptionResource(sqlGraphAssessmentOptionResourceId); + + // invoke the operation + SqlGraphAssessmentOptionResource result = await sqlGraphAssessmentOption.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 + SqlGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..cfa3841977c8 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAssessmentProjects_AssessmentProjectsOperationsListBySubscription() + { + // Generated from example definition: 2024-03-03-preview/AssessmentProjectsOperations_ListBySubscription_MaximumSet_Gen.json + // this example is just showing the usage of "AssessmentProject_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 = "4bd2aa0f-2bd2-4d67-91a8-5a4533d58600"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (AssessmentProjectResource item in subscriptionResource.GetAssessmentProjectsAsync()) + { + // 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 + AssessmentProjectData 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/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Collection.cs new file mode 100644 index 000000000000..e14f8f9cfd3c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Collection.cs @@ -0,0 +1,237 @@ +// 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.Migrate.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppAssessmentV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_WebAppAssessmentV3OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_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 = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppAssessmentV3Resource + string projectName = "contosoProject"; + WebAppAssessmentV3Collection collection = resourceGroupResource.GetWebAppAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + WebAppAssessmentV3Data data = new WebAppAssessmentV3Data + { + Properties = new WebAppAssessmentV3Properties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "sxwigkygd", + AzureResourceGraphQuery = "mjonozzzflcglhdb", + }, + Settings = new WebAppAssessmentSettings(new AppSvcNativeSettings(true), new AppSvcContainerSettings(true), AzureSecurityOfferingType.NO) + { + AzureLocation = "khzvggbrcnpkzrqdtvvyytc", + Currency = AzureCurrency.Unknown, + ScalingFactor = 6F, + DiscountPercentage = 12F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T06:18:34.789Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T06:18:34.789Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "lakvxkjeqpajer", + }, + EnvironmentType = EnvironmentType.Production, + }, + Details = new AssessmentDetails(), + FallbackMachineAssessmentArmId = "gfjcubgnh", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, assessmentName, data); + WebAppAssessmentV3Resource 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 + WebAppAssessmentV3Data 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_WebAppAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppAssessmentV3Resource + string projectName = "contosoProject"; + WebAppAssessmentV3Collection collection = resourceGroupResource.GetWebAppAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + WebAppAssessmentV3Resource result = await collection.GetAsync(assessmentName); + + // 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 + WebAppAssessmentV3Data 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_WebAppAssessmentV3OperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppAssessmentV3Resource + string projectName = "contosoProject"; + WebAppAssessmentV3Collection collection = resourceGroupResource.GetWebAppAssessmentV3s(projectName); + + // invoke the operation and iterate over the result + await foreach (WebAppAssessmentV3Resource 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 + WebAppAssessmentV3Data 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_WebAppAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppAssessmentV3Resource + string projectName = "contosoProject"; + WebAppAssessmentV3Collection collection = resourceGroupResource.GetWebAppAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + bool result = await collection.ExistsAsync(assessmentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_WebAppAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WebAppAssessmentV3Resource + string projectName = "contosoProject"; + WebAppAssessmentV3Collection collection = resourceGroupResource.GetWebAppAssessmentV3s(projectName); + + // invoke the operation + string assessmentName = "assessmentName"; + NullableResponse response = await collection.GetIfExistsAsync(assessmentName); + WebAppAssessmentV3Resource 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 + WebAppAssessmentV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Resource.cs new file mode 100644 index 000000000000..622ffc525fcc --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3Resource.cs @@ -0,0 +1,178 @@ +// 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.Migrate.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppAssessmentV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppAssessmentV3OperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // invoke the operation + WebAppAssessmentV3Resource result = await webAppAssessmentV3.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 + WebAppAssessmentV3Data 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_WebAppAssessmentV3OperationsDeleteMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Delete_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_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 WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // invoke the operation + await webAppAssessmentV3.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_WebAppAssessmentV3OperationsCreateMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_Create_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3_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 WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // invoke the operation + WebAppAssessmentV3Data data = new WebAppAssessmentV3Data + { + Properties = new WebAppAssessmentV3Properties + { + Scope = new Scope + { + ScopeType = ScopeType.ServerGroupId, + ServerGroupId = "sxwigkygd", + AzureResourceGraphQuery = "mjonozzzflcglhdb", + }, + Settings = new WebAppAssessmentSettings(new AppSvcNativeSettings(true), new AppSvcContainerSettings(true), AzureSecurityOfferingType.NO) + { + AzureLocation = "khzvggbrcnpkzrqdtvvyytc", + Currency = AzureCurrency.Unknown, + ScalingFactor = 6F, + DiscountPercentage = 12F, + SizingCriterion = AssessmentSizingCriterion.PerformanceBased, + PerformanceData = new PerformanceData + { + Percentile = new Percentile("Unknown"), + TimeRange = TimeRange.Day, + PerfDataStartOn = DateTimeOffset.Parse("2025-02-21T06:18:34.789Z"), + PerfDataEndOn = DateTimeOffset.Parse("2025-02-21T06:18:34.789Z"), + }, + SavingsSettings = new SavingsSettings + { + SavingsOptions = SavingsOption.None, + AzureOfferCode = AzureOffer.Unknown, + }, + BillingSettings = new BillingSettings + { + LicensingProgram = LicensingProgram.Retail, + SubscriptionId = "lakvxkjeqpajer", + }, + EnvironmentType = EnvironmentType.Production, + }, + Details = new AssessmentDetails(), + FallbackMachineAssessmentArmId = "gfjcubgnh", + }, + }; + ArmOperation lro = await webAppAssessmentV3.UpdateAsync(WaitUntil.Completed, data); + WebAppAssessmentV3Resource 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 + WebAppAssessmentV3Data 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 DownloadUrl_WebAppAssessmentV3OperationsDownloadUrlMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3Operations_DownloadUrl_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3Operations_DownloadUrl" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // invoke the operation + DownloadUrlContent content = new DownloadUrlContent(); + ArmOperation lro = await webAppAssessmentV3.DownloadUrlAsync(WaitUntil.Completed, content); + DownloadUri result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryCollection.cs new file mode 100644 index 000000000000..698a93b886c1 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppAssessmentV3SummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppAssessmentV3SummaryResource + WebAppAssessmentV3SummaryCollection collection = webAppAssessmentV3.GetWebAppAssessmentV3Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + WebAppAssessmentV3SummaryResource result = await collection.GetAsync(summaryName); + + // 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 + WebAppAssessmentV3SummaryData 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_WebAppAssessmentV3SummaryOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3SummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3Summary_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 WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppAssessmentV3SummaryResource + WebAppAssessmentV3SummaryCollection collection = webAppAssessmentV3.GetWebAppAssessmentV3Summaries(); + + // invoke the operation and iterate over the result + await foreach (WebAppAssessmentV3SummaryResource 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 + WebAppAssessmentV3SummaryData 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_WebAppAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppAssessmentV3SummaryResource + WebAppAssessmentV3SummaryCollection collection = webAppAssessmentV3.GetWebAppAssessmentV3Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_WebAppAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppAssessmentV3SummaryResource + WebAppAssessmentV3SummaryCollection collection = webAppAssessmentV3.GetWebAppAssessmentV3Summaries(); + + // invoke the operation + string summaryName = "PaaSPreferred"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + WebAppAssessmentV3SummaryResource 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 + WebAppAssessmentV3SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryResource.cs new file mode 100644 index 000000000000..27f4df03781f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppAssessmentV3SummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppAssessmentV3SummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppAssessmentV3SummaryOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppAssessmentV3SummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppAssessmentV3Summary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3SummaryResource created on azure + // for more information of creating WebAppAssessmentV3SummaryResource, please refer to the document of WebAppAssessmentV3SummaryResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string summaryName = "PaaSPreferred"; + ResourceIdentifier webAppAssessmentV3SummaryResourceId = WebAppAssessmentV3SummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, summaryName); + WebAppAssessmentV3SummaryResource webAppAssessmentV3Summary = client.GetWebAppAssessmentV3SummaryResource(webAppAssessmentV3SummaryResourceId); + + // invoke the operation + WebAppAssessmentV3SummaryResource result = await webAppAssessmentV3Summary.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 + WebAppAssessmentV3SummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryCollection.cs new file mode 100644 index 000000000000..b25cb2846a00 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppCompoundAssessmentSummaryCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CompoundAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCompoundAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // get the collection of this WebAppCompoundAssessmentSummaryResource + WebAppCompoundAssessmentSummaryCollection collection = compoundAssessment.GetWebAppCompoundAssessmentSummaries(); + + // invoke the operation + string summaryName = "Modernize"; + WebAppCompoundAssessmentSummaryResource result = await collection.GetAsync(summaryName); + + // 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 + WebAppCompoundAssessmentSummaryData 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_CompoundAssessmentSummaryOperationsListByParent() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentSummaryOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCompoundAssessmentSummary_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 CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // get the collection of this WebAppCompoundAssessmentSummaryResource + WebAppCompoundAssessmentSummaryCollection collection = compoundAssessment.GetWebAppCompoundAssessmentSummaries(); + + // invoke the operation and iterate over the result + await foreach (WebAppCompoundAssessmentSummaryResource 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 + WebAppCompoundAssessmentSummaryData 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_CompoundAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCompoundAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // get the collection of this WebAppCompoundAssessmentSummaryResource + WebAppCompoundAssessmentSummaryCollection collection = compoundAssessment.GetWebAppCompoundAssessmentSummaries(); + + // invoke the operation + string summaryName = "Modernize"; + bool result = await collection.ExistsAsync(summaryName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_CompoundAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCompoundAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this CompoundAssessmentResource created on azure + // for more information of creating CompoundAssessmentResource, please refer to the document of CompoundAssessmentResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + ResourceIdentifier compoundAssessmentResourceId = CompoundAssessmentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + CompoundAssessmentResource compoundAssessment = client.GetCompoundAssessmentResource(compoundAssessmentResourceId); + + // get the collection of this WebAppCompoundAssessmentSummaryResource + WebAppCompoundAssessmentSummaryCollection collection = compoundAssessment.GetWebAppCompoundAssessmentSummaries(); + + // invoke the operation + string summaryName = "Modernize"; + NullableResponse response = await collection.GetIfExistsAsync(summaryName); + WebAppCompoundAssessmentSummaryResource 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 + WebAppCompoundAssessmentSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryResource.cs new file mode 100644 index 000000000000..de472c398784 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppCompoundAssessmentSummaryResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppCompoundAssessmentSummaryResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_CompoundAssessmentSummaryOperationsGet() + { + // Generated from example definition: 2024-03-03-preview/CompoundAssessmentSummaryOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppCompoundAssessmentSummary_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppCompoundAssessmentSummaryResource created on azure + // for more information of creating WebAppCompoundAssessmentSummaryResource, please refer to the document of WebAppCompoundAssessmentSummaryResource + string subscriptionId = "6898488D-BBF0-40FC-A5E3-3DF2C00C5F21"; + string resourceGroupName = "rgwebAppCompoundAssessments"; + string projectName = "contosoProject"; + string compoundAssessmentName = "assessmentName"; + string summaryName = "Modernize"; + ResourceIdentifier webAppCompoundAssessmentSummaryResourceId = WebAppCompoundAssessmentSummaryResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, summaryName); + WebAppCompoundAssessmentSummaryResource webAppCompoundAssessmentSummary = client.GetWebAppCompoundAssessmentSummaryResource(webAppCompoundAssessmentSummaryResourceId); + + // invoke the operation + WebAppCompoundAssessmentSummaryResource result = await webAppCompoundAssessmentSummary.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 + WebAppCompoundAssessmentSummaryData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Collection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Collection.cs new file mode 100644 index 000000000000..4d43621182ca --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Collection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppServicePlanV3Collection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppServicePlansOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppServicePlansOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppServicePlanV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppServicePlanV3Resource + WebAppServicePlanV3Collection collection = webAppAssessmentV3.GetWebAppServicePlanV3s(); + + // invoke the operation + string servicePlanName = "sp1"; + WebAppServicePlanV3Resource result = await collection.GetAsync(servicePlanName); + + // 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 + WebAppServicePlanV3Data 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_WebAppServicePlansOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppServicePlansOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppServicePlanV3_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 WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppServicePlanV3Resource + WebAppServicePlanV3Collection collection = webAppAssessmentV3.GetWebAppServicePlanV3s(); + + // invoke the operation and iterate over the result + await foreach (WebAppServicePlanV3Resource 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 + WebAppServicePlanV3Data 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_WebAppServicePlansOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppServicePlansOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppServicePlanV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppServicePlanV3Resource + WebAppServicePlanV3Collection collection = webAppAssessmentV3.GetWebAppServicePlanV3s(); + + // invoke the operation + string servicePlanName = "sp1"; + bool result = await collection.ExistsAsync(servicePlanName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_WebAppServicePlansOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppServicePlansOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppServicePlanV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppAssessmentV3Resource created on azure + // for more information of creating WebAppAssessmentV3Resource, please refer to the document of WebAppAssessmentV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + ResourceIdentifier webAppAssessmentV3ResourceId = WebAppAssessmentV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName); + WebAppAssessmentV3Resource webAppAssessmentV3 = client.GetWebAppAssessmentV3Resource(webAppAssessmentV3ResourceId); + + // get the collection of this WebAppServicePlanV3Resource + WebAppServicePlanV3Collection collection = webAppAssessmentV3.GetWebAppServicePlanV3s(); + + // invoke the operation + string servicePlanName = "sp1"; + NullableResponse response = await collection.GetIfExistsAsync(servicePlanName); + WebAppServicePlanV3Resource 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 + WebAppServicePlanV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Resource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Resource.cs new file mode 100644 index 000000000000..43cf523407a9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WebAppServicePlanV3Resource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.Migrate.Samples +{ + public partial class Sample_WebAppServicePlanV3Resource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppServicePlansOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppServicePlansOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WebAppServicePlanV3_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WebAppServicePlanV3Resource created on azure + // for more information of creating WebAppServicePlanV3Resource, please refer to the document of WebAppServicePlanV3Resource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + string assessmentName = "assessmentName"; + string servicePlanName = "sp1"; + ResourceIdentifier webAppServicePlanV3ResourceId = WebAppServicePlanV3Resource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName, assessmentName, servicePlanName); + WebAppServicePlanV3Resource webAppServicePlanV3 = client.GetWebAppServicePlanV3Resource(webAppServicePlanV3ResourceId); + + // invoke the operation + WebAppServicePlanV3Resource result = await webAppServicePlanV3.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 + WebAppServicePlanV3Data resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionCollection.cs new file mode 100644 index 000000000000..98d421c46b37 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionCollection.cs @@ -0,0 +1,158 @@ +// 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.Migrate.Samples +{ + public partial class Sample_WepAppGraphAssessmentOptionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WepAppGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WepAppGraphAssessmentOptionResource + string projectName = "contosoProject"; + WepAppGraphAssessmentOptionCollection collection = resourceGroupResource.GetWepAppGraphAssessmentOptions(projectName); + + // invoke the operation + WepAppGraphAssessmentOptionResource result = await collection.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 + WepAppGraphAssessmentOptionData 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_WebAppGraphAssessmentOptionsOperationsListByParentMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppGraphAssessmentOptionsOperations_ListByParent_MaximumSet_Gen.json + // this example is just showing the usage of "WepAppGraphAssessmentOptions_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 ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WepAppGraphAssessmentOptionResource + string projectName = "contosoProject"; + WepAppGraphAssessmentOptionCollection collection = resourceGroupResource.GetWepAppGraphAssessmentOptions(projectName); + + // invoke the operation and iterate over the result + await foreach (WepAppGraphAssessmentOptionResource 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 + WepAppGraphAssessmentOptionData 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_WebAppGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WepAppGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WepAppGraphAssessmentOptionResource + string projectName = "contosoProject"; + WepAppGraphAssessmentOptionCollection collection = resourceGroupResource.GetWepAppGraphAssessmentOptions(projectName); + + // invoke the operation + bool result = await collection.ExistsAsync(); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_WebAppGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WepAppGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this WepAppGraphAssessmentOptionResource + string projectName = "contosoProject"; + WepAppGraphAssessmentOptionCollection collection = resourceGroupResource.GetWepAppGraphAssessmentOptions(projectName); + + // invoke the operation + NullableResponse response = await collection.GetIfExistsAsync(); + WepAppGraphAssessmentOptionResource 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 + WepAppGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionResource.cs new file mode 100644 index 000000000000..2bd7aa063fca --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/samples/Generated/Samples/Sample_WepAppGraphAssessmentOptionResource.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.Migrate.Samples +{ + public partial class Sample_WepAppGraphAssessmentOptionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_WebAppGraphAssessmentOptionsOperationsGetMaximumSet() + { + // Generated from example definition: 2024-03-03-preview/WebAppGraphAssessmentOptionsOperations_Get_MaximumSet_Gen.json + // this example is just showing the usage of "WepAppGraphAssessmentOptions_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this WepAppGraphAssessmentOptionResource created on azure + // for more information of creating WepAppGraphAssessmentOptionResource, please refer to the document of WepAppGraphAssessmentOptionResource + string subscriptionId = "6FFBFE40-C0E1-4FEB-A649-3AC225AB98F0"; + string resourceGroupName = "rgwebAppAssessments"; + string projectName = "contosoProject"; + ResourceIdentifier wepAppGraphAssessmentOptionResourceId = WepAppGraphAssessmentOptionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, projectName); + WepAppGraphAssessmentOptionResource wepAppGraphAssessmentOption = client.GetWepAppGraphAssessmentOptionResource(wepAppGraphAssessmentOptionResourceId); + + // invoke the operation + WepAppGraphAssessmentOptionResource result = await wepAppGraphAssessmentOption.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 + WepAppGraphAssessmentOptionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Azure.ResourceManager.Migrate.csproj b/sdk/migrate/Azure.ResourceManager.Migrate/src/Azure.ResourceManager.Migrate.csproj new file mode 100644 index 000000000000..1e9a2162550b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Azure.ResourceManager.Migrate.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider Migrate. + 1.0.0-beta.1 + azure;management;arm;resource manager;migrate + Azure.ResourceManager.Migrate + + diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ArmMigrateModelFactory.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ArmMigrateModelFactory.cs new file mode 100644 index 000000000000..93461692d4ef --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ArmMigrateModelFactory.cs @@ -0,0 +1,279 @@ +// 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.Migrate.Models +{ + /// Model factory for models. + public static partial class ArmMigrateModelFactory + { + /// 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 CompoundAssessmentData CompoundAssessmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CompoundAssessmentProperties properties = null) + { + return new CompoundAssessmentData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The status of the last operation. + /// ARM IDs of the target assessments. + /// Fallback machine assessment ARM ID. + /// Details of the compound assessment. + /// A new instance for mocking. + public static CompoundAssessmentProperties CompoundAssessmentProperties(ProvisioningState? provisioningState = null, TargetAssessmentArmIds targetAssessmentArmIds = null, string fallbackMachineAssessmentArmId = null, CompoundAssessmentDetails details = null) + { + return new CompoundAssessmentProperties(provisioningState, targetAssessmentArmIds, fallbackMachineAssessmentArmId, details, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Timestamp when the assessment was created. + /// Timestamp when the assessment was last updated. + /// Status of the assessment. + /// A new instance for mocking. + public static CompoundAssessmentDetails CompoundAssessmentDetails(DateTimeOffset? createdTimestamp = null, DateTimeOffset? updatedTimestamp = null, AssessmentStatus status = default) + { + return new CompoundAssessmentDetails(createdTimestamp, updatedTimestamp, status, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Hyperlink to download report. + /// Expiry date of download url. + /// A new instance for mocking. + public static DownloadUri DownloadUri(string assessmentReportUri = null, DateTimeOffset expireOn = default) + { + return new DownloadUri(assessmentReportUri, expireOn, 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 WebAppCompoundAssessmentSummaryData WebAppCompoundAssessmentSummaryData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, WebAppCompoundAssessmentSummaryProperties properties = null) + { + return new WebAppCompoundAssessmentSummaryData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The summary type. + /// The summary name. + /// The source details list. + /// The target details list. + /// The target source mapping. + /// The cost components. + /// The cost components. + /// Name of the assessment. + /// Light summary of the compound assessment. + /// A new instance for mocking. + public static WebAppCompoundAssessmentSummaryProperties WebAppCompoundAssessmentSummaryProperties(SummaryType? summaryType = null, string summaryName = null, IEnumerable sources = null, IEnumerable targets = null, IEnumerable targetSourceMapping = null, IEnumerable costComponents = null, IEnumerable savingsComponents = null, string assessmentName = null, DiscoveredLightSummary discoveredLightSummary = null) + { + sources ??= new List(); + targets ??= new List(); + targetSourceMapping ??= new List(); + costComponents ??= new List(); + savingsComponents ??= new List(); + + return new WebAppCompoundAssessmentSummaryProperties( + summaryType, + summaryName, + sources?.ToList(), + targets?.ToList(), + targetSourceMapping?.ToList(), + costComponents?.ToList(), + savingsComponents?.ToList(), + assessmentName, + discoveredLightSummary, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The source name. + /// The source type. + /// The migration platform. + /// The count of a type of source. + /// A new instance for mocking. + public static SourceDetails SourceDetails(AssessmentSource? sourceName = null, MigrateWorkloadType? sourceType = null, MigrationPlatform? platform = null, int? count = null) + { + return new SourceDetails(sourceName, sourceType, platform, count, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The target name. + /// The target type. + /// The migration platform. + /// The count of a type of source. + /// A new instance for mocking. + public static TargetDetails TargetDetails(AzureTarget? targetName = null, MigrateWorkloadType? targetType = null, MigrationPlatform? platform = null, int? count = null) + { + return new TargetDetails(targetName, targetType, platform, count, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The source name. + /// The target name. + /// The count of a type of source. + /// The count of a type of target. + /// The migration details. + /// The management details. + /// The cost details. + /// The savings details. + /// The confidence score. + /// A new instance for mocking. + public static TargetSourcePair TargetSourcePair(AssessmentSource? sourceRef = null, AzureTarget? targetRef = null, int? sourceCount = null, int? targetCount = null, MigrationDetails migrationDetails = null, IEnumerable managementDetails = null, IEnumerable costDetails = null, IEnumerable savingsDetails = null, double? confidenceScore = null) + { + managementDetails ??= new List(); + costDetails ??= new List(); + savingsDetails ??= new List(); + + return new TargetSourcePair( + sourceRef, + targetRef, + sourceCount, + targetCount, + migrationDetails, + managementDetails?.ToList(), + costDetails?.ToList(), + savingsDetails?.ToList(), + confidenceScore, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The readiness summary. + /// The migration type. + /// A new instance for mocking. + public static MigrationDetails MigrationDetails(IEnumerable readinessSummary = null, MigrationType? migrationType = null) + { + readinessSummary ??= new List(); + + return new MigrationDetails(readinessSummary?.ToList(), migrationType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name. + /// The value. + /// A new instance for mocking. + public static NameValuePairCloudSuitabilityCommon NameValuePairCloudSuitabilityCommon(CloudSuitabilityCommon? name = null, int? value = null) + { + return new NameValuePairCloudSuitabilityCommon(name, value, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The management summary name. + /// The management suitability summary. + /// A new instance for mocking. + public static ManagementDetails ManagementDetails(AzureManagementOfferingType? name = null, IEnumerable readinessSummary = null) + { + readinessSummary ??= new List(); + + return new ManagementDetails(name, readinessSummary?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The savings options. + /// The sku cost details per azure offer type. + /// A new instance for mocking. + public static CostDetailsCommon CostDetailsCommon(SavingsOption? savingOptions = null, IEnumerable costDetail = null) + { + costDetail ??= new List(); + + return new CostDetailsCommon(savingOptions, costDetail?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name. + /// The value. + /// A new instance for mocking. + public static NameValuePairCostType NameValuePairCostType(CostType? name = null, float? value = null) + { + return new NameValuePairCostType(name, value, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The savings options. + /// The sku cost details per azure offer type. + /// A new instance for mocking. + public static SavingsDetailsCommon SavingsDetailsCommon(SavingsOption? savingOptions = null, IEnumerable savingsDetail = null) + { + savingsDetail ??= new List(); + + return new SavingsDetailsCommon(savingOptions, savingsDetail?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name. + /// The value. + /// A new instance for mocking. + public static NameValuePairSavingsType NameValuePairSavingsType(SavingsType? name = null, float? value = null) + { + return new NameValuePairSavingsType(name, value, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Number of web apps. + /// Number of web apps per type. + /// Number of web servers per type. + /// Number of web servers. + /// Number of servers. + /// A new instance for mocking. + public static DiscoveredLightSummary DiscoveredLightSummary(int numberOfWebApps = default, IEnumerable numberOfWebAppsPerType = null, IEnumerable numberOfWebServersPerType = null, int numberOfWebServers = default, int numberOfServers = default) + { + numberOfWebAppsPerType ??= new List(); + numberOfWebServersPerType ??= new List(); + + return new DiscoveredLightSummary( + numberOfWebApps, + numberOfWebAppsPerType?.ToList(), + numberOfWebServersPerType?.ToList(), + numberOfWebServers, + numberOfServers, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Name of the web app type. + /// Count of the web app type. + /// A new instance for mocking. + public static WebAppsPerType WebAppsPerType(WebAppType webAppType = default, int count = default) + { + return new WebAppsPerType(webAppType, count, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Name of the web app type. + /// Count of the web app type. + /// A new instance for mocking. + public static WebServersPerType WebServersPerType(WebServerType webServerType = default, int count = default) + { + return new WebServersPerType(webServerType, count, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentCollection.cs new file mode 100644 index 000000000000..db2e8f0942f5 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentCollection.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// 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 GetCompoundAssessments method from an instance of . + /// + public partial class CompoundAssessmentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics; + private readonly CompoundAssessmentRestOperations _compoundAssessmentCompoundAssessmentOperationsRestClient; + private readonly string _projectName; + + /// Initializes a new instance of the class for mocking. + protected CompoundAssessmentCollection() + { + } + + /// 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. + /// Assessment Project Name. + /// is null. + /// is an empty string, and was expected to be non-empty. + internal CompoundAssessmentCollection(ArmClient client, ResourceIdentifier id, string projectName) : base(client, id) + { + _projectName = projectName; + _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", CompoundAssessmentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(CompoundAssessmentResource.ResourceType, out string compoundAssessmentCompoundAssessmentOperationsApiVersion); + _compoundAssessmentCompoundAssessmentOperationsRestClient = new CompoundAssessmentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, compoundAssessmentCompoundAssessmentOperationsApiVersion); +#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 CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Create + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Compound Assessment ARM 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 compoundAssessmentName, CompoundAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(new CompoundAssessmentOperationSource(Client), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, 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 CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Create + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Compound Assessment ARM 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 compoundAssessmentName, CompoundAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, data, cancellationToken); + var operation = new MigrateArmOperation(new CompoundAssessmentOperationSource(Client), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Compound Assessment ARM 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 compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.Get"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CompoundAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.Get"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CompoundAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List CompoundAssessment resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments + /// + /// + /// Operation Id + /// CompoundAssessment_ListByParent + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, _projectName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _projectName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CompoundAssessmentResource(Client, CompoundAssessmentData.DeserializeCompoundAssessmentData(e)), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, "CompoundAssessmentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List CompoundAssessment resources by AssessmentProject + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments + /// + /// + /// Operation Id + /// CompoundAssessment_ListByParent + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, _projectName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, _projectName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CompoundAssessmentResource(Client, CompoundAssessmentData.DeserializeCompoundAssessmentData(e)), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, "CompoundAssessmentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Compound Assessment ARM 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 compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.Exists"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.Exists"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Compound Assessment ARM 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 compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CompoundAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, _projectName, compoundAssessmentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new CompoundAssessmentResource(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/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.Serialization.cs new file mode 100644 index 000000000000..5bdf90d848a3 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.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.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class CompoundAssessmentData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CompoundAssessmentData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + CompoundAssessmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompoundAssessmentData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompoundAssessmentData(document.RootElement, options); + } + + internal static CompoundAssessmentData DeserializeCompoundAssessmentData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CompoundAssessmentProperties 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 = CompoundAssessmentProperties.DeserializeCompoundAssessmentProperties(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 CompoundAssessmentData( + 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(CompoundAssessmentData)} does not support writing '{options.Format}' format."); + } + } + + CompoundAssessmentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCompoundAssessmentData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompoundAssessmentData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.cs new file mode 100644 index 000000000000..a5cafd77c013 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentData.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.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A class representing the CompoundAssessment data model. + /// Compound assessment resource. + /// + public partial class CompoundAssessmentData : 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 CompoundAssessmentData() + { + } + + /// 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 CompoundAssessmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CompoundAssessmentProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public CompoundAssessmentProperties Properties { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.Serialization.cs new file mode 100644 index 000000000000..82dbb6cb9f09 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.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.Migrate +{ + public partial class CompoundAssessmentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + CompoundAssessmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + CompoundAssessmentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.cs new file mode 100644 index 000000000000..6200fb0e173a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/CompoundAssessmentResource.cs @@ -0,0 +1,514 @@ +// 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.Migrate.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing a CompoundAssessment 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 GetCompoundAssessmentResource method. + /// Otherwise you can get one from its parent resource using the GetCompoundAssessment method. + /// + public partial class CompoundAssessmentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The compoundAssessmentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics; + private readonly CompoundAssessmentRestOperations _compoundAssessmentCompoundAssessmentOperationsRestClient; + private readonly CompoundAssessmentData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/webAppCompoundAssessments"; + + /// Initializes a new instance of the class for mocking. + protected CompoundAssessmentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal CompoundAssessmentResource(ArmClient client, CompoundAssessmentData 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 CompoundAssessmentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string compoundAssessmentCompoundAssessmentOperationsApiVersion); + _compoundAssessmentCompoundAssessmentOperationsRestClient = new CompoundAssessmentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, compoundAssessmentCompoundAssessmentOperationsApiVersion); +#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 CompoundAssessmentData 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 WebAppCompoundAssessmentSummaryResources in the CompoundAssessment. + /// An object representing collection of WebAppCompoundAssessmentSummaryResources and their operations over a WebAppCompoundAssessmentSummaryResource. + public virtual WebAppCompoundAssessmentSummaryCollection GetWebAppCompoundAssessmentSummaries() + { + return GetCachedClient(client => new WebAppCompoundAssessmentSummaryCollection(client, Id)); + } + + /// + /// Get a WebAppCompoundAssessmentSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetWebAppCompoundAssessmentSummaryAsync(string summaryName, CancellationToken cancellationToken = default) + { + return await GetWebAppCompoundAssessmentSummaries().GetAsync(summaryName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a WebAppCompoundAssessmentSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetWebAppCompoundAssessmentSummary(string summaryName, CancellationToken cancellationToken = default) + { + return GetWebAppCompoundAssessmentSummaries().Get(summaryName, cancellationToken); + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.Get"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.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 CompoundAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.Get"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CompoundAssessmentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Delete + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.Delete"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new MigrateArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Delete + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.Delete"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new MigrateArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Create + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CompoundAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.Update"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(new CompoundAssessmentOperationSource(Client), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Create + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Resource create parameters. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CompoundAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.Update"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new MigrateArmOperation(new CompoundAssessmentOperationSource(Client), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// A long-running resource action. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/downloadUrl + /// + /// + /// Operation Id + /// CompoundAssessmentOperations_DownloadUrl + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> DownloadUrlAsync(WaitUntil waitUntil, DownloadUrlContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.DownloadUrl"); + scope.Start(); + try + { + var response = await _compoundAssessmentCompoundAssessmentOperationsRestClient.DownloadUrlAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new MigrateArmOperation(new DownloadUriOperationSource(), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateDownloadUrlRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// A long-running resource action. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/downloadUrl + /// + /// + /// Operation Id + /// CompoundAssessmentOperations_DownloadUrl + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation DownloadUrl(WaitUntil waitUntil, DownloadUrlContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics.CreateScope("CompoundAssessmentResource.DownloadUrl"); + scope.Start(); + try + { + var response = _compoundAssessmentCompoundAssessmentOperationsRestClient.DownloadUrl(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new MigrateArmOperation(new DownloadUriOperationSource(), _compoundAssessmentCompoundAssessmentOperationsClientDiagnostics, Pipeline, _compoundAssessmentCompoundAssessmentOperationsRestClient.CreateDownloadUrlRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MigrateExtensions.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MigrateExtensions.cs new file mode 100644 index 000000000000..40abf36fc2e0 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MigrateExtensions.cs @@ -0,0 +1,165 @@ +// 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.Migrate.Mocking; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.Migrate +{ + /// A class to add extension methods to Azure.ResourceManager.Migrate. + public static partial class MigrateExtensions + { + private static MockableMigrateArmClient GetMockableMigrateArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableMigrateArmClient(client0)); + } + + private static MockableMigrateResourceGroupResource GetMockableMigrateResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableMigrateResourceGroupResource(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 CompoundAssessmentResource GetCompoundAssessmentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrateArmClient(client).GetCompoundAssessmentResource(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 WebAppCompoundAssessmentSummaryResource GetWebAppCompoundAssessmentSummaryResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableMigrateArmClient(client).GetWebAppCompoundAssessmentSummaryResource(id); + } + + /// + /// Gets a collection of CompoundAssessmentResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Assessment Project Name. + /// or is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of CompoundAssessmentResources and their operations over a CompoundAssessmentResource. + public static CompoundAssessmentCollection GetCompoundAssessments(this ResourceGroupResource resourceGroupResource, string projectName) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableMigrateResourceGroupResource(resourceGroupResource).GetCompoundAssessments(projectName); + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetCompoundAssessmentAsync(this ResourceGroupResource resourceGroupResource, string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableMigrateResourceGroupResource(resourceGroupResource).GetCompoundAssessmentAsync(projectName, compoundAssessmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetCompoundAssessment(this ResourceGroupResource resourceGroupResource, string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableMigrateResourceGroupResource(resourceGroupResource).GetCompoundAssessment(projectName, compoundAssessmentName, cancellationToken); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateArmClient.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateArmClient.cs new file mode 100644 index 000000000000..73a774a7c7bf --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateArmClient.cs @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableMigrateArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableMigrateArmClient() + { + } + + /// 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 MockableMigrateArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableMigrateArmClient(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 CompoundAssessmentResource GetCompoundAssessmentResource(ResourceIdentifier id) + { + CompoundAssessmentResource.ValidateResourceId(id); + return new CompoundAssessmentResource(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 WebAppCompoundAssessmentSummaryResource GetWebAppCompoundAssessmentSummaryResource(ResourceIdentifier id) + { + WebAppCompoundAssessmentSummaryResource.ValidateResourceId(id); + return new WebAppCompoundAssessmentSummaryResource(Client, id); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateResourceGroupResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateResourceGroupResource.cs new file mode 100644 index 000000000000..7ac4ba06ad60 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Extensions/MockableMigrateResourceGroupResource.cs @@ -0,0 +1,110 @@ +// 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.Migrate.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableMigrateResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableMigrateResourceGroupResource() + { + } + + /// 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 MockableMigrateResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of CompoundAssessmentResources in the ResourceGroupResource. + /// Assessment Project Name. + /// is null. + /// is an empty string, and was expected to be non-empty. + /// An object representing collection of CompoundAssessmentResources and their operations over a CompoundAssessmentResource. + public virtual CompoundAssessmentCollection GetCompoundAssessments(string projectName) + { + return new CompoundAssessmentCollection(Client, Id, projectName); + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetCompoundAssessmentAsync(string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + return await GetCompoundAssessments(projectName).GetAsync(compoundAssessmentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName} + /// + /// + /// Operation Id + /// CompoundAssessment_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCompoundAssessment(string projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + return GetCompoundAssessments(projectName).Get(compoundAssessmentName, cancellationToken); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Argument.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..0182a5196211 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate +{ + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..a66f9d42e55e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate +{ + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ChangeTrackingList.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..47489526e8bf --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate +{ + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..8f874b8eacb2 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate +{ + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Optional.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..e41b97ffe4ae --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate +{ + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..6922a99f93ea --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate +{ + 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/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/CompoundAssessmentOperationSource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/CompoundAssessmentOperationSource.cs new file mode 100644 index 000000000000..0cd25d377f34 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/CompoundAssessmentOperationSource.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.Migrate +{ + internal class CompoundAssessmentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal CompoundAssessmentOperationSource(ArmClient client) + { + _client = client; + } + + CompoundAssessmentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new CompoundAssessmentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new CompoundAssessmentResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/DownloadUriOperationSource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/DownloadUriOperationSource.cs new file mode 100644 index 000000000000..0386533eec64 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/DownloadUriOperationSource.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.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + internal class DownloadUriOperationSource : IOperationSource + { + DownloadUri IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return DownloadUri.DeserializeDownloadUri(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return DownloadUri.DeserializeDownloadUri(document.RootElement); + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperation.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperation.cs new file mode 100644 index 000000000000..74c14408f3f1 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperation.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.Migrate +{ +#pragma warning disable SA1649 // File name should match first type name + internal class MigrateArmOperation : 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 MigrateArmOperation for mocking. + protected MigrateArmOperation() + { + } + + internal MigrateArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal MigrateArmOperation(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, "MigrateArmOperation", 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/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperationOfT.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperationOfT.cs new file mode 100644 index 000000000000..c7dc7329573a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/LongRunningOperation/MigrateArmOperationOfT.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.Migrate +{ +#pragma warning disable SA1649 // File name should match first type name + internal class MigrateArmOperation : 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 MigrateArmOperation for mocking. + protected MigrateArmOperation() + { + } + + internal MigrateArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal MigrateArmOperation(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, "MigrateArmOperation", 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentSource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentSource.cs new file mode 100644 index 000000000000..b43395708522 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentSource.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.Migrate.Models +{ + /// Assessment Source. + public readonly partial struct AssessmentSource : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssessmentSource(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string MachineValue = "Machine"; + private const string IISValue = "IIS"; + private const string TomCatValue = "TomCat"; + private const string OracleServerValue = "OracleServer"; + private const string OracleDatabaseValue = "OracleDatabase"; + private const string SAPInstanceValue = "SAPInstance"; + private const string SpringbootApplicationValue = "SpringbootApplication"; + private const string MySQLServerValue = "MySQLServer"; + private const string SqlInstanceValue = "SqlInstance"; + private const string SqlDatabaseValue = "SqlDatabase"; + private const string WebAppsValue = "WebApps"; + + /// Unknown - Assessment Source. + public static AssessmentSource Unknown { get; } = new AssessmentSource(UnknownValue); + /// Machine - Assessment Source. + public static AssessmentSource Machine { get; } = new AssessmentSource(MachineValue); + /// IIS - Assessment Source. + public static AssessmentSource IIS { get; } = new AssessmentSource(IISValue); + /// TomCat - Assessment Source. + public static AssessmentSource TomCat { get; } = new AssessmentSource(TomCatValue); + /// OracleServer - Assessment Source. + public static AssessmentSource OracleServer { get; } = new AssessmentSource(OracleServerValue); + /// OracleDatabase - Assessment Source. + public static AssessmentSource OracleDatabase { get; } = new AssessmentSource(OracleDatabaseValue); + /// SAPInstance - Assessment Source. + public static AssessmentSource SAPInstance { get; } = new AssessmentSource(SAPInstanceValue); + /// SpringbootApplication - Assessment Source. + public static AssessmentSource SpringbootApplication { get; } = new AssessmentSource(SpringbootApplicationValue); + /// MySQLServer - Assessment Source. + public static AssessmentSource MySQLServer { get; } = new AssessmentSource(MySQLServerValue); + /// SqlInstance - Assessment Source. + public static AssessmentSource SqlInstance { get; } = new AssessmentSource(SqlInstanceValue); + /// SqlDatabase - Assessment Source. + public static AssessmentSource SqlDatabase { get; } = new AssessmentSource(SqlDatabaseValue); + /// WebApps - Assessment Source. + public static AssessmentSource WebApps { get; } = new AssessmentSource(WebAppsValue); + /// Determines if two values are the same. + public static bool operator ==(AssessmentSource left, AssessmentSource right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssessmentSource left, AssessmentSource right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssessmentSource(string value) => new AssessmentSource(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssessmentSource other && Equals(other); + /// + public bool Equals(AssessmentSource 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentStatus.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentStatus.cs new file mode 100644 index 000000000000..d9730d5c1d38 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AssessmentStatus.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.Migrate.Models +{ + /// Assessment Status. + public readonly partial struct AssessmentStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AssessmentStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatedValue = "Created"; + private const string UpdatedValue = "Updated"; + private const string RunningValue = "Running"; + private const string CompletedValue = "Completed"; + private const string InvalidValue = "Invalid"; + private const string OutOfSyncValue = "OutOfSync"; + private const string OutDatedValue = "OutDated"; + private const string DeletedValue = "Deleted"; + private const string FailedValue = "Failed"; + + /// Assessment is Created. + public static AssessmentStatus Created { get; } = new AssessmentStatus(CreatedValue); + /// Assessment is Updated. + public static AssessmentStatus Updated { get; } = new AssessmentStatus(UpdatedValue); + /// Assessment is currently running. + public static AssessmentStatus Running { get; } = new AssessmentStatus(RunningValue); + /// Assessment is Completed or Ready. + public static AssessmentStatus Completed { get; } = new AssessmentStatus(CompletedValue); + /// Assessment is Failed i.e. it is now invalid. + public static AssessmentStatus Invalid { get; } = new AssessmentStatus(InvalidValue); + /// Assessment is Out of Sync. + public static AssessmentStatus OutOfSync { get; } = new AssessmentStatus(OutOfSyncValue); + /// Assessment is Out Dated. + public static AssessmentStatus OutDated { get; } = new AssessmentStatus(OutDatedValue); + /// Assessment is Deleted. + public static AssessmentStatus Deleted { get; } = new AssessmentStatus(DeletedValue); + /// Assessment has Failed. + public static AssessmentStatus Failed { get; } = new AssessmentStatus(FailedValue); + /// Determines if two values are the same. + public static bool operator ==(AssessmentStatus left, AssessmentStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AssessmentStatus left, AssessmentStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AssessmentStatus(string value) => new AssessmentStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AssessmentStatus other && Equals(other); + /// + public bool Equals(AssessmentStatus 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureManagementOfferingType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureManagementOfferingType.cs new file mode 100644 index 000000000000..9051809d1ebd --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureManagementOfferingType.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.Migrate.Models +{ + /// Azure management Offering type. + public readonly partial struct AzureManagementOfferingType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureManagementOfferingType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoValue = "No"; + private const string SCOMMIValue = "SCOMMI"; + private const string AzMonValue = "AzMon"; + private const string AUMValue = "AUM"; + private const string AzureBackupValue = "AzureBackup"; + + /// No - Azure management Offering type. + public static AzureManagementOfferingType No { get; } = new AzureManagementOfferingType(NoValue); + /// SCOMMI - Azure management Offering type. + public static AzureManagementOfferingType SCOMMI { get; } = new AzureManagementOfferingType(SCOMMIValue); + /// AzMon - Azure management Offering type. + public static AzureManagementOfferingType AzMon { get; } = new AzureManagementOfferingType(AzMonValue); + /// AUM - Azure management Offering type. + public static AzureManagementOfferingType AUM { get; } = new AzureManagementOfferingType(AUMValue); + /// AzureBackup - Azure management Offering type. + public static AzureManagementOfferingType AzureBackup { get; } = new AzureManagementOfferingType(AzureBackupValue); + /// Determines if two values are the same. + public static bool operator ==(AzureManagementOfferingType left, AzureManagementOfferingType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureManagementOfferingType left, AzureManagementOfferingType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureManagementOfferingType(string value) => new AzureManagementOfferingType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureManagementOfferingType other && Equals(other); + /// + public bool Equals(AzureManagementOfferingType 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureTarget.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureTarget.cs new file mode 100644 index 000000000000..88dd6282ff39 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/AzureTarget.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Azure Target. + public readonly partial struct AzureTarget : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public AzureTarget(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string SqlDatabaseValue = "SqlDatabase"; + private const string SqlMIValue = "SqlMI"; + private const string FlexServerPGValue = "FlexServerPG"; + private const string OracleIaasVmValue = "OracleIaasVM"; + private const string AzureSpringAppsValue = "AzureSpringApps"; + private const string SAPAzureInstanceValue = "SAPAzureInstance"; + private const string AKSValue = "AKS"; + private const string MySQLAzureFlexServerValue = "MySQLAzureFlexServer"; + private const string AzureSQLVMValue = "AzureSQLVM"; + private const string AzureVmValue = "AzureVM"; + private const string AzureAppServiceValue = "AzureAppService"; + private const string AzureAppServiceContainerValue = "AzureAppServiceContainer"; + private const string AvsValue = "Avs"; + + /// Unknown - Azure Target. + public static AzureTarget Unknown { get; } = new AzureTarget(UnknownValue); + /// SqlDatabase - Azure Target. + public static AzureTarget SqlDatabase { get; } = new AzureTarget(SqlDatabaseValue); + /// SqlMI - Azure Target. + public static AzureTarget SqlMI { get; } = new AzureTarget(SqlMIValue); + /// FlexServerPG - Azure Target. + public static AzureTarget FlexServerPG { get; } = new AzureTarget(FlexServerPGValue); + /// OracleIaasVM - Azure Target. + public static AzureTarget OracleIaasVm { get; } = new AzureTarget(OracleIaasVmValue); + /// AzureSpringApps - Azure Target. + public static AzureTarget AzureSpringApps { get; } = new AzureTarget(AzureSpringAppsValue); + /// SAPAzureInstance - Azure Target. + public static AzureTarget SAPAzureInstance { get; } = new AzureTarget(SAPAzureInstanceValue); + /// AKS - Azure Target. + public static AzureTarget AKS { get; } = new AzureTarget(AKSValue); + /// MySQLAzureFlexServer - Azure Target. + public static AzureTarget MySQLAzureFlexServer { get; } = new AzureTarget(MySQLAzureFlexServerValue); + /// AzureSQLVM - Azure Target. + public static AzureTarget AzureSQLVM { get; } = new AzureTarget(AzureSQLVMValue); + /// AzureVM - Azure Target. + public static AzureTarget AzureVm { get; } = new AzureTarget(AzureVmValue); + /// AzureAppService - Azure Target. + public static AzureTarget AzureAppService { get; } = new AzureTarget(AzureAppServiceValue); + /// AzureAppServiceContainer - Azure Target. + public static AzureTarget AzureAppServiceContainer { get; } = new AzureTarget(AzureAppServiceContainerValue); + /// Avs - Azure Target. + public static AzureTarget Avs { get; } = new AzureTarget(AvsValue); + /// Determines if two values are the same. + public static bool operator ==(AzureTarget left, AzureTarget right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(AzureTarget left, AzureTarget right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator AzureTarget(string value) => new AzureTarget(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is AzureTarget other && Equals(other); + /// + public bool Equals(AzureTarget 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CloudSuitabilityCommon.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CloudSuitabilityCommon.cs new file mode 100644 index 000000000000..f5e2e8468e2d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CloudSuitabilityCommon.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.Migrate.Models +{ + /// Cloud Suitability Common. + public readonly partial struct CloudSuitabilityCommon : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CloudSuitabilityCommon(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string NotSuitableValue = "NotSuitable"; + private const string SuitableValue = "Suitable"; + private const string ConditionallySuitableValue = "ConditionallySuitable"; + private const string ReadinessUnknownValue = "ReadinessUnknown"; + private const string SuitableWithWarningsValue = "SuitableWithWarnings"; + + /// Unknown - Cloud Suitability Common. + public static CloudSuitabilityCommon Unknown { get; } = new CloudSuitabilityCommon(UnknownValue); + /// NotSuitable - Cloud Suitability Common. + public static CloudSuitabilityCommon NotSuitable { get; } = new CloudSuitabilityCommon(NotSuitableValue); + /// Suitable - Cloud Suitability Common. + public static CloudSuitabilityCommon Suitable { get; } = new CloudSuitabilityCommon(SuitableValue); + /// ConditionallySuitable - Cloud Suitability Common. + public static CloudSuitabilityCommon ConditionallySuitable { get; } = new CloudSuitabilityCommon(ConditionallySuitableValue); + /// ReadinessUnknown - Cloud Suitability Common. + public static CloudSuitabilityCommon ReadinessUnknown { get; } = new CloudSuitabilityCommon(ReadinessUnknownValue); + /// SuitableWithWarnings - Cloud Suitability Common. + public static CloudSuitabilityCommon SuitableWithWarnings { get; } = new CloudSuitabilityCommon(SuitableWithWarningsValue); + /// Determines if two values are the same. + public static bool operator ==(CloudSuitabilityCommon left, CloudSuitabilityCommon right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CloudSuitabilityCommon left, CloudSuitabilityCommon right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CloudSuitabilityCommon(string value) => new CloudSuitabilityCommon(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CloudSuitabilityCommon other && Equals(other); + /// + public bool Equals(CloudSuitabilityCommon 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.Serialization.cs new file mode 100644 index 000000000000..d48ce192085a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.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.Migrate.Models +{ + public partial class CompoundAssessmentDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CompoundAssessmentDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CreatedTimestamp)) + { + writer.WritePropertyName("createdTimestamp"u8); + writer.WriteStringValue(CreatedTimestamp.Value, "O"); + } + if (Optional.IsDefined(UpdatedTimestamp)) + { + writer.WritePropertyName("updatedTimestamp"u8); + writer.WriteStringValue(UpdatedTimestamp.Value, "O"); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.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 + } + } + } + + CompoundAssessmentDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompoundAssessmentDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompoundAssessmentDetails(document.RootElement, options); + } + + internal static CompoundAssessmentDetails DeserializeCompoundAssessmentDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? createdTimestamp = default; + DateTimeOffset? updatedTimestamp = default; + AssessmentStatus status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("createdTimestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("updatedTimestamp"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedTimestamp = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("status"u8)) + { + status = new AssessmentStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CompoundAssessmentDetails(createdTimestamp, updatedTimestamp, status, serializedAdditionalRawData); + } + + BinaryData 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(CompoundAssessmentDetails)} does not support writing '{options.Format}' format."); + } + } + + CompoundAssessmentDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCompoundAssessmentDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompoundAssessmentDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.cs new file mode 100644 index 000000000000..e6208bffb04a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentDetails.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Details of the compound assessment. + public partial class CompoundAssessmentDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Status of the assessment. + internal CompoundAssessmentDetails(AssessmentStatus status) + { + Status = status; + } + + /// Initializes a new instance of . + /// Timestamp when the assessment was created. + /// Timestamp when the assessment was last updated. + /// Status of the assessment. + /// Keeps track of any properties unknown to the library. + internal CompoundAssessmentDetails(DateTimeOffset? createdTimestamp, DateTimeOffset? updatedTimestamp, AssessmentStatus status, IDictionary serializedAdditionalRawData) + { + CreatedTimestamp = createdTimestamp; + UpdatedTimestamp = updatedTimestamp; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CompoundAssessmentDetails() + { + } + + /// Timestamp when the assessment was created. + public DateTimeOffset? CreatedTimestamp { get; } + /// Timestamp when the assessment was last updated. + public DateTimeOffset? UpdatedTimestamp { get; } + /// Status of the assessment. + public AssessmentStatus Status { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.Serialization.cs new file mode 100644 index 000000000000..bc739e98c801 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.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.Migrate.Models +{ + internal partial class CompoundAssessmentListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CompoundAssessmentListResult)} 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 + } + } + } + + CompoundAssessmentListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompoundAssessmentListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompoundAssessmentListResult(document.RootElement, options); + } + + internal static CompoundAssessmentListResult DeserializeCompoundAssessmentListResult(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(CompoundAssessmentData.DeserializeCompoundAssessmentData(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 CompoundAssessmentListResult(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(CompoundAssessmentListResult)} does not support writing '{options.Format}' format."); + } + } + + CompoundAssessmentListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCompoundAssessmentListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompoundAssessmentListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.cs new file mode 100644 index 000000000000..10b06ede3a6b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentListResult.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.Migrate.Models +{ + /// The response of a CompoundAssessment list operation. + internal partial class CompoundAssessmentListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 CompoundAssessment items on this page. + /// is null. + internal CompoundAssessmentListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The CompoundAssessment items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal CompoundAssessmentListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CompoundAssessmentListResult() + { + } + + /// The CompoundAssessment items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.Serialization.cs new file mode 100644 index 000000000000..1dcee4848fb7 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.Serialization.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class CompoundAssessmentProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CompoundAssessmentProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("targetAssessmentArmIds"u8); + writer.WriteObjectValue(TargetAssessmentArmIds, options); + if (Optional.IsDefined(FallbackMachineAssessmentArmId)) + { + writer.WritePropertyName("fallbackMachineAssessmentArmId"u8); + writer.WriteStringValue(FallbackMachineAssessmentArmId); + } + if (options.Format != "W" && Optional.IsDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteObjectValue(Details, 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 + } + } + } + + CompoundAssessmentProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CompoundAssessmentProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCompoundAssessmentProperties(document.RootElement, options); + } + + internal static CompoundAssessmentProperties DeserializeCompoundAssessmentProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProvisioningState? provisioningState = default; + TargetAssessmentArmIds targetAssessmentArmIds = default; + string fallbackMachineAssessmentArmId = default; + CompoundAssessmentDetails details = 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 ProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetAssessmentArmIds"u8)) + { + targetAssessmentArmIds = TargetAssessmentArmIds.DeserializeTargetAssessmentArmIds(property.Value, options); + continue; + } + if (property.NameEquals("fallbackMachineAssessmentArmId"u8)) + { + fallbackMachineAssessmentArmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + details = CompoundAssessmentDetails.DeserializeCompoundAssessmentDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CompoundAssessmentProperties(provisioningState, targetAssessmentArmIds, fallbackMachineAssessmentArmId, details, serializedAdditionalRawData); + } + + BinaryData 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(CompoundAssessmentProperties)} does not support writing '{options.Format}' format."); + } + } + + CompoundAssessmentProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCompoundAssessmentProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CompoundAssessmentProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.cs new file mode 100644 index 000000000000..303861f005f6 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CompoundAssessmentProperties.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Properties of a compound assessment. + public partial class CompoundAssessmentProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// ARM IDs of the target assessments. + /// is null. + public CompoundAssessmentProperties(TargetAssessmentArmIds targetAssessmentArmIds) + { + Argument.AssertNotNull(targetAssessmentArmIds, nameof(targetAssessmentArmIds)); + + TargetAssessmentArmIds = targetAssessmentArmIds; + } + + /// Initializes a new instance of . + /// The status of the last operation. + /// ARM IDs of the target assessments. + /// Fallback machine assessment ARM ID. + /// Details of the compound assessment. + /// Keeps track of any properties unknown to the library. + internal CompoundAssessmentProperties(ProvisioningState? provisioningState, TargetAssessmentArmIds targetAssessmentArmIds, string fallbackMachineAssessmentArmId, CompoundAssessmentDetails details, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + TargetAssessmentArmIds = targetAssessmentArmIds; + FallbackMachineAssessmentArmId = fallbackMachineAssessmentArmId; + Details = details; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CompoundAssessmentProperties() + { + } + + /// The status of the last operation. + public ProvisioningState? ProvisioningState { get; } + /// ARM IDs of the target assessments. + public TargetAssessmentArmIds TargetAssessmentArmIds { get; set; } + /// Fallback machine assessment ARM ID. + public string FallbackMachineAssessmentArmId { get; set; } + /// Details of the compound assessment. + public CompoundAssessmentDetails Details { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.Serialization.cs new file mode 100644 index 000000000000..a7b6e54aeecb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Migrate.Models +{ + public partial class CostDetailsCommon : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CostDetailsCommon)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(SavingOptions)) + { + writer.WritePropertyName("savingOptions"u8); + writer.WriteStringValue(SavingOptions.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(CostDetail)) + { + writer.WritePropertyName("costDetail"u8); + writer.WriteStartArray(); + foreach (var item in CostDetail) + { + 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 + } + } + } + + CostDetailsCommon IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CostDetailsCommon)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCostDetailsCommon(document.RootElement, options); + } + + internal static CostDetailsCommon DeserializeCostDetailsCommon(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SavingsOption? savingOptions = default; + IReadOnlyList costDetail = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("savingOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + savingOptions = new SavingsOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("costDetail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePairCostType.DeserializeNameValuePairCostType(item, options)); + } + costDetail = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CostDetailsCommon(savingOptions, costDetail ?? 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(CostDetailsCommon)} does not support writing '{options.Format}' format."); + } + } + + CostDetailsCommon IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCostDetailsCommon(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CostDetailsCommon)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.cs new file mode 100644 index 000000000000..d3622f49c7b9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostDetailsCommon.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.Migrate.Models +{ + /// The cost details. + public partial class CostDetailsCommon + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 CostDetailsCommon() + { + CostDetail = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The savings options. + /// The sku cost details per azure offer type. + /// Keeps track of any properties unknown to the library. + internal CostDetailsCommon(SavingsOption? savingOptions, IReadOnlyList costDetail, IDictionary serializedAdditionalRawData) + { + SavingOptions = savingOptions; + CostDetail = costDetail; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The savings options. + public SavingsOption? SavingOptions { get; } + /// The sku cost details per azure offer type. + public IReadOnlyList CostDetail { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostType.cs new file mode 100644 index 000000000000..5dd1094db057 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/CostType.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.Migrate.Models +{ + /// Cost type. + public readonly partial struct CostType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CostType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MonthlyStorageCostValue = "MonthlyStorageCost"; + private const string MonthlyComputeCostValue = "MonthlyComputeCost"; + private const string MonthlyLicensingCostValue = "MonthlyLicensingCost"; + private const string MonthlySecurityCostValue = "MonthlySecurityCost"; + private const string MonthlyManagementCostValue = "MonthlyManagementCost"; + private const string MonitoringServiceValue = "MonitoringService"; + private const string DataProtectionServiceValue = "DataProtectionService"; + private const string PatchingServiceValue = "PatchingService"; + private const string MonthlyAzureHybridCostValue = "MonthlyAzureHybridCost"; + private const string MonthlyPremiumV2StorageCostValue = "MonthlyPremiumV2StorageCost"; + private const string MonthlyLinuxAzureHybridCostValue = "MonthlyLinuxAzureHybridCost"; + private const string MonthlyUltraStorageCostValue = "MonthlyUltraStorageCost"; + private const string MonthlyStandardSsdStorageCostValue = "MonthlyStandardSsdStorageCost"; + private const string MonthlyBandwidthCostValue = "MonthlyBandwidthCost"; + private const string MonthlyPremiumStorageCostValue = "MonthlyPremiumStorageCost"; + private const string MonthlyUltraDiskCostValue = "MonthlyUltraDiskCost"; + private const string MonthlyStandardHddStorageCostValue = "MonthlyStandardHddStorageCost"; + private const string MonthlyAvsExternalStorageCostValue = "MonthlyAvsExternalStorageCost"; + private const string MonthlyAvsNetworkCostValue = "MonthlyAvsNetworkCost"; + private const string MonthlyAvsNodeCostValue = "MonthlyAvsNodeCost"; + private const string TotalMonthlyCostValue = "TotalMonthlyCost"; + + /// MonthlyStorageCost - Cost type. + public static CostType MonthlyStorageCost { get; } = new CostType(MonthlyStorageCostValue); + /// MonthlyComputeCost - Cost type. + public static CostType MonthlyComputeCost { get; } = new CostType(MonthlyComputeCostValue); + /// MonthlyLicensingCost - Cost type. + public static CostType MonthlyLicensingCost { get; } = new CostType(MonthlyLicensingCostValue); + /// MonthlySecurityCost - Cost type. + public static CostType MonthlySecurityCost { get; } = new CostType(MonthlySecurityCostValue); + /// MonthlyManagementCost - Cost type. + public static CostType MonthlyManagementCost { get; } = new CostType(MonthlyManagementCostValue); + /// MonitoringService - Cost type. + public static CostType MonitoringService { get; } = new CostType(MonitoringServiceValue); + /// DataProtectionService - Cost type. + public static CostType DataProtectionService { get; } = new CostType(DataProtectionServiceValue); + /// PatchingService - Cost type. + public static CostType PatchingService { get; } = new CostType(PatchingServiceValue); + /// MonthlyAzureHybridCost - Cost type. + public static CostType MonthlyAzureHybridCost { get; } = new CostType(MonthlyAzureHybridCostValue); + /// MonthlyPremiumV2StorageCost - Cost type. + public static CostType MonthlyPremiumV2StorageCost { get; } = new CostType(MonthlyPremiumV2StorageCostValue); + /// MonthlyLinuxAzureHybridCost - Cost type. + public static CostType MonthlyLinuxAzureHybridCost { get; } = new CostType(MonthlyLinuxAzureHybridCostValue); + /// MonthlyUltraStorageCost - Cost type. + public static CostType MonthlyUltraStorageCost { get; } = new CostType(MonthlyUltraStorageCostValue); + /// MonthlyStandardSsdStorageCost - Cost type. + public static CostType MonthlyStandardSsdStorageCost { get; } = new CostType(MonthlyStandardSsdStorageCostValue); + /// MonthlyBandwidthCost - Cost type. + public static CostType MonthlyBandwidthCost { get; } = new CostType(MonthlyBandwidthCostValue); + /// MonthlyPremiumStorageCost - Cost type. + public static CostType MonthlyPremiumStorageCost { get; } = new CostType(MonthlyPremiumStorageCostValue); + /// MonthlyUltraDiskCost - Cost type. + public static CostType MonthlyUltraDiskCost { get; } = new CostType(MonthlyUltraDiskCostValue); + /// MonthlyStandardHddStorageCost - Cost type. + public static CostType MonthlyStandardHddStorageCost { get; } = new CostType(MonthlyStandardHddStorageCostValue); + /// MonthlyAvsExternalStorageCost - Cost type. + public static CostType MonthlyAvsExternalStorageCost { get; } = new CostType(MonthlyAvsExternalStorageCostValue); + /// MonthlyAvsNetworkCost - Cost type. + public static CostType MonthlyAvsNetworkCost { get; } = new CostType(MonthlyAvsNetworkCostValue); + /// MonthlyAvsNodeCost - Cost type. + public static CostType MonthlyAvsNodeCost { get; } = new CostType(MonthlyAvsNodeCostValue); + /// TotalMonthlyCost - Cost type. + public static CostType TotalMonthlyCost { get; } = new CostType(TotalMonthlyCostValue); + /// Determines if two values are the same. + public static bool operator ==(CostType left, CostType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CostType left, CostType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CostType(string value) => new CostType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CostType other && Equals(other); + /// + public bool Equals(CostType 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.Serialization.cs new file mode 100644 index 000000000000..3fcd9c3cebfc --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.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.Migrate.Models +{ + public partial class DiscoveredLightSummary : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DiscoveredLightSummary)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("numberOfWebApps"u8); + writer.WriteNumberValue(NumberOfWebApps); + if (Optional.IsCollectionDefined(NumberOfWebAppsPerType)) + { + writer.WritePropertyName("numberOfWebAppsPerType"u8); + writer.WriteStartArray(); + foreach (var item in NumberOfWebAppsPerType) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(NumberOfWebServersPerType)) + { + writer.WritePropertyName("numberOfWebServersPerType"u8); + writer.WriteStartArray(); + foreach (var item in NumberOfWebServersPerType) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("numberOfWebServers"u8); + writer.WriteNumberValue(NumberOfWebServers); + writer.WritePropertyName("numberOfServers"u8); + writer.WriteNumberValue(NumberOfServers); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + DiscoveredLightSummary IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveredLightSummary)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoveredLightSummary(document.RootElement, options); + } + + internal static DiscoveredLightSummary DeserializeDiscoveredLightSummary(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int numberOfWebApps = default; + IReadOnlyList numberOfWebAppsPerType = default; + IReadOnlyList numberOfWebServersPerType = default; + int numberOfWebServers = default; + int numberOfServers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("numberOfWebApps"u8)) + { + numberOfWebApps = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("numberOfWebAppsPerType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WebAppsPerType.DeserializeWebAppsPerType(item, options)); + } + numberOfWebAppsPerType = array; + continue; + } + if (property.NameEquals("numberOfWebServersPerType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(WebServersPerType.DeserializeWebServersPerType(item, options)); + } + numberOfWebServersPerType = array; + continue; + } + if (property.NameEquals("numberOfWebServers"u8)) + { + numberOfWebServers = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("numberOfServers"u8)) + { + numberOfServers = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiscoveredLightSummary( + numberOfWebApps, + numberOfWebAppsPerType ?? new ChangeTrackingList(), + numberOfWebServersPerType ?? new ChangeTrackingList(), + numberOfWebServers, + numberOfServers, + serializedAdditionalRawData); + } + + BinaryData 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(DiscoveredLightSummary)} does not support writing '{options.Format}' format."); + } + } + + DiscoveredLightSummary IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiscoveredLightSummary(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoveredLightSummary)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.cs new file mode 100644 index 000000000000..3580e422fec8 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DiscoveredLightSummary.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Summary of the compound assessment. + public partial class DiscoveredLightSummary + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Number of web apps. + /// Number of web servers. + /// Number of servers. + internal DiscoveredLightSummary(int numberOfWebApps, int numberOfWebServers, int numberOfServers) + { + NumberOfWebApps = numberOfWebApps; + NumberOfWebAppsPerType = new ChangeTrackingList(); + NumberOfWebServersPerType = new ChangeTrackingList(); + NumberOfWebServers = numberOfWebServers; + NumberOfServers = numberOfServers; + } + + /// Initializes a new instance of . + /// Number of web apps. + /// Number of web apps per type. + /// Number of web servers per type. + /// Number of web servers. + /// Number of servers. + /// Keeps track of any properties unknown to the library. + internal DiscoveredLightSummary(int numberOfWebApps, IReadOnlyList numberOfWebAppsPerType, IReadOnlyList numberOfWebServersPerType, int numberOfWebServers, int numberOfServers, IDictionary serializedAdditionalRawData) + { + NumberOfWebApps = numberOfWebApps; + NumberOfWebAppsPerType = numberOfWebAppsPerType; + NumberOfWebServersPerType = numberOfWebServersPerType; + NumberOfWebServers = numberOfWebServers; + NumberOfServers = numberOfServers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DiscoveredLightSummary() + { + } + + /// Number of web apps. + public int NumberOfWebApps { get; } + /// Number of web apps per type. + public IReadOnlyList NumberOfWebAppsPerType { get; } + /// Number of web servers per type. + public IReadOnlyList NumberOfWebServersPerType { get; } + /// Number of web servers. + public int NumberOfWebServers { get; } + /// Number of servers. + public int NumberOfServers { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.Serialization.cs new file mode 100644 index 000000000000..03ba25513355 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.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.Migrate.Models +{ + public partial class DownloadUri : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DownloadUri)} does not support writing '{format}' format."); + } + + if (options.Format != "W") + { + writer.WritePropertyName("assessmentReportUrl"u8); + writer.WriteStringValue(AssessmentReportUri); + } + if (options.Format != "W") + { + writer.WritePropertyName("expirationTime"u8); + writer.WriteStringValue(ExpireOn, "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 + } + } + } + + DownloadUri IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DownloadUri)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDownloadUri(document.RootElement, options); + } + + internal static DownloadUri DeserializeDownloadUri(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string assessmentReportUrl = default; + DateTimeOffset expirationTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("assessmentReportUrl"u8)) + { + assessmentReportUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("expirationTime"u8)) + { + expirationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DownloadUri(assessmentReportUrl, expirationTime, serializedAdditionalRawData); + } + + BinaryData 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(DownloadUri)} does not support writing '{options.Format}' format."); + } + } + + DownloadUri IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDownloadUri(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DownloadUri)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.cs new file mode 100644 index 000000000000..0c9097700df3 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUri.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.Migrate.Models +{ + /// Data model of Download URL for assessment report. + public partial class DownloadUri + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Hyperlink to download report. + /// Expiry date of download url. + internal DownloadUri(string assessmentReportUri, DateTimeOffset expireOn) + { + AssessmentReportUri = assessmentReportUri; + ExpireOn = expireOn; + } + + /// Initializes a new instance of . + /// Hyperlink to download report. + /// Expiry date of download url. + /// Keeps track of any properties unknown to the library. + internal DownloadUri(string assessmentReportUri, DateTimeOffset expireOn, IDictionary serializedAdditionalRawData) + { + AssessmentReportUri = assessmentReportUri; + ExpireOn = expireOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DownloadUri() + { + } + + /// Hyperlink to download report. + public string AssessmentReportUri { get; } + /// Expiry date of download url. + public DateTimeOffset ExpireOn { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.Serialization.cs new file mode 100644 index 000000000000..566a552c5f00 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.Migrate.Models +{ + public partial class DownloadUrlContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DownloadUrlContent)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + DownloadUrlContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DownloadUrlContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDownloadUrlContent(document.RootElement, options); + } + + internal static DownloadUrlContent DeserializeDownloadUrlContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DownloadUrlContent(serializedAdditionalRawData); + } + + BinaryData 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(DownloadUrlContent)} does not support writing '{options.Format}' format."); + } + } + + DownloadUrlContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDownloadUrlContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DownloadUrlContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.cs new file mode 100644 index 000000000000..3462a4b54d91 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/DownloadUrlContent.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The DownloadUrlContent. + public partial class DownloadUrlContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DownloadUrlContent() + { + } + + /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + internal DownloadUrlContent(IDictionary serializedAdditionalRawData) + { + _serializedAdditionalRawData = serializedAdditionalRawData; + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.Serialization.cs new file mode 100644 index 000000000000..64bcfe75e83e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Migrate.Models +{ + public partial class ManagementDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ManagementDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ReadinessSummary)) + { + writer.WritePropertyName("readinessSummary"u8); + writer.WriteStartArray(); + foreach (var item in ReadinessSummary) + { + 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 + } + } + } + + ManagementDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagementDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagementDetails(document.RootElement, options); + } + + internal static ManagementDetails DeserializeManagementDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureManagementOfferingType? name = default; + IReadOnlyList readinessSummary = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new AzureManagementOfferingType(property.Value.GetString()); + continue; + } + if (property.NameEquals("readinessSummary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePairCloudSuitabilityCommon.DeserializeNameValuePairCloudSuitabilityCommon(item, options)); + } + readinessSummary = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagementDetails(name, readinessSummary ?? 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(ManagementDetails)} does not support writing '{options.Format}' format."); + } + } + + ManagementDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagementDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagementDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.cs new file mode 100644 index 000000000000..9bc65418c800 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ManagementDetails.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.Migrate.Models +{ + /// Management details. + public partial class ManagementDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ManagementDetails() + { + ReadinessSummary = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The management summary name. + /// The management suitability summary. + /// Keeps track of any properties unknown to the library. + internal ManagementDetails(AzureManagementOfferingType? name, IReadOnlyList readinessSummary, IDictionary serializedAdditionalRawData) + { + Name = name; + ReadinessSummary = readinessSummary; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The management summary name. + public AzureManagementOfferingType? Name { get; } + /// The management suitability summary. + public IReadOnlyList ReadinessSummary { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrateWorkloadType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrateWorkloadType.cs new file mode 100644 index 000000000000..641ca43c6a0f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrateWorkloadType.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.Migrate.Models +{ + /// Migration Workload type. + public readonly partial struct MigrateWorkloadType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrateWorkloadType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string MachineValue = "Machine"; + private const string ServerValue = "Server"; + private const string InstanceValue = "Instance"; + private const string WebServerValue = "WebServer"; + private const string WebApplicationValue = "WebApplication"; + private const string DatabaseValue = "Database"; + private const string HostValue = "Host"; + private const string ManagementServerValue = "ManagementServer"; + + /// Unknown - Migration Workload type. + public static MigrateWorkloadType Unknown { get; } = new MigrateWorkloadType(UnknownValue); + /// Machine - Migration Workload type. + public static MigrateWorkloadType Machine { get; } = new MigrateWorkloadType(MachineValue); + /// Server - Migration Workload type. + public static MigrateWorkloadType Server { get; } = new MigrateWorkloadType(ServerValue); + /// Instance - Migration Workload type. + public static MigrateWorkloadType Instance { get; } = new MigrateWorkloadType(InstanceValue); + /// WebServer - Migration Workload type. + public static MigrateWorkloadType WebServer { get; } = new MigrateWorkloadType(WebServerValue); + /// WebApplication - Migration Workload type. + public static MigrateWorkloadType WebApplication { get; } = new MigrateWorkloadType(WebApplicationValue); + /// Database - Migration Workload type. + public static MigrateWorkloadType Database { get; } = new MigrateWorkloadType(DatabaseValue); + /// Host - Migration Workload type. + public static MigrateWorkloadType Host { get; } = new MigrateWorkloadType(HostValue); + /// ManagementServer - Migration Workload type. + public static MigrateWorkloadType ManagementServer { get; } = new MigrateWorkloadType(ManagementServerValue); + /// Determines if two values are the same. + public static bool operator ==(MigrateWorkloadType left, MigrateWorkloadType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrateWorkloadType left, MigrateWorkloadType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrateWorkloadType(string value) => new MigrateWorkloadType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrateWorkloadType other && Equals(other); + /// + public bool Equals(MigrateWorkloadType 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.Serialization.cs new file mode 100644 index 000000000000..3833a2532a1b --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Migrate.Models +{ + public partial class MigrationDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(MigrationDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsCollectionDefined(ReadinessSummary)) + { + writer.WritePropertyName("readinessSummary"u8); + writer.WriteStartArray(); + foreach (var item in ReadinessSummary) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(MigrationType)) + { + writer.WritePropertyName("migrationType"u8); + writer.WriteStringValue(MigrationType.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 + } + } + } + + MigrationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MigrationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMigrationDetails(document.RootElement, options); + } + + internal static MigrationDetails DeserializeMigrationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList readinessSummary = default; + MigrationType? migrationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("readinessSummary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePairCloudSuitabilityCommon.DeserializeNameValuePairCloudSuitabilityCommon(item, options)); + } + readinessSummary = array; + continue; + } + if (property.NameEquals("migrationType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationType = new MigrationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MigrationDetails(readinessSummary ?? new ChangeTrackingList(), migrationType, serializedAdditionalRawData); + } + + BinaryData 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(MigrationDetails)} does not support writing '{options.Format}' format."); + } + } + + MigrationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMigrationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MigrationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.cs new file mode 100644 index 000000000000..e7d8527d8404 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationDetails.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.Migrate.Models +{ + /// Migration details. + public partial class MigrationDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 MigrationDetails() + { + ReadinessSummary = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The readiness summary. + /// The migration type. + /// Keeps track of any properties unknown to the library. + internal MigrationDetails(IReadOnlyList readinessSummary, MigrationType? migrationType, IDictionary serializedAdditionalRawData) + { + ReadinessSummary = readinessSummary; + MigrationType = migrationType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The readiness summary. + public IReadOnlyList ReadinessSummary { get; } + /// The migration type. + public MigrationType? MigrationType { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationPlatform.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationPlatform.cs new file mode 100644 index 000000000000..23c1c59296d0 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationPlatform.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.Migrate.Models +{ + /// Migration Platform. + public readonly partial struct MigrationPlatform : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationPlatform(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string PaaSValue = "PaaS"; + private const string IaaSValue = "IaaS"; + private const string SaaSValue = "SaaS"; + + /// Unknown - Migration Platform. + public static MigrationPlatform Unknown { get; } = new MigrationPlatform(UnknownValue); + /// PaaS - Migration Platform. + public static MigrationPlatform PaaS { get; } = new MigrationPlatform(PaaSValue); + /// IaaS - Migration Platform. + public static MigrationPlatform IaaS { get; } = new MigrationPlatform(IaaSValue); + /// SaaS - Migration Platform. + public static MigrationPlatform SaaS { get; } = new MigrationPlatform(SaaSValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationPlatform left, MigrationPlatform right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationPlatform left, MigrationPlatform right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationPlatform(string value) => new MigrationPlatform(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationPlatform other && Equals(other); + /// + public bool Equals(MigrationPlatform 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationType.cs new file mode 100644 index 000000000000..29cc281ea563 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/MigrationType.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.Migrate.Models +{ + /// Migration Type. + public readonly partial struct MigrationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MigrationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string ReplatformValue = "Replatform"; + private const string RehostValue = "Rehost"; + private const string RetainValue = "Retain"; + private const string RearchitectValue = "Rearchitect"; + + /// Unknown - Migration Type. + public static MigrationType Unknown { get; } = new MigrationType(UnknownValue); + /// Replatform - Migration Type. + public static MigrationType Replatform { get; } = new MigrationType(ReplatformValue); + /// Rehost - Migration Type. + public static MigrationType Rehost { get; } = new MigrationType(RehostValue); + /// Retain - Migration Type. + public static MigrationType Retain { get; } = new MigrationType(RetainValue); + /// Rearchitect - Migration Type. + public static MigrationType Rearchitect { get; } = new MigrationType(RearchitectValue); + /// Determines if two values are the same. + public static bool operator ==(MigrationType left, MigrationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MigrationType left, MigrationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator MigrationType(string value) => new MigrationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MigrationType other && Equals(other); + /// + public bool Equals(MigrationType 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.Serialization.cs new file mode 100644 index 000000000000..be6ac047c213 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.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.Migrate.Models +{ + public partial class NameValuePairCloudSuitabilityCommon : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NameValuePairCloudSuitabilityCommon)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteNumberValue(Value.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 + } + } + } + + NameValuePairCloudSuitabilityCommon IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NameValuePairCloudSuitabilityCommon)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNameValuePairCloudSuitabilityCommon(document.RootElement, options); + } + + internal static NameValuePairCloudSuitabilityCommon DeserializeNameValuePairCloudSuitabilityCommon(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CloudSuitabilityCommon? name = default; + int? value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new CloudSuitabilityCommon(property.Value.GetString()); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NameValuePairCloudSuitabilityCommon(name, 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(NameValuePairCloudSuitabilityCommon)} does not support writing '{options.Format}' format."); + } + } + + NameValuePairCloudSuitabilityCommon IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNameValuePairCloudSuitabilityCommon(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NameValuePairCloudSuitabilityCommon)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.cs new file mode 100644 index 000000000000..f784ba115d0c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCloudSuitabilityCommon.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.Migrate.Models +{ + /// The generic name value pair. + public partial class NameValuePairCloudSuitabilityCommon + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NameValuePairCloudSuitabilityCommon() + { + } + + /// Initializes a new instance of . + /// The name. + /// The value. + /// Keeps track of any properties unknown to the library. + internal NameValuePairCloudSuitabilityCommon(CloudSuitabilityCommon? name, int? value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name. + public CloudSuitabilityCommon? Name { get; } + /// The value. + public int? Value { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.Serialization.cs new file mode 100644 index 000000000000..52cb3d12a2a4 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.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.Migrate.Models +{ + public partial class NameValuePairCostType : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NameValuePairCostType)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteNumberValue(Value.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 + } + } + } + + NameValuePairCostType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NameValuePairCostType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNameValuePairCostType(document.RootElement, options); + } + + internal static NameValuePairCostType DeserializeNameValuePairCostType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CostType? name = default; + float? value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new CostType(property.Value.GetString()); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NameValuePairCostType(name, 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(NameValuePairCostType)} does not support writing '{options.Format}' format."); + } + } + + NameValuePairCostType IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNameValuePairCostType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NameValuePairCostType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.cs new file mode 100644 index 000000000000..7bd605067c22 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairCostType.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.Migrate.Models +{ + /// The generic name value pair. + public partial class NameValuePairCostType + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NameValuePairCostType() + { + } + + /// Initializes a new instance of . + /// The name. + /// The value. + /// Keeps track of any properties unknown to the library. + internal NameValuePairCostType(CostType? name, float? value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name. + public CostType? Name { get; } + /// The value. + public float? Value { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.Serialization.cs new file mode 100644 index 000000000000..bdc3cab36011 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.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.Migrate.Models +{ + public partial class NameValuePairSavingsType : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NameValuePairSavingsType)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Value)) + { + writer.WritePropertyName("value"u8); + writer.WriteNumberValue(Value.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 + } + } + } + + NameValuePairSavingsType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NameValuePairSavingsType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNameValuePairSavingsType(document.RootElement, options); + } + + internal static NameValuePairSavingsType DeserializeNameValuePairSavingsType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SavingsType? name = default; + float? value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new SavingsType(property.Value.GetString()); + continue; + } + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + value = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NameValuePairSavingsType(name, 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(NameValuePairSavingsType)} does not support writing '{options.Format}' format."); + } + } + + NameValuePairSavingsType IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNameValuePairSavingsType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NameValuePairSavingsType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.cs new file mode 100644 index 000000000000..44fc6408906f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/NameValuePairSavingsType.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.Migrate.Models +{ + /// The generic name value pair. + public partial class NameValuePairSavingsType + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NameValuePairSavingsType() + { + } + + /// Initializes a new instance of . + /// The name. + /// The value. + /// Keeps track of any properties unknown to the library. + internal NameValuePairSavingsType(SavingsType? name, float? value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name. + public SavingsType? Name { get; } + /// The value. + public float? Value { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProvisioningState.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProvisioningState.cs new file mode 100644 index 000000000000..d0511295ed34 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/ProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// The status of the current operation. + public readonly partial struct ProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string ProvisioningValue = "Provisioning"; + private const string UpdatingValue = "Updating"; + private const string DeletingValue = "Deleting"; + private const string AcceptedValue = "Accepted"; + + /// Resource provisioning Successful. + public static ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); + /// Resource provisioning Failed. + public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); + /// Resource provisioning Canceled. + public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); + /// Resource is being Provisioned. + public static ProvisioningState Provisioning { get; } = new ProvisioningState(ProvisioningValue); + /// Resource is being Updated. + public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); + /// Resource is being Deleted. + public static ProvisioningState Deleting { get; } = new ProvisioningState(DeletingValue); + /// Resource is being Accepted. + public static ProvisioningState Accepted { get; } = new ProvisioningState(AcceptedValue); + /// Determines if two values are the same. + public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); + /// + public bool Equals(ProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.Serialization.cs new file mode 100644 index 000000000000..7e1f080240c7 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Migrate.Models +{ + public partial class SavingsDetailsCommon : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SavingsDetailsCommon)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(SavingOptions)) + { + writer.WritePropertyName("savingOptions"u8); + writer.WriteStringValue(SavingOptions.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SavingsDetail)) + { + writer.WritePropertyName("savingsDetail"u8); + writer.WriteStartArray(); + foreach (var item in SavingsDetail) + { + 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 + } + } + } + + SavingsDetailsCommon IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SavingsDetailsCommon)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSavingsDetailsCommon(document.RootElement, options); + } + + internal static SavingsDetailsCommon DeserializeSavingsDetailsCommon(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SavingsOption? savingOptions = default; + IReadOnlyList savingsDetail = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("savingOptions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + savingOptions = new SavingsOption(property.Value.GetString()); + continue; + } + if (property.NameEquals("savingsDetail"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NameValuePairSavingsType.DeserializeNameValuePairSavingsType(item, options)); + } + savingsDetail = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SavingsDetailsCommon(savingOptions, savingsDetail ?? 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(SavingsDetailsCommon)} does not support writing '{options.Format}' format."); + } + } + + SavingsDetailsCommon IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSavingsDetailsCommon(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SavingsDetailsCommon)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.cs new file mode 100644 index 000000000000..ae06d672509a --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsDetailsCommon.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.Migrate.Models +{ + /// The savings details. + public partial class SavingsDetailsCommon + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SavingsDetailsCommon() + { + SavingsDetail = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The savings options. + /// The sku cost details per azure offer type. + /// Keeps track of any properties unknown to the library. + internal SavingsDetailsCommon(SavingsOption? savingOptions, IReadOnlyList savingsDetail, IDictionary serializedAdditionalRawData) + { + SavingOptions = savingOptions; + SavingsDetail = savingsDetail; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The savings options. + public SavingsOption? SavingOptions { get; } + /// The sku cost details per azure offer type. + public IReadOnlyList SavingsDetail { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsOption.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsOption.cs new file mode 100644 index 000000000000..1e590848ca6d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsOption.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.Migrate.Models +{ + /// The savings options. + public readonly partial struct SavingsOption : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SavingsOption(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string RI1YearValue = "RI1Year"; + private const string RI3YearValue = "RI3Year"; + private const string SavingsPlan1YearValue = "SavingsPlan1Year"; + private const string SavingsPlan3YearValue = "SavingsPlan3Year"; + private const string CustomAzureOfferCodeValue = "CustomAzureOfferCode"; + + /// No savings options. + public static SavingsOption None { get; } = new SavingsOption(NoneValue); + /// Reserved Instance for 1 year. + public static SavingsOption RI1Year { get; } = new SavingsOption(RI1YearValue); + /// Reserved Instance for 3 years. + public static SavingsOption RI3Year { get; } = new SavingsOption(RI3YearValue); + /// The savings plan for 1 year. + public static SavingsOption SavingsPlan1Year { get; } = new SavingsOption(SavingsPlan1YearValue); + /// The savings plan for 3 years. + public static SavingsOption SavingsPlan3Year { get; } = new SavingsOption(SavingsPlan3YearValue); + /// Custom azure offer code. + public static SavingsOption CustomAzureOfferCode { get; } = new SavingsOption(CustomAzureOfferCodeValue); + /// Determines if two values are the same. + public static bool operator ==(SavingsOption left, SavingsOption right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SavingsOption left, SavingsOption right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SavingsOption(string value) => new SavingsOption(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SavingsOption other && Equals(other); + /// + public bool Equals(SavingsOption 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsType.cs new file mode 100644 index 000000000000..87aa1949e515 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SavingsType.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.Migrate.Models +{ + /// Savings type. + public readonly partial struct SavingsType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SavingsType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string MonthlyAzureHybridCostSavingsValue = "MonthlyAzureHybridCostSavings"; + private const string MonthlyLinuxAzureHybridCostSavingsValue = "MonthlyLinuxAzureHybridCostSavings"; + private const string MonthlyAhubSqlCostSavingsValue = "MonthlyAhubSqlCostSavings"; + private const string MonthlyVcfByolCostDifferenceValue = "MonthlyVcfByolCostDifference"; + + /// MonthlyAzureHybridCostSavings - Savings type. + public static SavingsType MonthlyAzureHybridCostSavings { get; } = new SavingsType(MonthlyAzureHybridCostSavingsValue); + /// MonthlyLinuxAzureHybridCostSavings - Savings type. + public static SavingsType MonthlyLinuxAzureHybridCostSavings { get; } = new SavingsType(MonthlyLinuxAzureHybridCostSavingsValue); + /// MonthlyAhubSqlCostSavings - Savings type. + public static SavingsType MonthlyAhubSqlCostSavings { get; } = new SavingsType(MonthlyAhubSqlCostSavingsValue); + /// MonthlyVcfByolCostDifference - Savings type. + public static SavingsType MonthlyVcfByolCostDifference { get; } = new SavingsType(MonthlyVcfByolCostDifferenceValue); + /// Determines if two values are the same. + public static bool operator ==(SavingsType left, SavingsType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SavingsType left, SavingsType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SavingsType(string value) => new SavingsType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SavingsType other && Equals(other); + /// + public bool Equals(SavingsType 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.Serialization.cs new file mode 100644 index 000000000000..a7825e38c300 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.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.Migrate.Models +{ + public partial class SourceDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SourceDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(SourceName)) + { + writer.WritePropertyName("sourceName"u8); + writer.WriteStringValue(SourceName.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SourceType)) + { + writer.WritePropertyName("sourceType"u8); + writer.WriteStringValue(SourceType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Platform)) + { + writer.WritePropertyName("platform"u8); + writer.WriteStringValue(Platform.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.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 + } + } + } + + SourceDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SourceDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSourceDetails(document.RootElement, options); + } + + internal static SourceDetails DeserializeSourceDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AssessmentSource? sourceName = default; + MigrateWorkloadType? sourceType = default; + MigrationPlatform? platform = default; + int? count = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceName = new AssessmentSource(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceType = new MigrateWorkloadType(property.Value.GetString()); + continue; + } + if (property.NameEquals("platform"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + platform = new MigrationPlatform(property.Value.GetString()); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SourceDetails(sourceName, sourceType, platform, count, serializedAdditionalRawData); + } + + BinaryData 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(SourceDetails)} does not support writing '{options.Format}' format."); + } + } + + SourceDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSourceDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SourceDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.cs new file mode 100644 index 000000000000..26f61c43f6e9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SourceDetails.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.Migrate.Models +{ + /// Source details. + public partial class SourceDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SourceDetails() + { + } + + /// Initializes a new instance of . + /// The source name. + /// The source type. + /// The migration platform. + /// The count of a type of source. + /// Keeps track of any properties unknown to the library. + internal SourceDetails(AssessmentSource? sourceName, MigrateWorkloadType? sourceType, MigrationPlatform? platform, int? count, IDictionary serializedAdditionalRawData) + { + SourceName = sourceName; + SourceType = sourceType; + Platform = platform; + Count = count; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The source name. + public AssessmentSource? SourceName { get; } + /// The source type. + public MigrateWorkloadType? SourceType { get; } + /// The migration platform. + public MigrationPlatform? Platform { get; } + /// The count of a type of source. + public int? Count { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SummaryType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SummaryType.cs new file mode 100644 index 000000000000..e166c682086e --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/SummaryType.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.Migrate.Models +{ + /// Summary Type. + public readonly partial struct SummaryType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SummaryType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string StrategyValue = "Strategy"; + private const string TargetValue = "Target"; + + /// Unknown - Summary Type. + public static SummaryType Unknown { get; } = new SummaryType(UnknownValue); + /// Strategy - Summary Type. + public static SummaryType Strategy { get; } = new SummaryType(StrategyValue); + /// Target - Summary Type. + public static SummaryType Target { get; } = new SummaryType(TargetValue); + /// Determines if two values are the same. + public static bool operator ==(SummaryType left, SummaryType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SummaryType left, SummaryType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SummaryType(string value) => new SummaryType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SummaryType other && Equals(other); + /// + public bool Equals(SummaryType 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.Serialization.cs new file mode 100644 index 000000000000..ccaf70ecacf9 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.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.Migrate.Models +{ + public partial class TargetAssessmentArmIds : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(TargetAssessmentArmIds)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Aks)) + { + writer.WritePropertyName("aks"u8); + writer.WriteStringValue(Aks); + } + if (Optional.IsDefined(AzureAppService)) + { + writer.WritePropertyName("azureAppService"u8); + writer.WriteStringValue(AzureAppService); + } + if (Optional.IsDefined(AzureAppServiceContainer)) + { + writer.WritePropertyName("azureAppServiceContainer"u8); + writer.WriteStringValue(AzureAppServiceContainer); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + TargetAssessmentArmIds IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TargetAssessmentArmIds)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTargetAssessmentArmIds(document.RootElement, options); + } + + internal static TargetAssessmentArmIds DeserializeTargetAssessmentArmIds(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string aks = default; + string azureAppService = default; + string azureAppServiceContainer = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("aks"u8)) + { + aks = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureAppService"u8)) + { + azureAppService = property.Value.GetString(); + continue; + } + if (property.NameEquals("azureAppServiceContainer"u8)) + { + azureAppServiceContainer = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TargetAssessmentArmIds(aks, azureAppService, azureAppServiceContainer, serializedAdditionalRawData); + } + + BinaryData 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(TargetAssessmentArmIds)} does not support writing '{options.Format}' format."); + } + } + + TargetAssessmentArmIds IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTargetAssessmentArmIds(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TargetAssessmentArmIds)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.cs new file mode 100644 index 000000000000..d9515c762f96 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetAssessmentArmIds.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.Migrate.Models +{ + /// ARM IDs of the target assessments. + public partial class TargetAssessmentArmIds + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 TargetAssessmentArmIds() + { + } + + /// Initializes a new instance of . + /// ARM ID for Azure Kubernetes Service assessment. + /// ARM ID for Azure App Service assessment. + /// ARM ID for Azure App Service Container assessment. + /// Keeps track of any properties unknown to the library. + internal TargetAssessmentArmIds(string aks, string azureAppService, string azureAppServiceContainer, IDictionary serializedAdditionalRawData) + { + Aks = aks; + AzureAppService = azureAppService; + AzureAppServiceContainer = azureAppServiceContainer; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// ARM ID for Azure Kubernetes Service assessment. + public string Aks { get; set; } + /// ARM ID for Azure App Service assessment. + public string AzureAppService { get; set; } + /// ARM ID for Azure App Service Container assessment. + public string AzureAppServiceContainer { get; set; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.Serialization.cs new file mode 100644 index 000000000000..3bf097404317 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.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.Migrate.Models +{ + public partial class TargetDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(TargetDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(TargetName)) + { + writer.WritePropertyName("targetName"u8); + writer.WriteStringValue(TargetName.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TargetType)) + { + writer.WritePropertyName("targetType"u8); + writer.WriteStringValue(TargetType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Platform)) + { + writer.WritePropertyName("platform"u8); + writer.WriteStringValue(Platform.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.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 + } + } + } + + TargetDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TargetDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTargetDetails(document.RootElement, options); + } + + internal static TargetDetails DeserializeTargetDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AzureTarget? targetName = default; + MigrateWorkloadType? targetType = default; + MigrationPlatform? platform = default; + int? count = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("targetName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetName = new AzureTarget(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetType = new MigrateWorkloadType(property.Value.GetString()); + continue; + } + if (property.NameEquals("platform"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + platform = new MigrationPlatform(property.Value.GetString()); + continue; + } + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TargetDetails(targetName, targetType, platform, count, serializedAdditionalRawData); + } + + BinaryData 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(TargetDetails)} does not support writing '{options.Format}' format."); + } + } + + TargetDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTargetDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TargetDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.cs new file mode 100644 index 000000000000..5d18623d77c5 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetDetails.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.Migrate.Models +{ + /// Target details. + public partial class TargetDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 TargetDetails() + { + } + + /// Initializes a new instance of . + /// The target name. + /// The target type. + /// The migration platform. + /// The count of a type of source. + /// Keeps track of any properties unknown to the library. + internal TargetDetails(AzureTarget? targetName, MigrateWorkloadType? targetType, MigrationPlatform? platform, int? count, IDictionary serializedAdditionalRawData) + { + TargetName = targetName; + TargetType = targetType; + Platform = platform; + Count = count; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The target name. + public AzureTarget? TargetName { get; } + /// The target type. + public MigrateWorkloadType? TargetType { get; } + /// The migration platform. + public MigrationPlatform? Platform { get; } + /// The count of a type of source. + public int? Count { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.Serialization.cs new file mode 100644 index 000000000000..a7ee215dc5cb --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.Serialization.cs @@ -0,0 +1,293 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Migrate.Models +{ + public partial class TargetSourcePair : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(TargetSourcePair)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(SourceRef)) + { + writer.WritePropertyName("sourceRef"u8); + writer.WriteStringValue(SourceRef.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TargetRef)) + { + writer.WritePropertyName("targetRef"u8); + writer.WriteStringValue(TargetRef.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SourceCount)) + { + writer.WritePropertyName("sourceCount"u8); + writer.WriteNumberValue(SourceCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(TargetCount)) + { + writer.WritePropertyName("targetCount"u8); + writer.WriteNumberValue(TargetCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(MigrationDetails)) + { + writer.WritePropertyName("migrationDetails"u8); + writer.WriteObjectValue(MigrationDetails, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ManagementDetails)) + { + writer.WritePropertyName("managementDetails"u8); + writer.WriteStartArray(); + foreach (var item in ManagementDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(CostDetails)) + { + writer.WritePropertyName("costDetails"u8); + writer.WriteStartArray(); + foreach (var item in CostDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SavingsDetails)) + { + writer.WritePropertyName("savingsDetails"u8); + writer.WriteStartArray(); + foreach (var item in SavingsDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ConfidenceScore)) + { + writer.WritePropertyName("confidenceScore"u8); + writer.WriteNumberValue(ConfidenceScore.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 + } + } + } + + TargetSourcePair IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TargetSourcePair)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTargetSourcePair(document.RootElement, options); + } + + internal static TargetSourcePair DeserializeTargetSourcePair(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + AssessmentSource? sourceRef = default; + AzureTarget? targetRef = default; + int? sourceCount = default; + int? targetCount = default; + MigrationDetails migrationDetails = default; + IReadOnlyList managementDetails = default; + IReadOnlyList costDetails = default; + IReadOnlyList savingsDetails = default; + double? confidenceScore = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceRef"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceRef = new AssessmentSource(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetRef"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetRef = new AzureTarget(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("targetCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("migrationDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationDetails = MigrationDetails.DeserializeMigrationDetails(property.Value, options); + continue; + } + if (property.NameEquals("managementDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.ManagementDetails.DeserializeManagementDetails(item, options)); + } + managementDetails = array; + continue; + } + if (property.NameEquals("costDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CostDetailsCommon.DeserializeCostDetailsCommon(item, options)); + } + costDetails = array; + continue; + } + if (property.NameEquals("savingsDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SavingsDetailsCommon.DeserializeSavingsDetailsCommon(item, options)); + } + savingsDetails = array; + continue; + } + if (property.NameEquals("confidenceScore"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + confidenceScore = property.Value.GetDouble(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TargetSourcePair( + sourceRef, + targetRef, + sourceCount, + targetCount, + migrationDetails, + managementDetails ?? new ChangeTrackingList(), + costDetails ?? new ChangeTrackingList(), + savingsDetails ?? new ChangeTrackingList(), + confidenceScore, + serializedAdditionalRawData); + } + + BinaryData 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(TargetSourcePair)} does not support writing '{options.Format}' format."); + } + } + + TargetSourcePair IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTargetSourcePair(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TargetSourcePair)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.cs new file mode 100644 index 000000000000..55fd8e305a01 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/TargetSourcePair.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.Migrate.Models +{ + /// Target source pair. + public partial class TargetSourcePair + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 TargetSourcePair() + { + ManagementDetails = new ChangeTrackingList(); + CostDetails = new ChangeTrackingList(); + SavingsDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The source name. + /// The target name. + /// The count of a type of source. + /// The count of a type of target. + /// The migration details. + /// The management details. + /// The cost details. + /// The savings details. + /// The confidence score. + /// Keeps track of any properties unknown to the library. + internal TargetSourcePair(AssessmentSource? sourceRef, AzureTarget? targetRef, int? sourceCount, int? targetCount, MigrationDetails migrationDetails, IReadOnlyList managementDetails, IReadOnlyList costDetails, IReadOnlyList savingsDetails, double? confidenceScore, IDictionary serializedAdditionalRawData) + { + SourceRef = sourceRef; + TargetRef = targetRef; + SourceCount = sourceCount; + TargetCount = targetCount; + MigrationDetails = migrationDetails; + ManagementDetails = managementDetails; + CostDetails = costDetails; + SavingsDetails = savingsDetails; + ConfidenceScore = confidenceScore; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The source name. + public AssessmentSource? SourceRef { get; } + /// The target name. + public AzureTarget? TargetRef { get; } + /// The count of a type of source. + public int? SourceCount { get; } + /// The count of a type of target. + public int? TargetCount { get; } + /// The migration details. + public MigrationDetails MigrationDetails { get; } + /// The management details. + public IReadOnlyList ManagementDetails { get; } + /// The cost details. + public IReadOnlyList CostDetails { get; } + /// The savings details. + public IReadOnlyList SavingsDetails { get; } + /// The confidence score. + public double? ConfidenceScore { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.Serialization.cs new file mode 100644 index 000000000000..941591926a91 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.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.Migrate.Models +{ + internal partial class WebAppCompoundAssessmentSummaryListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(WebAppCompoundAssessmentSummaryListResult)} 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 + } + } + } + + WebAppCompoundAssessmentSummaryListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebAppCompoundAssessmentSummaryListResult(document.RootElement, options); + } + + internal static WebAppCompoundAssessmentSummaryListResult DeserializeWebAppCompoundAssessmentSummaryListResult(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(WebAppCompoundAssessmentSummaryData.DeserializeWebAppCompoundAssessmentSummaryData(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 WebAppCompoundAssessmentSummaryListResult(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(WebAppCompoundAssessmentSummaryListResult)} does not support writing '{options.Format}' format."); + } + } + + WebAppCompoundAssessmentSummaryListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebAppCompoundAssessmentSummaryListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.cs new file mode 100644 index 000000000000..b4fc81d66b0c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryListResult.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.Migrate.Models +{ + /// The response of a WebAppCompoundAssessmentSummary list operation. + internal partial class WebAppCompoundAssessmentSummaryListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 WebAppCompoundAssessmentSummary items on this page. + /// is null. + internal WebAppCompoundAssessmentSummaryListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The WebAppCompoundAssessmentSummary items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal WebAppCompoundAssessmentSummaryListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal WebAppCompoundAssessmentSummaryListResult() + { + } + + /// The WebAppCompoundAssessmentSummary items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.Serialization.cs new file mode 100644 index 000000000000..bfa67fd587f0 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.Serialization.cs @@ -0,0 +1,305 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.Migrate.Models +{ + public partial class WebAppCompoundAssessmentSummaryProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(WebAppCompoundAssessmentSummaryProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(SummaryType)) + { + writer.WritePropertyName("summaryType"u8); + writer.WriteStringValue(SummaryType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(SummaryName)) + { + writer.WritePropertyName("summaryName"u8); + writer.WriteStringValue(SummaryName); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Sources)) + { + writer.WritePropertyName("sources"u8); + writer.WriteStartArray(); + foreach (var item in Sources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Targets)) + { + writer.WritePropertyName("targets"u8); + writer.WriteStartArray(); + foreach (var item in Targets) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(TargetSourceMapping)) + { + writer.WritePropertyName("targetSourceMapping"u8); + writer.WriteStartArray(); + foreach (var item in TargetSourceMapping) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(CostComponents)) + { + writer.WritePropertyName("costComponents"u8); + writer.WriteStartArray(); + foreach (var item in CostComponents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(SavingsComponents)) + { + writer.WritePropertyName("savingsComponents"u8); + writer.WriteStartArray(); + foreach (var item in SavingsComponents) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AssessmentName)) + { + writer.WritePropertyName("assessmentName"u8); + writer.WriteStringValue(AssessmentName); + } + if (Optional.IsDefined(DiscoveredLightSummary)) + { + writer.WritePropertyName("discoveredLightSummary"u8); + writer.WriteObjectValue(DiscoveredLightSummary, 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 + } + } + } + + WebAppCompoundAssessmentSummaryProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebAppCompoundAssessmentSummaryProperties(document.RootElement, options); + } + + internal static WebAppCompoundAssessmentSummaryProperties DeserializeWebAppCompoundAssessmentSummaryProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SummaryType? summaryType = default; + string summaryName = default; + IReadOnlyList sources = default; + IReadOnlyList targets = default; + IReadOnlyList targetSourceMapping = default; + IReadOnlyList costComponents = default; + IReadOnlyList savingsComponents = default; + string assessmentName = default; + DiscoveredLightSummary discoveredLightSummary = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("summaryType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + summaryType = new SummaryType(property.Value.GetString()); + continue; + } + if (property.NameEquals("summaryName"u8)) + { + summaryName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SourceDetails.DeserializeSourceDetails(item, options)); + } + sources = array; + continue; + } + if (property.NameEquals("targets"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TargetDetails.DeserializeTargetDetails(item, options)); + } + targets = array; + continue; + } + if (property.NameEquals("targetSourceMapping"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(TargetSourcePair.DeserializeTargetSourcePair(item, options)); + } + targetSourceMapping = array; + continue; + } + if (property.NameEquals("costComponents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CostDetailsCommon.DeserializeCostDetailsCommon(item, options)); + } + costComponents = array; + continue; + } + if (property.NameEquals("savingsComponents"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SavingsDetailsCommon.DeserializeSavingsDetailsCommon(item, options)); + } + savingsComponents = array; + continue; + } + if (property.NameEquals("assessmentName"u8)) + { + assessmentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("discoveredLightSummary"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + discoveredLightSummary = DiscoveredLightSummary.DeserializeDiscoveredLightSummary(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WebAppCompoundAssessmentSummaryProperties( + summaryType, + summaryName, + sources ?? new ChangeTrackingList(), + targets ?? new ChangeTrackingList(), + targetSourceMapping ?? new ChangeTrackingList(), + costComponents ?? new ChangeTrackingList(), + savingsComponents ?? new ChangeTrackingList(), + assessmentName, + discoveredLightSummary, + serializedAdditionalRawData); + } + + BinaryData 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(WebAppCompoundAssessmentSummaryProperties)} does not support writing '{options.Format}' format."); + } + } + + WebAppCompoundAssessmentSummaryProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebAppCompoundAssessmentSummaryProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.cs new file mode 100644 index 000000000000..cc46cc30d005 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppCompoundAssessmentSummaryProperties.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.Migrate.Models +{ + /// WebApp compound assessment summary properties class. + public partial class WebAppCompoundAssessmentSummaryProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 WebAppCompoundAssessmentSummaryProperties() + { + Sources = new ChangeTrackingList(); + Targets = new ChangeTrackingList(); + TargetSourceMapping = new ChangeTrackingList(); + CostComponents = new ChangeTrackingList(); + SavingsComponents = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The summary type. + /// The summary name. + /// The source details list. + /// The target details list. + /// The target source mapping. + /// The cost components. + /// The cost components. + /// Name of the assessment. + /// Light summary of the compound assessment. + /// Keeps track of any properties unknown to the library. + internal WebAppCompoundAssessmentSummaryProperties(SummaryType? summaryType, string summaryName, IReadOnlyList sources, IReadOnlyList targets, IReadOnlyList targetSourceMapping, IReadOnlyList costComponents, IReadOnlyList savingsComponents, string assessmentName, DiscoveredLightSummary discoveredLightSummary, IDictionary serializedAdditionalRawData) + { + SummaryType = summaryType; + SummaryName = summaryName; + Sources = sources; + Targets = targets; + TargetSourceMapping = targetSourceMapping; + CostComponents = costComponents; + SavingsComponents = savingsComponents; + AssessmentName = assessmentName; + DiscoveredLightSummary = discoveredLightSummary; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The summary type. + public SummaryType? SummaryType { get; } + /// The summary name. + public string SummaryName { get; } + /// The source details list. + public IReadOnlyList Sources { get; } + /// The target details list. + public IReadOnlyList Targets { get; } + /// The target source mapping. + public IReadOnlyList TargetSourceMapping { get; } + /// The cost components. + public IReadOnlyList CostComponents { get; } + /// The cost components. + public IReadOnlyList SavingsComponents { get; } + /// Name of the assessment. + public string AssessmentName { get; } + /// Light summary of the compound assessment. + public DiscoveredLightSummary DiscoveredLightSummary { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppType.cs new file mode 100644 index 000000000000..7f1943c00e03 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppType.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.Migrate.Models +{ + /// Web App Type. + public readonly partial struct WebAppType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WebAppType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string ASPNETValue = "ASP.Net"; + private const string JavaValue = "Java"; + + /// Unknown. Indicates Missing Data. + public static WebAppType Unknown { get; } = new WebAppType(UnknownValue); + /// ASP.NET Web App. + public static WebAppType ASPNET { get; } = new WebAppType(ASPNETValue); + /// Java Web App. + public static WebAppType Java { get; } = new WebAppType(JavaValue); + /// Determines if two values are the same. + public static bool operator ==(WebAppType left, WebAppType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WebAppType left, WebAppType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator WebAppType(string value) => new WebAppType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WebAppType other && Equals(other); + /// + public bool Equals(WebAppType 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.Serialization.cs new file mode 100644 index 000000000000..94cd6a2b2892 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.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.Migrate.Models +{ + public partial class WebAppsPerType : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(WebAppsPerType)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("webAppType"u8); + writer.WriteStringValue(WebAppType.ToString()); + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + WebAppsPerType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebAppsPerType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebAppsPerType(document.RootElement, options); + } + + internal static WebAppsPerType DeserializeWebAppsPerType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WebAppType webAppType = default; + int count = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("webAppType"u8)) + { + webAppType = new WebAppType(property.Value.GetString()); + continue; + } + if (property.NameEquals("count"u8)) + { + count = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WebAppsPerType(webAppType, count, serializedAdditionalRawData); + } + + BinaryData 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(WebAppsPerType)} does not support writing '{options.Format}' format."); + } + } + + WebAppsPerType IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebAppsPerType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebAppsPerType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.cs new file mode 100644 index 000000000000..034c06a195de --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebAppsPerType.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.Migrate.Models +{ + /// Number of web apps per type. + public partial class WebAppsPerType + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 web app type. + /// Count of the web app type. + internal WebAppsPerType(WebAppType webAppType, int count) + { + WebAppType = webAppType; + Count = count; + } + + /// Initializes a new instance of . + /// Name of the web app type. + /// Count of the web app type. + /// Keeps track of any properties unknown to the library. + internal WebAppsPerType(WebAppType webAppType, int count, IDictionary serializedAdditionalRawData) + { + WebAppType = webAppType; + Count = count; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal WebAppsPerType() + { + } + + /// Name of the web app type. + public WebAppType WebAppType { get; } + /// Count of the web app type. + public int Count { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServerType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServerType.cs new file mode 100644 index 000000000000..97e2a3c39605 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServerType.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.Migrate.Models +{ + /// Web Server Type. + public readonly partial struct WebServerType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public WebServerType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string IISValue = "IIS"; + private const string TomcatValue = "Tomcat"; + + /// Unknown. Indicates Missing Data. + public static WebServerType Unknown { get; } = new WebServerType(UnknownValue); + /// ASP.NET Web App. + public static WebServerType IIS { get; } = new WebServerType(IISValue); + /// Java Web App. + public static WebServerType Tomcat { get; } = new WebServerType(TomcatValue); + /// Determines if two values are the same. + public static bool operator ==(WebServerType left, WebServerType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(WebServerType left, WebServerType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator WebServerType(string value) => new WebServerType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is WebServerType other && Equals(other); + /// + public bool Equals(WebServerType 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/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.Serialization.cs new file mode 100644 index 000000000000..c0c98541af66 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.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.Migrate.Models +{ + public partial class WebServersPerType : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(WebServersPerType)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("webServerType"u8); + writer.WriteStringValue(WebServerType.ToString()); + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + WebServersPerType IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebServersPerType)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebServersPerType(document.RootElement, options); + } + + internal static WebServersPerType DeserializeWebServersPerType(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WebServerType webServerType = default; + int count = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("webServerType"u8)) + { + webServerType = new WebServerType(property.Value.GetString()); + continue; + } + if (property.NameEquals("count"u8)) + { + count = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WebServersPerType(webServerType, count, serializedAdditionalRawData); + } + + BinaryData 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(WebServersPerType)} does not support writing '{options.Format}' format."); + } + } + + WebServersPerType IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebServersPerType(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebServersPerType)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.cs new file mode 100644 index 000000000000..b087cd20b119 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/Models/WebServersPerType.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.Migrate.Models +{ + /// Number of web servers per type. + public partial class WebServersPerType + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 web app type. + /// Count of the web app type. + internal WebServersPerType(WebServerType webServerType, int count) + { + WebServerType = webServerType; + Count = count; + } + + /// Initializes a new instance of . + /// Name of the web app type. + /// Count of the web app type. + /// Keeps track of any properties unknown to the library. + internal WebServersPerType(WebServerType webServerType, int count, IDictionary serializedAdditionalRawData) + { + WebServerType = webServerType; + Count = count; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal WebServersPerType() + { + } + + /// Name of the web app type. + public WebServerType WebServerType { get; } + /// Count of the web app type. + public int Count { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ProviderConstants.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..276ea5df2712 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/CompoundAssessmentRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/CompoundAssessmentRestOperations.cs new file mode 100644 index 000000000000..336ba5bf1b03 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/CompoundAssessmentRestOperations.cs @@ -0,0 +1,615 @@ +// 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.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + internal partial class CompoundAssessmentRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CompoundAssessmentRestOperations. + /// 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 CompoundAssessmentRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-03-03-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM 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 projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CompoundAssessmentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CompoundAssessmentData.DeserializeCompoundAssessmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CompoundAssessmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM 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 projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CompoundAssessmentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CompoundAssessmentData.DeserializeCompoundAssessmentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CompoundAssessmentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string projectName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List CompoundAssessment resources by AssessmentProject. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project 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 projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CompoundAssessmentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CompoundAssessmentListResult.DeserializeCompoundAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List CompoundAssessment resources by AssessmentProject. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project 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 projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CompoundAssessmentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CompoundAssessmentListResult.DeserializeCompoundAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CompoundAssessmentData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CompoundAssessmentData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, 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 CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM 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 CreateAsync(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CompoundAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, 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 CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM 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 Create(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, CompoundAssessmentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM 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 projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM 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 projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDownloadUrlRequestUri(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, DownloadUrlContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendPath("/downloadUrl", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDownloadUrlRequest(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, DownloadUrlContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendPath("/downloadUrl", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// A long-running resource action. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM 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 DownloadUrlAsync(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, DownloadUrlContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateDownloadUrlRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// A long-running resource action. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM 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 DownloadUrl(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, DownloadUrlContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateDownloadUrlRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, content); + _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 projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName) + { + 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 CompoundAssessment resources by AssessmentProject. + /// 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. + /// Assessment Project 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 projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CompoundAssessmentListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = CompoundAssessmentListResult.DeserializeCompoundAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List CompoundAssessment resources by AssessmentProject. + /// 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. + /// Assessment Project 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 projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CompoundAssessmentListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = CompoundAssessmentListResult.DeserializeCompoundAssessmentListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/CompoundAssessmentSummaryRestOperations.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/CompoundAssessmentSummaryRestOperations.cs new file mode 100644 index 000000000000..7b5fb8ad9f92 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/RestOperations/CompoundAssessmentSummaryRestOperations.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Migrate.Models; + +namespace Azure.ResourceManager.Migrate +{ + internal partial class CompoundAssessmentSummaryRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CompoundAssessmentSummaryRestOperations. + /// 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 CompoundAssessmentSummaryRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-03-03-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, string summaryName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendPath("/summaries/", false); + uri.AppendPath(summaryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, string summaryName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendPath("/summaries/", false); + uri.AppendPath(summaryName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a WebAppCompoundAssessmentSummary. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// Gets the Name of the WebApp compound assessment summary. + /// 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 projectName, string compoundAssessmentName, string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, summaryName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCompoundAssessmentSummaryData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = WebAppCompoundAssessmentSummaryData.DeserializeWebAppCompoundAssessmentSummaryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((WebAppCompoundAssessmentSummaryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a WebAppCompoundAssessmentSummary. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM name. + /// Gets the Name of the WebApp compound assessment summary. + /// 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 projectName, string compoundAssessmentName, string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName, summaryName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCompoundAssessmentSummaryData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = WebAppCompoundAssessmentSummaryData.DeserializeWebAppCompoundAssessmentSummaryData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((WebAppCompoundAssessmentSummaryData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentRequestUri(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendPath("/summaries", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByParentRequest(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Migrate/assessmentProjects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/webAppCompoundAssessments/", false); + uri.AppendPath(compoundAssessmentName, true); + uri.AppendPath("/summaries", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM 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 projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCompoundAssessmentSummaryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = WebAppCompoundAssessmentSummaryListResult.DeserializeWebAppCompoundAssessmentSummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Assessment Project Name. + /// Compound Assessment ARM 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 projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateListByParentRequest(subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCompoundAssessmentSummaryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = WebAppCompoundAssessmentSummaryListResult.DeserializeWebAppCompoundAssessmentSummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByParentNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListByParentNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName) + { + 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 WebAppCompoundAssessmentSummary resources by CompoundAssessment. + /// 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. + /// Assessment Project Name. + /// Compound Assessment ARM 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 projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + WebAppCompoundAssessmentSummaryListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = WebAppCompoundAssessmentSummaryListResult.DeserializeWebAppCompoundAssessmentSummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List WebAppCompoundAssessmentSummary resources by CompoundAssessment. + /// 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. + /// Assessment Project Name. + /// Compound Assessment ARM 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 projectName, string compoundAssessmentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(compoundAssessmentName, nameof(compoundAssessmentName)); + + using var message = CreateListByParentNextPageRequest(nextLink, subscriptionId, resourceGroupName, projectName, compoundAssessmentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + WebAppCompoundAssessmentSummaryListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = WebAppCompoundAssessmentSummaryListResult.DeserializeWebAppCompoundAssessmentSummaryListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryCollection.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryCollection.cs new file mode 100644 index 000000000000..133051600d11 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryCollection.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.Migrate +{ + /// + /// 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 GetWebAppCompoundAssessmentSummaries method from an instance of . + /// + public partial class WebAppCompoundAssessmentSummaryCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics; + private readonly CompoundAssessmentSummaryRestOperations _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected WebAppCompoundAssessmentSummaryCollection() + { + } + + /// 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 WebAppCompoundAssessmentSummaryCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", WebAppCompoundAssessmentSummaryResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(WebAppCompoundAssessmentSummaryResource.ResourceType, out string webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsApiVersion); + _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient = new CompoundAssessmentSummaryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != CompoundAssessmentResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, CompoundAssessmentResource.ResourceType), nameof(id)); + } + + /// + /// Get a WebAppCompoundAssessmentSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryCollection.Get"); + scope.Start(); + try + { + var response = await _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, summaryName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WebAppCompoundAssessmentSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a WebAppCompoundAssessmentSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryCollection.Get"); + scope.Start(); + try + { + var response = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, summaryName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WebAppCompoundAssessmentSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List WebAppCompoundAssessmentSummary resources by CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_ListByParent + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new WebAppCompoundAssessmentSummaryResource(Client, WebAppCompoundAssessmentSummaryData.DeserializeWebAppCompoundAssessmentSummaryData(e)), _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics, Pipeline, "WebAppCompoundAssessmentSummaryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List WebAppCompoundAssessmentSummary resources by CompoundAssessment + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_ListByParent + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.CreateListByParentRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.CreateListByParentNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new WebAppCompoundAssessmentSummaryResource(Client, WebAppCompoundAssessmentSummaryData.DeserializeWebAppCompoundAssessmentSummaryData(e)), _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics, Pipeline, "WebAppCompoundAssessmentSummaryCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryCollection.Exists"); + scope.Start(); + try + { + var response = await _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, summaryName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryCollection.Exists"); + scope.Start(); + try + { + var response = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, summaryName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, summaryName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WebAppCompoundAssessmentSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// Gets the Name of the WebApp compound assessment summary. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string summaryName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(summaryName, nameof(summaryName)); + + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryCollection.GetIfExists"); + scope.Start(); + try + { + var response = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, summaryName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new WebAppCompoundAssessmentSummaryResource(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/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.Serialization.cs new file mode 100644 index 000000000000..d83cfe5c4031 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.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.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + public partial class WebAppCompoundAssessmentSummaryData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(WebAppCompoundAssessmentSummaryData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + WebAppCompoundAssessmentSummaryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWebAppCompoundAssessmentSummaryData(document.RootElement, options); + } + + internal static WebAppCompoundAssessmentSummaryData DeserializeWebAppCompoundAssessmentSummaryData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + WebAppCompoundAssessmentSummaryProperties 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 = WebAppCompoundAssessmentSummaryProperties.DeserializeWebAppCompoundAssessmentSummaryProperties(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 WebAppCompoundAssessmentSummaryData( + 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(WebAppCompoundAssessmentSummaryData)} does not support writing '{options.Format}' format."); + } + } + + WebAppCompoundAssessmentSummaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWebAppCompoundAssessmentSummaryData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WebAppCompoundAssessmentSummaryData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.cs new file mode 100644 index 000000000000..c1b9d84f7d5c --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryData.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.Migrate.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A class representing the WebAppCompoundAssessmentSummary data model. + /// WebApp compound assessment summary resource. + /// + public partial class WebAppCompoundAssessmentSummaryData : 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 WebAppCompoundAssessmentSummaryData() + { + } + + /// 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 WebAppCompoundAssessmentSummaryData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, WebAppCompoundAssessmentSummaryProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public WebAppCompoundAssessmentSummaryProperties Properties { get; } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.Serialization.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.Serialization.cs new file mode 100644 index 000000000000..36b704e7606f --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.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.Migrate +{ + public partial class WebAppCompoundAssessmentSummaryResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + WebAppCompoundAssessmentSummaryData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + WebAppCompoundAssessmentSummaryData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.cs new file mode 100644 index 000000000000..207f351c180d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/src/Generated/WebAppCompoundAssessmentSummaryResource.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.Migrate +{ + /// + /// A Class representing a WebAppCompoundAssessmentSummary 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 GetWebAppCompoundAssessmentSummaryResource method. + /// Otherwise you can get one from its parent resource using the GetWebAppCompoundAssessmentSummary method. + /// + public partial class WebAppCompoundAssessmentSummaryResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The projectName. + /// The compoundAssessmentName. + /// The summaryName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string projectName, string compoundAssessmentName, string summaryName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics; + private readonly CompoundAssessmentSummaryRestOperations _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient; + private readonly WebAppCompoundAssessmentSummaryData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Migrate/assessmentProjects/webAppCompoundAssessments/summaries"; + + /// Initializes a new instance of the class for mocking. + protected WebAppCompoundAssessmentSummaryResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal WebAppCompoundAssessmentSummaryResource(ArmClient client, WebAppCompoundAssessmentSummaryData 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 WebAppCompoundAssessmentSummaryResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.Migrate", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsApiVersion); + _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient = new CompoundAssessmentSummaryRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsApiVersion); +#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 WebAppCompoundAssessmentSummaryData 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 WebAppCompoundAssessmentSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryResource.Get"); + scope.Start(); + try + { + var response = await _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WebAppCompoundAssessmentSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a WebAppCompoundAssessmentSummary + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/assessmentProjects/{projectName}/webAppCompoundAssessments/{compoundAssessmentName}/summaries/{summaryName} + /// + /// + /// Operation Id + /// WebAppCompoundAssessmentSummary_Get + /// + /// + /// Default Api Version + /// 2024-03-03-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsClientDiagnostics.CreateScope("WebAppCompoundAssessmentSummaryResource.Get"); + scope.Start(); + try + { + var response = _webAppCompoundAssessmentSummaryCompoundAssessmentSummaryOperationsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new WebAppCompoundAssessmentSummaryResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/src/Properties/AssemblyInfo.cs b/sdk/migrate/Azure.ResourceManager.Migrate/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..8c9a14318269 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/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.Migrate.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("Migrate")] diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/tests/Azure.ResourceManager.Migrate.Tests.csproj b/sdk/migrate/Azure.ResourceManager.Migrate/tests/Azure.ResourceManager.Migrate.Tests.csproj new file mode 100644 index 000000000000..21d451125a20 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/tests/Azure.ResourceManager.Migrate.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/tests/MigrateManagementTestBase.cs b/sdk/migrate/Azure.ResourceManager.Migrate/tests/MigrateManagementTestBase.cs new file mode 100644 index 000000000000..e3e8cef00b7d --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/tests/MigrateManagementTestBase.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.Migrate.Tests +{ + public class MigrateManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected MigrateManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected MigrateManagementTestBase(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/migrate/Azure.ResourceManager.Migrate/tests/MigrateManagementTestEnvironment.cs b/sdk/migrate/Azure.ResourceManager.Migrate/tests/MigrateManagementTestEnvironment.cs new file mode 100644 index 000000000000..251feeecd081 --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/tests/MigrateManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.Migrate.Tests +{ + public class MigrateManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/migrate/Azure.ResourceManager.Migrate/tsp-location.yaml b/sdk/migrate/Azure.ResourceManager.Migrate/tsp-location.yaml new file mode 100644 index 000000000000..4795d28f9ddd --- /dev/null +++ b/sdk/migrate/Azure.ResourceManager.Migrate/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/migrate/AssessmentProjects.Management/WebAppCompoundAssessments.Management +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b +repo: Azure/azure-rest-api-specs +additionalDirectories: +- specification/migrate/AssessmentProjects.Management/Common diff --git a/sdk/migrate/ci.mgmt.yml b/sdk/migrate/ci.mgmt.yml new file mode 100644 index 000000000000..2984f984e1ac --- /dev/null +++ b/sdk/migrate/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/migrate /ci.mgmt.yml + - sdk/migrate /Azure.ResourceManager.Migrate / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: migrate + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.Migrate + safeName: AzureResourceManagerMigrate diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.net8.0.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.net8.0.cs index f6e35086e51c..7cd64f2bf282 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.net8.0.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.net8.0.cs @@ -1,5 +1,205 @@ namespace Azure.ResourceManager.NeonPostgres { + public partial class BranchCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected BranchCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string branchName, Azure.ResourceManager.NeonPostgres.BranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string branchName, Azure.ResourceManager.NeonPostgres.BranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class BranchData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BranchData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.BranchData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.BranchData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BranchResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected BranchResource() { } + public virtual Azure.ResourceManager.NeonPostgres.BranchData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCompute(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetComputeAsync(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.ComputeCollection GetComputes() { throw null; } + public virtual Azure.Response GetEndpoint(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEndpointAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.EndpointCollection GetEndpoints() { throw null; } + public virtual Azure.Response GetNeonDatabase(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNeonDatabaseAsync(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonDatabaseCollection GetNeonDatabases() { throw null; } + public virtual Azure.Response GetNeonRole(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNeonRoleAsync(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonRoleCollection GetNeonRoles() { throw null; } + Azure.ResourceManager.NeonPostgres.BranchData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.BranchData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.BranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.BranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ComputeCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ComputeCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string computeName, Azure.ResourceManager.NeonPostgres.ComputeData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string computeName, Azure.ResourceManager.NeonPostgres.ComputeData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ComputeData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.ComputeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.ComputeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ComputeResource() { } + public virtual Azure.ResourceManager.NeonPostgres.ComputeData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string computeName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NeonPostgres.ComputeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.ComputeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.ComputeData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.ComputeData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EndpointCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EndpointCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string endpointName, Azure.ResourceManager.NeonPostgres.EndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string endpointName, Azure.ResourceManager.NeonPostgres.EndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class EndpointData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EndpointData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.EndpointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.EndpointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EndpointResource() { } + public virtual Azure.ResourceManager.NeonPostgres.EndpointData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string endpointName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NeonPostgres.EndpointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.EndpointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.EndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.EndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class NeonDatabaseCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected NeonDatabaseCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string neonDatabaseName, Azure.ResourceManager.NeonPostgres.NeonDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string neonDatabaseName, Azure.ResourceManager.NeonPostgres.NeonDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class NeonDatabaseData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonDatabaseData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonDatabaseResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NeonDatabaseResource() { } + public virtual Azure.ResourceManager.NeonPostgres.NeonDatabaseData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonDatabaseName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NeonPostgres.NeonDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.NeonDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.NeonDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class NeonOrganizationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NeonOrganizationCollection() { } @@ -41,6 +241,9 @@ protected NeonOrganizationResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProject(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetProjectAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.ProjectCollection GetProjects() { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -55,12 +258,119 @@ protected NeonOrganizationResource() { } } public static partial class NeonPostgresExtensions { + public static Azure.ResourceManager.NeonPostgres.BranchResource GetBranchResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.NeonPostgres.ComputeResource GetComputeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.NeonPostgres.EndpointResource GetEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonDatabaseResource GetNeonDatabaseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetNeonOrganization(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetNeonOrganizationAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.NeonPostgres.NeonOrganizationResource GetNeonOrganizationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.NeonPostgres.NeonOrganizationCollection GetNeonOrganizations(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetNeonOrganizations(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetNeonOrganizationsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonRoleResource GetNeonRoleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetPostgresVersionsOrganization(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPostgresVersionsOrganizationAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.NeonPostgres.ProjectResource GetProjectResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class NeonRoleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected NeonRoleCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string neonRoleName, Azure.ResourceManager.NeonPostgres.NeonRoleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string neonRoleName, Azure.ResourceManager.NeonPostgres.NeonRoleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class NeonRoleData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonRoleData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonRoleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonRoleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonRoleResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NeonRoleResource() { } + public virtual Azure.ResourceManager.NeonPostgres.NeonRoleData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonRoleName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NeonPostgres.NeonRoleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonRoleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.NeonRoleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.NeonRoleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ProjectCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ProjectCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.NeonPostgres.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.NeonPostgres.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ProjectData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProjectData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.ProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.ProjectData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ProjectResource() { } + public virtual Azure.ResourceManager.NeonPostgres.ProjectData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBranch(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBranchAsync(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.BranchCollection GetBranches() { throw null; } + public virtual Azure.Response GetConnectionUri(Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties connectionUriParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectionUriAsync(Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties connectionUriParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NeonPostgres.ProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.ProjectData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.NeonPostgres.Mocking @@ -68,7 +378,13 @@ namespace Azure.ResourceManager.NeonPostgres.Mocking public partial class MockableNeonPostgresArmClient : Azure.ResourceManager.ArmResource { protected MockableNeonPostgresArmClient() { } + public virtual Azure.ResourceManager.NeonPostgres.BranchResource GetBranchResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.ComputeResource GetComputeResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.EndpointResource GetEndpointResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonDatabaseResource GetNeonDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.NeonPostgres.NeonOrganizationResource GetNeonOrganizationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonRoleResource GetNeonRoleResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.ProjectResource GetProjectResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableNeonPostgresResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -76,6 +392,8 @@ protected MockableNeonPostgresResourceGroupResource() { } public virtual Azure.Response GetNeonOrganization(string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNeonOrganizationAsync(string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.NeonPostgres.NeonOrganizationCollection GetNeonOrganizations() { throw null; } + public virtual Azure.Response GetPostgresVersionsOrganization(Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPostgresVersionsOrganizationAsync(Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class MockableNeonPostgresSubscriptionResource : Azure.ResourceManager.ArmResource { @@ -88,8 +406,81 @@ namespace Azure.ResourceManager.NeonPostgres.Models { public static partial class ArmNeonPostgresModelFactory { + public static Azure.ResourceManager.NeonPostgres.BranchData BranchData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.ComputeData ComputeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties ConnectionUriProperties(string projectId = null, string branchId = null, string databaseName = null, string roleName = null, string endpointId = null, bool? isPooled = default(bool?), string connectionStringUri = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.EndpointData EndpointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties NeonBranchProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string projectId = null, string parentId = null, string roleName = null, string databaseName = null, System.Collections.Generic.IEnumerable roles = null, System.Collections.Generic.IEnumerable databases = null, System.Collections.Generic.IEnumerable endpoints = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties NeonComputeProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string region = null, int? cpuCores = default(int?), int? memory = default(int?), string status = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonDatabaseData NeonDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties NeonDatabaseProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string branchId = null, string ownerName = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties NeonEndpointProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string projectId = null, string branchId = null, Azure.ResourceManager.NeonPostgres.Models.EndpointType? endpointType = default(Azure.ResourceManager.NeonPostgres.Models.EndpointType?)) { throw null; } public static Azure.ResourceManager.NeonPostgres.NeonOrganizationData NeonOrganizationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.NeonPostgres.Models.NeonOrganizationProperties properties = null) { throw null; } - public static Azure.ResourceManager.NeonPostgres.Models.NeonOrganizationProperties NeonOrganizationProperties(Azure.ResourceManager.NeonPostgres.Models.NeonMarketplaceDetails marketplaceDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonUserDetails userDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonCompanyDetails companyDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), Azure.ResourceManager.NeonPostgres.Models.PartnerOrganizationProperties partnerOrganizationProperties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonOrganizationProperties NeonOrganizationProperties(Azure.ResourceManager.NeonPostgres.Models.NeonMarketplaceDetails marketplaceDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonUserDetails userDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonCompanyDetails companyDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), Azure.ResourceManager.NeonPostgres.Models.PartnerOrganizationProperties partnerOrganizationProperties = null, Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties projectProperties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties NeonProjectProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attribute = null, string regionId = null, long? storage = default(long?), int? postgresVersion = default(int?), int? historyRetention = default(int?), Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings defaultEndpointSettings = null, Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties branch = null, System.Collections.Generic.IEnumerable roles = null, System.Collections.Generic.IEnumerable databases = null, System.Collections.Generic.IEnumerable endpoints = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonRoleData NeonRoleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties NeonRoleProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string branchId = null, System.Collections.Generic.IEnumerable permissions = null, bool? isSuperUser = default(bool?)) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.PgVersionsResult PgVersionsResult(System.Collections.Generic.IEnumerable versions = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.ProjectData ProjectData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties properties = null) { throw null; } + } + public partial class Attributes : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Attributes(string name, string value) { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.Attributes System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.Attributes System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectionUriProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionUriProperties() { } + public string BranchId { get { throw null; } set { } } + public string ConnectionStringUri { get { throw null; } } + public string DatabaseName { get { throw null; } set { } } + public string EndpointId { get { throw null; } set { } } + public bool? IsPooled { get { throw null; } set { } } + public string ProjectId { get { throw null; } set { } } + public string RoleName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DefaultEndpointSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DefaultEndpointSettings(float autoscalingLimitMinCu, float autoscalingLimitMaxCu) { } + public float AutoscalingLimitMaxCu { get { throw null; } set { } } + public float AutoscalingLimitMinCu { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EndpointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EndpointType(string value) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.EndpointType ReadOnly { get { throw null; } } + public static Azure.ResourceManager.NeonPostgres.Models.EndpointType ReadWrite { get { throw null; } } + public bool Equals(Azure.ResourceManager.NeonPostgres.Models.EndpointType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.NeonPostgres.Models.EndpointType left, Azure.ResourceManager.NeonPostgres.Models.EndpointType right) { throw null; } + public static implicit operator Azure.ResourceManager.NeonPostgres.Models.EndpointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.NeonPostgres.Models.EndpointType left, Azure.ResourceManager.NeonPostgres.Models.EndpointType right) { throw null; } + public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MarketplaceSubscriptionStatus : System.IEquatable @@ -111,6 +502,28 @@ public static partial class ArmNeonPostgresModelFactory public static bool operator !=(Azure.ResourceManager.NeonPostgres.Models.MarketplaceSubscriptionStatus left, Azure.ResourceManager.NeonPostgres.Models.MarketplaceSubscriptionStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class NeonBranchProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonBranchProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string CreatedAt { get { throw null; } } + public string DatabaseName { get { throw null; } set { } } + public System.Collections.Generic.IList Databases { get { throw null; } } + public System.Collections.Generic.IList Endpoints { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public string ParentId { get { throw null; } set { } } + public string ProjectId { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + public string RoleName { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NeonCompanyDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NeonCompanyDetails() { } @@ -127,6 +540,60 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NeonComputeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonComputeProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public int? CpuCores { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public int? Memory { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + public string Region { get { throw null; } set { } } + public string Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonDatabaseProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonDatabaseProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string BranchId { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public string OwnerName { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonEndpointProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonEndpointProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string BranchId { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.EndpointType? EndpointType { get { throw null; } set { } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public string ProjectId { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NeonMarketplaceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NeonMarketplaceDetails(Azure.ResourceManager.NeonPostgres.Models.NeonOfferDetails offerDetails) { } @@ -162,6 +629,7 @@ public NeonOrganizationProperties(Azure.ResourceManager.NeonPostgres.Models.Neon public Azure.ResourceManager.NeonPostgres.Models.NeonCompanyDetails CompanyDetails { get { throw null; } set { } } public Azure.ResourceManager.NeonPostgres.Models.NeonMarketplaceDetails MarketplaceDetails { get { throw null; } set { } } public Azure.ResourceManager.NeonPostgres.Models.PartnerOrganizationProperties PartnerOrganizationProperties { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties ProjectProperties { get { throw null; } set { } } public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.NeonPostgres.Models.NeonUserDetails UserDetails { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -171,6 +639,30 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NeonProjectProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonProjectProperties() { } + public System.Collections.Generic.IList Attribute { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties Branch { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public System.Collections.Generic.IList Databases { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings DefaultEndpointSettings { get { throw null; } set { } } + public System.Collections.Generic.IList Endpoints { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public int? HistoryRetention { get { throw null; } set { } } + public int? PostgresVersion { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + public string RegionId { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } + public long? Storage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct NeonResourceProvisioningState : System.IEquatable { @@ -190,6 +682,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState left, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState right) { throw null; } public override string ToString() { throw null; } } + public partial class NeonRoleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonRoleProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string BranchId { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public bool? IsSuperUser { get { throw null; } set { } } + public System.Collections.Generic.IList Permissions { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NeonSingleSignOnProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NeonSingleSignOnProperties() { } @@ -251,4 +761,26 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class PgVersion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PgVersion() { } + public int? Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PgVersionsResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PgVersionsResult() { } + public System.Collections.Generic.IReadOnlyList Versions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersionsResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersionsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.netstandard2.0.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.netstandard2.0.cs index f6e35086e51c..7cd64f2bf282 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.netstandard2.0.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/api/Azure.ResourceManager.NeonPostgres.netstandard2.0.cs @@ -1,5 +1,205 @@ namespace Azure.ResourceManager.NeonPostgres { + public partial class BranchCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected BranchCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string branchName, Azure.ResourceManager.NeonPostgres.BranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string branchName, Azure.ResourceManager.NeonPostgres.BranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class BranchData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public BranchData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.BranchData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.BranchData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class BranchResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected BranchResource() { } + public virtual Azure.ResourceManager.NeonPostgres.BranchData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCompute(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetComputeAsync(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.ComputeCollection GetComputes() { throw null; } + public virtual Azure.Response GetEndpoint(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetEndpointAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.EndpointCollection GetEndpoints() { throw null; } + public virtual Azure.Response GetNeonDatabase(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNeonDatabaseAsync(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonDatabaseCollection GetNeonDatabases() { throw null; } + public virtual Azure.Response GetNeonRole(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetNeonRoleAsync(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonRoleCollection GetNeonRoles() { throw null; } + Azure.ResourceManager.NeonPostgres.BranchData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.BranchData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.BranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.BranchData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ComputeCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ComputeCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string computeName, Azure.ResourceManager.NeonPostgres.ComputeData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string computeName, Azure.ResourceManager.NeonPostgres.ComputeData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string computeName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ComputeData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ComputeData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.ComputeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.ComputeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ComputeResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ComputeResource() { } + public virtual Azure.ResourceManager.NeonPostgres.ComputeData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string computeName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NeonPostgres.ComputeData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.ComputeData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.ComputeData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.ComputeData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class EndpointCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected EndpointCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string endpointName, Azure.ResourceManager.NeonPostgres.EndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string endpointName, Azure.ResourceManager.NeonPostgres.EndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string endpointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class EndpointData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public EndpointData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.EndpointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.EndpointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class EndpointResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected EndpointResource() { } + public virtual Azure.ResourceManager.NeonPostgres.EndpointData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string endpointName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NeonPostgres.EndpointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.EndpointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.EndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.EndpointData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class NeonDatabaseCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected NeonDatabaseCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string neonDatabaseName, Azure.ResourceManager.NeonPostgres.NeonDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string neonDatabaseName, Azure.ResourceManager.NeonPostgres.NeonDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string neonDatabaseName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class NeonDatabaseData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonDatabaseData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonDatabaseResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NeonDatabaseResource() { } + public virtual Azure.ResourceManager.NeonPostgres.NeonDatabaseData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonDatabaseName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NeonPostgres.NeonDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.NeonDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.NeonDatabaseData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class NeonOrganizationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected NeonOrganizationCollection() { } @@ -41,6 +241,9 @@ protected NeonOrganizationResource() { } public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetProject(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetProjectAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.ProjectCollection GetProjects() { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -55,12 +258,119 @@ protected NeonOrganizationResource() { } } public static partial class NeonPostgresExtensions { + public static Azure.ResourceManager.NeonPostgres.BranchResource GetBranchResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.NeonPostgres.ComputeResource GetComputeResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.NeonPostgres.EndpointResource GetEndpointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonDatabaseResource GetNeonDatabaseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetNeonOrganization(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetNeonOrganizationAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.NeonPostgres.NeonOrganizationResource GetNeonOrganizationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.NeonPostgres.NeonOrganizationCollection GetNeonOrganizations(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetNeonOrganizations(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetNeonOrganizationsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonRoleResource GetNeonRoleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetPostgresVersionsOrganization(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetPostgresVersionsOrganizationAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.NeonPostgres.ProjectResource GetProjectResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class NeonRoleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected NeonRoleCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string neonRoleName, Azure.ResourceManager.NeonPostgres.NeonRoleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string neonRoleName, Azure.ResourceManager.NeonPostgres.NeonRoleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string neonRoleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class NeonRoleData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonRoleData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonRoleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonRoleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonRoleResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected NeonRoleResource() { } + public virtual Azure.ResourceManager.NeonPostgres.NeonRoleData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonRoleName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NeonPostgres.NeonRoleData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.NeonRoleData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.NeonRoleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.NeonRoleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class ProjectCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected ProjectCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.NeonPostgres.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string projectName, Azure.ResourceManager.NeonPostgres.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string projectName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class ProjectData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProjectData() { } + public Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.ProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.ProjectData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProjectResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected ProjectResource() { } + public virtual Azure.ResourceManager.NeonPostgres.ProjectData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetBranch(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetBranchAsync(string branchName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.BranchCollection GetBranches() { throw null; } + public virtual Azure.Response GetConnectionUri(Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties connectionUriParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectionUriAsync(Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties connectionUriParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.NeonPostgres.ProjectData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.ProjectData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.NeonPostgres.ProjectData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } } namespace Azure.ResourceManager.NeonPostgres.Mocking @@ -68,7 +378,13 @@ namespace Azure.ResourceManager.NeonPostgres.Mocking public partial class MockableNeonPostgresArmClient : Azure.ResourceManager.ArmResource { protected MockableNeonPostgresArmClient() { } + public virtual Azure.ResourceManager.NeonPostgres.BranchResource GetBranchResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.ComputeResource GetComputeResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.EndpointResource GetEndpointResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonDatabaseResource GetNeonDatabaseResource(Azure.Core.ResourceIdentifier id) { throw null; } public virtual Azure.ResourceManager.NeonPostgres.NeonOrganizationResource GetNeonOrganizationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.NeonRoleResource GetNeonRoleResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.NeonPostgres.ProjectResource GetProjectResource(Azure.Core.ResourceIdentifier id) { throw null; } } public partial class MockableNeonPostgresResourceGroupResource : Azure.ResourceManager.ArmResource { @@ -76,6 +392,8 @@ protected MockableNeonPostgresResourceGroupResource() { } public virtual Azure.Response GetNeonOrganization(string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetNeonOrganizationAsync(string organizationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.NeonPostgres.NeonOrganizationCollection GetNeonOrganizations() { throw null; } + public virtual Azure.Response GetPostgresVersionsOrganization(Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetPostgresVersionsOrganizationAsync(Azure.ResourceManager.NeonPostgres.Models.PgVersion pgVersion = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } public partial class MockableNeonPostgresSubscriptionResource : Azure.ResourceManager.ArmResource { @@ -88,8 +406,81 @@ namespace Azure.ResourceManager.NeonPostgres.Models { public static partial class ArmNeonPostgresModelFactory { + public static Azure.ResourceManager.NeonPostgres.BranchData BranchData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.ComputeData ComputeData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties ConnectionUriProperties(string projectId = null, string branchId = null, string databaseName = null, string roleName = null, string endpointId = null, bool? isPooled = default(bool?), string connectionStringUri = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.EndpointData EndpointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties NeonBranchProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string projectId = null, string parentId = null, string roleName = null, string databaseName = null, System.Collections.Generic.IEnumerable roles = null, System.Collections.Generic.IEnumerable databases = null, System.Collections.Generic.IEnumerable endpoints = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties NeonComputeProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string region = null, int? cpuCores = default(int?), int? memory = default(int?), string status = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonDatabaseData NeonDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties NeonDatabaseProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string branchId = null, string ownerName = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties NeonEndpointProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string projectId = null, string branchId = null, Azure.ResourceManager.NeonPostgres.Models.EndpointType? endpointType = default(Azure.ResourceManager.NeonPostgres.Models.EndpointType?)) { throw null; } public static Azure.ResourceManager.NeonPostgres.NeonOrganizationData NeonOrganizationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.NeonPostgres.Models.NeonOrganizationProperties properties = null) { throw null; } - public static Azure.ResourceManager.NeonPostgres.Models.NeonOrganizationProperties NeonOrganizationProperties(Azure.ResourceManager.NeonPostgres.Models.NeonMarketplaceDetails marketplaceDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonUserDetails userDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonCompanyDetails companyDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), Azure.ResourceManager.NeonPostgres.Models.PartnerOrganizationProperties partnerOrganizationProperties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonOrganizationProperties NeonOrganizationProperties(Azure.ResourceManager.NeonPostgres.Models.NeonMarketplaceDetails marketplaceDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonUserDetails userDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonCompanyDetails companyDetails = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), Azure.ResourceManager.NeonPostgres.Models.PartnerOrganizationProperties partnerOrganizationProperties = null, Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties projectProperties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties NeonProjectProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attribute = null, string regionId = null, long? storage = default(long?), int? postgresVersion = default(int?), int? historyRetention = default(int?), Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings defaultEndpointSettings = null, Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties branch = null, System.Collections.Generic.IEnumerable roles = null, System.Collections.Generic.IEnumerable databases = null, System.Collections.Generic.IEnumerable endpoints = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.NeonRoleData NeonRoleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties properties = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties NeonRoleProperties(string entityId = null, string entityName = null, string createdAt = null, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? provisioningState = default(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState?), System.Collections.Generic.IEnumerable attributes = null, string branchId = null, System.Collections.Generic.IEnumerable permissions = null, bool? isSuperUser = default(bool?)) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.PgVersionsResult PgVersionsResult(System.Collections.Generic.IEnumerable versions = null) { throw null; } + public static Azure.ResourceManager.NeonPostgres.ProjectData ProjectData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties properties = null) { throw null; } + } + public partial class Attributes : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public Attributes(string name, string value) { } + public string Name { get { throw null; } set { } } + public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.Attributes System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.Attributes System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ConnectionUriProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ConnectionUriProperties() { } + public string BranchId { get { throw null; } set { } } + public string ConnectionStringUri { get { throw null; } } + public string DatabaseName { get { throw null; } set { } } + public string EndpointId { get { throw null; } set { } } + public bool? IsPooled { get { throw null; } set { } } + public string ProjectId { get { throw null; } set { } } + public string RoleName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.ConnectionUriProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DefaultEndpointSettings : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DefaultEndpointSettings(float autoscalingLimitMinCu, float autoscalingLimitMaxCu) { } + public float AutoscalingLimitMaxCu { get { throw null; } set { } } + public float AutoscalingLimitMinCu { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct EndpointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public EndpointType(string value) { throw null; } + public static Azure.ResourceManager.NeonPostgres.Models.EndpointType ReadOnly { get { throw null; } } + public static Azure.ResourceManager.NeonPostgres.Models.EndpointType ReadWrite { get { throw null; } } + public bool Equals(Azure.ResourceManager.NeonPostgres.Models.EndpointType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.NeonPostgres.Models.EndpointType left, Azure.ResourceManager.NeonPostgres.Models.EndpointType right) { throw null; } + public static implicit operator Azure.ResourceManager.NeonPostgres.Models.EndpointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.NeonPostgres.Models.EndpointType left, Azure.ResourceManager.NeonPostgres.Models.EndpointType right) { throw null; } + public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct MarketplaceSubscriptionStatus : System.IEquatable @@ -111,6 +502,28 @@ public static partial class ArmNeonPostgresModelFactory public static bool operator !=(Azure.ResourceManager.NeonPostgres.Models.MarketplaceSubscriptionStatus left, Azure.ResourceManager.NeonPostgres.Models.MarketplaceSubscriptionStatus right) { throw null; } public override string ToString() { throw null; } } + public partial class NeonBranchProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonBranchProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string CreatedAt { get { throw null; } } + public string DatabaseName { get { throw null; } set { } } + public System.Collections.Generic.IList Databases { get { throw null; } } + public System.Collections.Generic.IList Endpoints { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public string ParentId { get { throw null; } set { } } + public string ProjectId { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + public string RoleName { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NeonCompanyDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NeonCompanyDetails() { } @@ -127,6 +540,60 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NeonComputeProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonComputeProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public int? CpuCores { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public int? Memory { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + public string Region { get { throw null; } set { } } + public string Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonComputeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonDatabaseProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonDatabaseProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string BranchId { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public string OwnerName { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonDatabaseProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class NeonEndpointProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonEndpointProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string BranchId { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.EndpointType? EndpointType { get { throw null; } set { } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public string ProjectId { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonEndpointProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NeonMarketplaceDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NeonMarketplaceDetails(Azure.ResourceManager.NeonPostgres.Models.NeonOfferDetails offerDetails) { } @@ -162,6 +629,7 @@ public NeonOrganizationProperties(Azure.ResourceManager.NeonPostgres.Models.Neon public Azure.ResourceManager.NeonPostgres.Models.NeonCompanyDetails CompanyDetails { get { throw null; } set { } } public Azure.ResourceManager.NeonPostgres.Models.NeonMarketplaceDetails MarketplaceDetails { get { throw null; } set { } } public Azure.ResourceManager.NeonPostgres.Models.PartnerOrganizationProperties PartnerOrganizationProperties { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties ProjectProperties { get { throw null; } set { } } public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.NeonPostgres.Models.NeonUserDetails UserDetails { get { throw null; } set { } } protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } @@ -171,6 +639,30 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class NeonProjectProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonProjectProperties() { } + public System.Collections.Generic.IList Attribute { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.NeonBranchProperties Branch { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public System.Collections.Generic.IList Databases { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.DefaultEndpointSettings DefaultEndpointSettings { get { throw null; } set { } } + public System.Collections.Generic.IList Endpoints { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public int? HistoryRetention { get { throw null; } set { } } + public int? PostgresVersion { get { throw null; } set { } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + public string RegionId { get { throw null; } set { } } + public System.Collections.Generic.IList Roles { get { throw null; } } + public long? Storage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonProjectProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct NeonResourceProvisioningState : System.IEquatable { @@ -190,6 +682,24 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer public static bool operator !=(Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState left, Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState right) { throw null; } public override string ToString() { throw null; } } + public partial class NeonRoleProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public NeonRoleProperties() { } + public System.Collections.Generic.IList Attributes { get { throw null; } } + public string BranchId { get { throw null; } set { } } + public string CreatedAt { get { throw null; } } + public string EntityId { get { throw null; } } + public string EntityName { get { throw null; } set { } } + public bool? IsSuperUser { get { throw null; } set { } } + public System.Collections.Generic.IList Permissions { get { throw null; } } + public Azure.ResourceManager.NeonPostgres.Models.NeonResourceProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.NeonRoleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } public partial class NeonSingleSignOnProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public NeonSingleSignOnProperties() { } @@ -251,4 +761,26 @@ protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } } + public partial class PgVersion : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PgVersion() { } + public int? Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersion System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersion System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PgVersionsResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal PgVersionsResult() { } + public System.Collections.Generic.IReadOnlyList Versions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersionsResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.NeonPostgres.Models.PgVersionsResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ArmNeonPostgresModelFactory.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ArmNeonPostgresModelFactory.cs index 3c3215cb7d69..32c251994086 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ArmNeonPostgresModelFactory.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ArmNeonPostgresModelFactory.cs @@ -45,9 +45,10 @@ public static NeonOrganizationData NeonOrganizationData(ResourceIdentifier id = /// Details of the user. /// Details of the company. /// Provisioning state of the resource. - /// Organization properties. + /// Neon Organization properties. + /// Neon Project Properties. /// A new instance for mocking. - public static NeonOrganizationProperties NeonOrganizationProperties(NeonMarketplaceDetails marketplaceDetails = null, NeonUserDetails userDetails = null, NeonCompanyDetails companyDetails = null, NeonResourceProvisioningState? provisioningState = null, PartnerOrganizationProperties partnerOrganizationProperties = null) + public static NeonOrganizationProperties NeonOrganizationProperties(NeonMarketplaceDetails marketplaceDetails = null, NeonUserDetails userDetails = null, NeonCompanyDetails companyDetails = null, NeonResourceProvisioningState? provisioningState = null, PartnerOrganizationProperties partnerOrganizationProperties = null, NeonProjectProperties projectProperties = null) { return new NeonOrganizationProperties( marketplaceDetails, @@ -55,6 +56,330 @@ public static NeonOrganizationProperties NeonOrganizationProperties(NeonMarketpl companyDetails, provisioningState, partnerOrganizationProperties, + projectProperties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// Region where the project is created. + /// Data Storage bytes per hour for the project. + /// Postgres version for the project. + /// The retention period for project history in seconds. + /// Default endpoint settings for the project. + /// The Branch properties of the project. This is optional. + /// Roles associated with the project. + /// Neon Databases associated with the project. + /// Endpoints associated with the project. + /// A new instance for mocking. + public static NeonProjectProperties NeonProjectProperties(string entityId = null, string entityName = null, string createdAt = null, NeonResourceProvisioningState? provisioningState = null, IEnumerable attribute = null, string regionId = null, long? storage = null, int? postgresVersion = null, int? historyRetention = null, DefaultEndpointSettings defaultEndpointSettings = null, NeonBranchProperties branch = null, IEnumerable roles = null, IEnumerable databases = null, IEnumerable endpoints = null) + { + attribute ??= new List(); + roles ??= new List(); + databases ??= new List(); + endpoints ??= new List(); + + return new NeonProjectProperties( + entityId, + entityName, + createdAt, + provisioningState, + attribute?.ToList(), + regionId, + storage, + postgresVersion, + historyRetention, + defaultEndpointSettings, + branch, + roles?.ToList(), + databases?.ToList(), + endpoints?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the project this branch belongs to. + /// The ID of the parent branch. + /// Role name associated with the branch. + /// Database name associated with the branch. + /// Roles associated with the branch. + /// Neon Databases associated with the branch. + /// Endpoints associated with the branch. + /// A new instance for mocking. + public static NeonBranchProperties NeonBranchProperties(string entityId = null, string entityName = null, string createdAt = null, NeonResourceProvisioningState? provisioningState = null, IEnumerable attributes = null, string projectId = null, string parentId = null, string roleName = null, string databaseName = null, IEnumerable roles = null, IEnumerable databases = null, IEnumerable endpoints = null) + { + attributes ??= new List(); + roles ??= new List(); + databases ??= new List(); + endpoints ??= new List(); + + return new NeonBranchProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes?.ToList(), + projectId, + parentId, + roleName, + databaseName, + roles?.ToList(), + databases?.ToList(), + endpoints?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the branch this role belongs to. + /// Permissions assigned to the role. + /// Indicates whether the role has superuser privileges. + /// A new instance for mocking. + public static NeonRoleProperties NeonRoleProperties(string entityId = null, string entityName = null, string createdAt = null, NeonResourceProvisioningState? provisioningState = null, IEnumerable attributes = null, string branchId = null, IEnumerable permissions = null, bool? isSuperUser = null) + { + attributes ??= new List(); + permissions ??= new List(); + + return new NeonRoleProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes?.ToList(), + branchId, + permissions?.ToList(), + isSuperUser, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the branch this database belongs to. + /// The name of the role that owns the database. + /// A new instance for mocking. + public static NeonDatabaseProperties NeonDatabaseProperties(string entityId = null, string entityName = null, string createdAt = null, NeonResourceProvisioningState? provisioningState = null, IEnumerable attributes = null, string branchId = null, string ownerName = null) + { + attributes ??= new List(); + + return new NeonDatabaseProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes?.ToList(), + branchId, + ownerName, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the project this endpoint belongs to. + /// The ID of the branch this endpoint belongs to. + /// The type of the endpoint. + /// A new instance for mocking. + public static NeonEndpointProperties NeonEndpointProperties(string entityId = null, string entityName = null, string createdAt = null, NeonResourceProvisioningState? provisioningState = null, IEnumerable attributes = null, string projectId = null, string branchId = null, EndpointType? endpointType = null) + { + attributes ??= new List(); + + return new NeonEndpointProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes?.ToList(), + projectId, + branchId, + endpointType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// List of PostgreSQL versions. + /// A new instance for mocking. + public static PgVersionsResult PgVersionsResult(IEnumerable versions = null) + { + versions ??= new List(); + + return new PgVersionsResult(versions?.ToList(), 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 ProjectData ProjectData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NeonProjectProperties properties = null) + { + return new ProjectData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Project Id associated with this connection. + /// Branch Id associated with this connection. + /// Database name associated with this connection. + /// The role name used for authentication. + /// the endpoint Id with this connection. + /// Indicates if the connection is pooled. + /// connection uri returned for the database. + /// A new instance for mocking. + public static ConnectionUriProperties ConnectionUriProperties(string projectId = null, string branchId = null, string databaseName = null, string roleName = null, string endpointId = null, bool? isPooled = null, string connectionStringUri = null) + { + return new ConnectionUriProperties( + projectId, + branchId, + databaseName, + roleName, + endpointId, + isPooled, + connectionStringUri, + 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 BranchData BranchData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NeonBranchProperties properties = null) + { + return new BranchData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static ComputeData ComputeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NeonComputeProperties properties = null) + { + return new ComputeData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// Region where the compute instance is located. + /// Number of allocated CPU cores. + /// Memory allocated in GB. + /// Current status of the compute instance. + /// A new instance for mocking. + public static NeonComputeProperties NeonComputeProperties(string entityId = null, string entityName = null, string createdAt = null, NeonResourceProvisioningState? provisioningState = null, IEnumerable attributes = null, string region = null, int? cpuCores = null, int? memory = null, string status = null) + { + attributes ??= new List(); + + return new NeonComputeProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes?.ToList(), + region, + cpuCores, + memory, + status, + 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 NeonDatabaseData NeonDatabaseData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NeonDatabaseProperties properties = null) + { + return new NeonDatabaseData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static NeonRoleData NeonRoleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NeonRoleProperties properties = null) + { + return new NeonRoleData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static EndpointData EndpointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NeonEndpointProperties properties = null) + { + return new EndpointData( + id, + name, + resourceType, + systemData, + properties, serializedAdditionalRawData: null); } } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchCollection.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchCollection.cs new file mode 100644 index 000000000000..c71300f0428f --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchCollection.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.NeonPostgres +{ + /// + /// 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 GetBranches method from an instance of . + /// + public partial class BranchCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _branchClientDiagnostics; + private readonly BranchesRestOperations _branchRestClient; + + /// Initializes a new instance of the class for mocking. + protected BranchCollection() + { + } + + /// 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 BranchCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _branchClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", BranchResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(BranchResource.ResourceType, out string branchApiVersion); + _branchRestClient = new BranchesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, branchApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ProjectResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ProjectResource.ResourceType), nameof(id)); + } + + /// + /// Create a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_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 Branch. + /// 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 branchName, BranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _branchClientDiagnostics.CreateScope("BranchCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _branchRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new BranchOperationSource(Client), _branchClientDiagnostics, Pipeline, _branchRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, 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 Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_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 Branch. + /// 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 branchName, BranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _branchClientDiagnostics.CreateScope("BranchCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _branchRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new BranchOperationSource(Client), _branchClientDiagnostics, Pipeline, _branchRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var scope = _branchClientDiagnostics.CreateScope("BranchCollection.Get"); + scope.Start(); + try + { + var response = await _branchRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BranchResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var scope = _branchClientDiagnostics.CreateScope("BranchCollection.Get"); + scope.Start(); + try + { + var response = _branchRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BranchResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Branch resources by Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches + /// + /// + /// Operation Id + /// Branch_List + /// + /// + /// 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) => _branchRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _branchRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new BranchResource(Client, BranchData.DeserializeBranchData(e)), _branchClientDiagnostics, Pipeline, "BranchCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Branch resources by Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches + /// + /// + /// Operation Id + /// Branch_List + /// + /// + /// 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) => _branchRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _branchRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new BranchResource(Client, BranchData.DeserializeBranchData(e)), _branchClientDiagnostics, Pipeline, "BranchCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var scope = _branchClientDiagnostics.CreateScope("BranchCollection.Exists"); + scope.Start(); + try + { + var response = await _branchRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var scope = _branchClientDiagnostics.CreateScope("BranchCollection.Exists"); + scope.Start(); + try + { + var response = _branchRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var scope = _branchClientDiagnostics.CreateScope("BranchCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _branchRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BranchResource(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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var scope = _branchClientDiagnostics.CreateScope("BranchCollection.GetIfExists"); + scope.Start(); + try + { + var response = _branchRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, branchName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new BranchResource(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/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchData.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchData.Serialization.cs new file mode 100644 index 000000000000..c2b4e2f0db1f --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchData.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + public partial class BranchData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(BranchData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + BranchData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BranchData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBranchData(document.RootElement, options); + } + + internal static BranchData DeserializeBranchData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NeonBranchProperties 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 = NeonBranchProperties.DeserializeNeonBranchProperties(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 BranchData( + 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(BranchData)} does not support writing '{options.Format}' format."); + } + } + + BranchData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBranchData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BranchData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchData.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchData.cs new file mode 100644 index 000000000000..9c654cc9c6d6 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchData.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + /// + /// A class representing the Branch data model. + /// The Branch resource type. + /// + public partial class BranchData : 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 BranchData() + { + } + + /// 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 BranchData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NeonBranchProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public NeonBranchProperties Properties { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchResource.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchResource.Serialization.cs new file mode 100644 index 000000000000..8745b3ad778d --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchResource.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.NeonPostgres +{ + public partial class BranchResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + BranchData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + BranchData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchResource.cs new file mode 100644 index 000000000000..f9896f3d0323 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/BranchResource.cs @@ -0,0 +1,628 @@ +// 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.NeonPostgres +{ + /// + /// A Class representing a Branch 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 GetBranchResource method. + /// Otherwise you can get one from its parent resource using the GetBranch method. + /// + public partial class BranchResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The organizationName. + /// The projectName. + /// The branchName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _branchClientDiagnostics; + private readonly BranchesRestOperations _branchRestClient; + private readonly BranchData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Neon.Postgres/organizations/projects/branches"; + + /// Initializes a new instance of the class for mocking. + protected BranchResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal BranchResource(ArmClient client, BranchData 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 BranchResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _branchClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string branchApiVersion); + _branchRestClient = new BranchesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, branchApiVersion); +#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 BranchData 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 ComputeResources in the Branch. + /// An object representing collection of ComputeResources and their operations over a ComputeResource. + public virtual ComputeCollection GetComputes() + { + return GetCachedClient(client => new ComputeCollection(client, Id)); + } + + /// + /// Get a Compute + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetComputeAsync(string computeName, CancellationToken cancellationToken = default) + { + return await GetComputes().GetAsync(computeName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Compute + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetCompute(string computeName, CancellationToken cancellationToken = default) + { + return GetComputes().Get(computeName, cancellationToken); + } + + /// Gets a collection of NeonDatabaseResources in the Branch. + /// An object representing collection of NeonDatabaseResources and their operations over a NeonDatabaseResource. + public virtual NeonDatabaseCollection GetNeonDatabases() + { + return GetCachedClient(client => new NeonDatabaseCollection(client, Id)); + } + + /// + /// Get a NeonDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonDatabase. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNeonDatabaseAsync(string neonDatabaseName, CancellationToken cancellationToken = default) + { + return await GetNeonDatabases().GetAsync(neonDatabaseName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a NeonDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonDatabase. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNeonDatabase(string neonDatabaseName, CancellationToken cancellationToken = default) + { + return GetNeonDatabases().Get(neonDatabaseName, cancellationToken); + } + + /// Gets a collection of NeonRoleResources in the Branch. + /// An object representing collection of NeonRoleResources and their operations over a NeonRoleResource. + public virtual NeonRoleCollection GetNeonRoles() + { + return GetCachedClient(client => new NeonRoleCollection(client, Id)); + } + + /// + /// Get a NeonRole + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonRole. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetNeonRoleAsync(string neonRoleName, CancellationToken cancellationToken = default) + { + return await GetNeonRoles().GetAsync(neonRoleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a NeonRole + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonRole. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetNeonRole(string neonRoleName, CancellationToken cancellationToken = default) + { + return GetNeonRoles().Get(neonRoleName, cancellationToken); + } + + /// Gets a collection of EndpointResources in the Branch. + /// An object representing collection of EndpointResources and their operations over a EndpointResource. + public virtual EndpointCollection GetEndpoints() + { + return GetCachedClient(client => new EndpointCollection(client, Id)); + } + + /// + /// Get a Endpoint + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Endpoint. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetEndpointAsync(string endpointName, CancellationToken cancellationToken = default) + { + return await GetEndpoints().GetAsync(endpointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Endpoint + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Endpoint. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetEndpoint(string endpointName, CancellationToken cancellationToken = default) + { + return GetEndpoints().Get(endpointName, cancellationToken); + } + + /// + /// Get a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _branchClientDiagnostics.CreateScope("BranchResource.Get"); + scope.Start(); + try + { + var response = await _branchRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BranchResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _branchClientDiagnostics.CreateScope("BranchResource.Get"); + scope.Start(); + try + { + var response = _branchRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new BranchResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_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 = _branchClientDiagnostics.CreateScope("BranchResource.Delete"); + scope.Start(); + try + { + var response = await _branchRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _branchRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_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 = _branchClientDiagnostics.CreateScope("BranchResource.Delete"); + scope.Start(); + try + { + var response = _branchRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _branchRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_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, BranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _branchClientDiagnostics.CreateScope("BranchResource.Update"); + scope.Start(); + try + { + var response = await _branchRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new BranchOperationSource(Client), _branchClientDiagnostics, Pipeline, _branchRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_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, BranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _branchClientDiagnostics.CreateScope("BranchResource.Update"); + scope.Start(); + try + { + var response = _branchRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new BranchOperationSource(Client), _branchClientDiagnostics, Pipeline, _branchRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeCollection.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeCollection.cs new file mode 100644 index 000000000000..6bb9c42be75a --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeCollection.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.NeonPostgres +{ + /// + /// 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 GetComputes method from an instance of . + /// + public partial class ComputeCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _computeClientDiagnostics; + private readonly ComputesRestOperations _computeRestClient; + + /// Initializes a new instance of the class for mocking. + protected ComputeCollection() + { + } + + /// 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 ComputeCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _computeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ComputeResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ComputeResource.ResourceType, out string computeApiVersion); + _computeRestClient = new ComputesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, computeApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != BranchResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BranchResource.ResourceType), nameof(id)); + } + + /// + /// Create a Compute + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_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 Compute. + /// 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 computeName, ComputeData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _computeClientDiagnostics.CreateScope("ComputeCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _computeRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, computeName, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new ComputeOperationSource(Client), _computeClientDiagnostics, Pipeline, _computeRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, computeName, 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 Compute + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_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 Compute. + /// 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 computeName, ComputeData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _computeClientDiagnostics.CreateScope("ComputeCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _computeRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, computeName, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new ComputeOperationSource(Client), _computeClientDiagnostics, Pipeline, _computeRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, computeName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Compute + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var scope = _computeClientDiagnostics.CreateScope("ComputeCollection.Get"); + scope.Start(); + try + { + var response = await _computeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, computeName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ComputeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Compute + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var scope = _computeClientDiagnostics.CreateScope("ComputeCollection.Get"); + scope.Start(); + try + { + var response = _computeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, computeName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ComputeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Compute resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes + /// + /// + /// Operation Id + /// Compute_List + /// + /// + /// 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) => _computeRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _computeRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ComputeResource(Client, ComputeData.DeserializeComputeData(e)), _computeClientDiagnostics, Pipeline, "ComputeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Compute resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes + /// + /// + /// Operation Id + /// Compute_List + /// + /// + /// 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) => _computeRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _computeRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ComputeResource(Client, ComputeData.DeserializeComputeData(e)), _computeClientDiagnostics, Pipeline, "ComputeCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var scope = _computeClientDiagnostics.CreateScope("ComputeCollection.Exists"); + scope.Start(); + try + { + var response = await _computeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, computeName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var scope = _computeClientDiagnostics.CreateScope("ComputeCollection.Exists"); + scope.Start(); + try + { + var response = _computeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, computeName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var scope = _computeClientDiagnostics.CreateScope("ComputeCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _computeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, computeName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ComputeResource(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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Compute. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var scope = _computeClientDiagnostics.CreateScope("ComputeCollection.GetIfExists"); + scope.Start(); + try + { + var response = _computeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, computeName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ComputeResource(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/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeData.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeData.Serialization.cs new file mode 100644 index 000000000000..c4bf7570acc5 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeData.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + public partial class ComputeData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ComputeData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + ComputeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeData(document.RootElement, options); + } + + internal static ComputeData DeserializeComputeData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NeonComputeProperties 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 = NeonComputeProperties.DeserializeNeonComputeProperties(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 ComputeData( + 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(ComputeData)} does not support writing '{options.Format}' format."); + } + } + + ComputeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeComputeData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeData.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeData.cs new file mode 100644 index 000000000000..92fdd8ae765c --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeData.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + /// + /// A class representing the Compute data model. + /// The Compute resource type. + /// + public partial class ComputeData : 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 ComputeData() + { + } + + /// 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 ComputeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NeonComputeProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public NeonComputeProperties Properties { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeResource.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeResource.Serialization.cs new file mode 100644 index 000000000000..9c710e176b72 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeResource.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.NeonPostgres +{ + public partial class ComputeResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ComputeData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ComputeData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeResource.cs new file mode 100644 index 000000000000..24ae7eac9236 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ComputeResource.cs @@ -0,0 +1,353 @@ +// 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.NeonPostgres +{ + /// + /// A Class representing a Compute 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 GetComputeResource method. + /// Otherwise you can get one from its parent resource using the GetCompute method. + /// + public partial class ComputeResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The organizationName. + /// The projectName. + /// The branchName. + /// The computeName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string computeName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _computeClientDiagnostics; + private readonly ComputesRestOperations _computeRestClient; + private readonly ComputeData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Neon.Postgres/organizations/projects/branches/computes"; + + /// Initializes a new instance of the class for mocking. + protected ComputeResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ComputeResource(ArmClient client, ComputeData 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 ComputeResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _computeClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string computeApiVersion); + _computeRestClient = new ComputesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, computeApiVersion); +#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 ComputeData 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 Compute + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _computeClientDiagnostics.CreateScope("ComputeResource.Get"); + scope.Start(); + try + { + var response = await _computeRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ComputeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Compute + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _computeClientDiagnostics.CreateScope("ComputeResource.Get"); + scope.Start(); + try + { + var response = _computeRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ComputeResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Compute + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_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 = _computeClientDiagnostics.CreateScope("ComputeResource.Delete"); + scope.Start(); + try + { + var response = await _computeRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _computeRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Compute + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_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 = _computeClientDiagnostics.CreateScope("ComputeResource.Delete"); + scope.Start(); + try + { + var response = _computeRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _computeRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Compute + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_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, ComputeData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _computeClientDiagnostics.CreateScope("ComputeResource.Update"); + scope.Start(); + try + { + var response = await _computeRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new ComputeOperationSource(Client), _computeClientDiagnostics, Pipeline, _computeRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Compute + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/computes/{computeName} + /// + /// + /// Operation Id + /// Compute_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, ComputeData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _computeClientDiagnostics.CreateScope("ComputeResource.Update"); + scope.Start(); + try + { + var response = _computeRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new ComputeOperationSource(Client), _computeClientDiagnostics, Pipeline, _computeRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointCollection.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointCollection.cs new file mode 100644 index 000000000000..685bc88c86b9 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointCollection.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.NeonPostgres +{ + /// + /// 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 GetEndpoints method from an instance of . + /// + public partial class EndpointCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _endpointClientDiagnostics; + private readonly EndpointsRestOperations _endpointRestClient; + + /// Initializes a new instance of the class for mocking. + protected EndpointCollection() + { + } + + /// 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 EndpointCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _endpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", EndpointResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(EndpointResource.ResourceType, out string endpointApiVersion); + _endpointRestClient = new EndpointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, endpointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != BranchResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BranchResource.ResourceType), nameof(id)); + } + + /// + /// Create a Endpoint + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_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 Endpoint. + /// 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 endpointName, EndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointClientDiagnostics.CreateScope("EndpointCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _endpointRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, endpointName, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new EndpointOperationSource(Client), _endpointClientDiagnostics, Pipeline, _endpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, endpointName, 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 Endpoint + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_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 Endpoint. + /// 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 endpointName, EndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointClientDiagnostics.CreateScope("EndpointCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _endpointRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, endpointName, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new EndpointOperationSource(Client), _endpointClientDiagnostics, Pipeline, _endpointRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, endpointName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Endpoint + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Endpoint. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointClientDiagnostics.CreateScope("EndpointCollection.Get"); + scope.Start(); + try + { + var response = await _endpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, endpointName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Endpoint + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Endpoint. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointClientDiagnostics.CreateScope("EndpointCollection.Get"); + scope.Start(); + try + { + var response = _endpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, endpointName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Endpoint resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints + /// + /// + /// Operation Id + /// Endpoint_List + /// + /// + /// 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) => _endpointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new EndpointResource(Client, EndpointData.DeserializeEndpointData(e)), _endpointClientDiagnostics, Pipeline, "EndpointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Endpoint resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints + /// + /// + /// Operation Id + /// Endpoint_List + /// + /// + /// 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) => _endpointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _endpointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new EndpointResource(Client, EndpointData.DeserializeEndpointData(e)), _endpointClientDiagnostics, Pipeline, "EndpointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Endpoint. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointClientDiagnostics.CreateScope("EndpointCollection.Exists"); + scope.Start(); + try + { + var response = await _endpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, endpointName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Endpoint. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointClientDiagnostics.CreateScope("EndpointCollection.Exists"); + scope.Start(); + try + { + var response = _endpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, endpointName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Endpoint. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointClientDiagnostics.CreateScope("EndpointCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _endpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, endpointName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EndpointResource(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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Endpoint. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var scope = _endpointClientDiagnostics.CreateScope("EndpointCollection.GetIfExists"); + scope.Start(); + try + { + var response = _endpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, endpointName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new EndpointResource(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/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointData.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointData.Serialization.cs new file mode 100644 index 000000000000..3333474c4ebe --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointData.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + public partial class EndpointData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(EndpointData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + EndpointData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointData(document.RootElement, options); + } + + internal static EndpointData DeserializeEndpointData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NeonEndpointProperties 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 = NeonEndpointProperties.DeserializeNeonEndpointProperties(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 EndpointData( + 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(EndpointData)} does not support writing '{options.Format}' format."); + } + } + + EndpointData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEndpointData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointData.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointData.cs new file mode 100644 index 000000000000..35325674fec2 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointData.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + /// + /// A class representing the Endpoint data model. + /// The Neon compute endpoint resource type. + /// + public partial class EndpointData : 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 EndpointData() + { + } + + /// 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 EndpointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NeonEndpointProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public NeonEndpointProperties Properties { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointResource.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointResource.Serialization.cs new file mode 100644 index 000000000000..cd1b4e5bae4a --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointResource.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.NeonPostgres +{ + public partial class EndpointResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + EndpointData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + EndpointData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointResource.cs new file mode 100644 index 000000000000..bb5a489144f1 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/EndpointResource.cs @@ -0,0 +1,353 @@ +// 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.NeonPostgres +{ + /// + /// A Class representing an Endpoint 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 GetEndpointResource method. + /// Otherwise you can get one from its parent resource using the GetEndpoint method. + /// + public partial class EndpointResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The organizationName. + /// The projectName. + /// The branchName. + /// The endpointName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string endpointName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _endpointClientDiagnostics; + private readonly EndpointsRestOperations _endpointRestClient; + private readonly EndpointData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Neon.Postgres/organizations/projects/branches/endpoints"; + + /// Initializes a new instance of the class for mocking. + protected EndpointResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal EndpointResource(ArmClient client, EndpointData 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 EndpointResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _endpointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string endpointApiVersion); + _endpointRestClient = new EndpointsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, endpointApiVersion); +#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 EndpointData 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 Endpoint + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _endpointClientDiagnostics.CreateScope("EndpointResource.Get"); + scope.Start(); + try + { + var response = await _endpointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Endpoint + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _endpointClientDiagnostics.CreateScope("EndpointResource.Get"); + scope.Start(); + try + { + var response = _endpointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new EndpointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Endpoint + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_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 = _endpointClientDiagnostics.CreateScope("EndpointResource.Delete"); + scope.Start(); + try + { + var response = await _endpointRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _endpointRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Endpoint + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_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 = _endpointClientDiagnostics.CreateScope("EndpointResource.Delete"); + scope.Start(); + try + { + var response = _endpointRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _endpointRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Endpoint + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_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, EndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointClientDiagnostics.CreateScope("EndpointResource.Update"); + scope.Start(); + try + { + var response = await _endpointRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new EndpointOperationSource(Client), _endpointClientDiagnostics, Pipeline, _endpointRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Endpoint + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/endpoints/{endpointName} + /// + /// + /// Operation Id + /// Endpoint_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, EndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _endpointClientDiagnostics.CreateScope("EndpointResource.Update"); + scope.Start(); + try + { + var response = _endpointRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new EndpointOperationSource(Client), _endpointClientDiagnostics, Pipeline, _endpointRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresArmClient.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresArmClient.cs index 5a92c8fc6b3a..9771deb7e5d0 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresArmClient.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresArmClient.cs @@ -45,5 +45,77 @@ public virtual NeonOrganizationResource GetNeonOrganizationResource(ResourceIden NeonOrganizationResource.ValidateResourceId(id); return new NeonOrganizationResource(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 ProjectResource GetProjectResource(ResourceIdentifier id) + { + ProjectResource.ValidateResourceId(id); + return new ProjectResource(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 BranchResource GetBranchResource(ResourceIdentifier id) + { + BranchResource.ValidateResourceId(id); + return new BranchResource(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 ComputeResource GetComputeResource(ResourceIdentifier id) + { + ComputeResource.ValidateResourceId(id); + return new ComputeResource(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 NeonDatabaseResource GetNeonDatabaseResource(ResourceIdentifier id) + { + NeonDatabaseResource.ValidateResourceId(id); + return new NeonDatabaseResource(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 NeonRoleResource GetNeonRoleResource(ResourceIdentifier id) + { + NeonRoleResource.ValidateResourceId(id); + return new NeonRoleResource(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 EndpointResource GetEndpointResource(ResourceIdentifier id) + { + EndpointResource.ValidateResourceId(id); + return new EndpointResource(Client, id); + } } } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresResourceGroupResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresResourceGroupResource.cs index 54b0de3692f3..8c33caacd526 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresResourceGroupResource.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresResourceGroupResource.cs @@ -9,12 +9,17 @@ using System.Threading; using System.Threading.Tasks; using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.NeonPostgres.Models; namespace Azure.ResourceManager.NeonPostgres.Mocking { /// A class to add extension methods to ResourceGroupResource. public partial class MockableNeonPostgresResourceGroupResource : ArmResource { + private ClientDiagnostics _neonOrganizationOrganizationsClientDiagnostics; + private OrganizationsRestOperations _neonOrganizationOrganizationsRestClient; + /// Initializes a new instance of the class for mocking. protected MockableNeonPostgresResourceGroupResource() { @@ -27,6 +32,9 @@ internal MockableNeonPostgresResourceGroupResource(ArmClient client, ResourceIde { } + private ClientDiagnostics NeonOrganizationOrganizationsClientDiagnostics => _neonOrganizationOrganizationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", NeonOrganizationResource.ResourceType.Namespace, Diagnostics); + private OrganizationsRestOperations NeonOrganizationOrganizationsRestClient => _neonOrganizationOrganizationsRestClient ??= new OrganizationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(NeonOrganizationResource.ResourceType)); + private string GetApiVersionOrNull(ResourceType resourceType) { TryGetApiVersion(resourceType, out string apiVersion); @@ -53,7 +61,7 @@ public virtual NeonOrganizationCollection GetNeonOrganizations() /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -84,7 +92,7 @@ public virtual async Task> GetNeonOrganizatio /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -101,5 +109,83 @@ public virtual Response GetNeonOrganization(string org { return GetNeonOrganizations().Get(organizationName, cancellationToken); } + + /// + /// Action to retrieve the PostgreSQL versions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/getPostgresVersions + /// + /// + /// Operation Id + /// Organizations_GetPostgresVersions + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Post Action to retrieve the PostgreSQL versions. + /// The cancellation token to use. + public virtual async Task> GetPostgresVersionsOrganizationAsync(PgVersion pgVersion = null, CancellationToken cancellationToken = default) + { + using var scope = NeonOrganizationOrganizationsClientDiagnostics.CreateScope("MockableNeonPostgresResourceGroupResource.GetPostgresVersionsOrganization"); + scope.Start(); + try + { + var response = await NeonOrganizationOrganizationsRestClient.GetPostgresVersionsAsync(Id.SubscriptionId, Id.ResourceGroupName, pgVersion, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Action to retrieve the PostgreSQL versions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/getPostgresVersions + /// + /// + /// Operation Id + /// Organizations_GetPostgresVersions + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Post Action to retrieve the PostgreSQL versions. + /// The cancellation token to use. + public virtual Response GetPostgresVersionsOrganization(PgVersion pgVersion = null, CancellationToken cancellationToken = default) + { + using var scope = NeonOrganizationOrganizationsClientDiagnostics.CreateScope("MockableNeonPostgresResourceGroupResource.GetPostgresVersionsOrganization"); + scope.Start(); + try + { + var response = NeonOrganizationOrganizationsRestClient.GetPostgresVersions(Id.SubscriptionId, Id.ResourceGroupName, pgVersion, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresSubscriptionResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresSubscriptionResource.cs index abc57a2d6f31..71ebd2216522 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresSubscriptionResource.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/MockableNeonPostgresSubscriptionResource.cs @@ -52,7 +52,7 @@ private string GetApiVersionOrNull(ResourceType resourceType) /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -82,7 +82,7 @@ public virtual AsyncPageable GetNeonOrganizationsAsync /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/NeonPostgresExtensions.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/NeonPostgresExtensions.cs index 9037e7c839eb..07ff05441fb8 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/NeonPostgresExtensions.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Extensions/NeonPostgresExtensions.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using Azure.Core; using Azure.ResourceManager.NeonPostgres.Mocking; +using Azure.ResourceManager.NeonPostgres.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.NeonPostgres @@ -51,6 +52,120 @@ public static NeonOrganizationResource GetNeonOrganizationResource(this ArmClien return GetMockableNeonPostgresArmClient(client).GetNeonOrganizationResource(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 ProjectResource GetProjectResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableNeonPostgresArmClient(client).GetProjectResource(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 BranchResource GetBranchResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableNeonPostgresArmClient(client).GetBranchResource(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 ComputeResource GetComputeResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableNeonPostgresArmClient(client).GetComputeResource(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 NeonDatabaseResource GetNeonDatabaseResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableNeonPostgresArmClient(client).GetNeonDatabaseResource(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 NeonRoleResource GetNeonRoleResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableNeonPostgresArmClient(client).GetNeonRoleResource(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 EndpointResource GetEndpointResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableNeonPostgresArmClient(client).GetEndpointResource(id); + } + /// /// Gets a collection of NeonOrganizationResources in the ResourceGroupResource. /// @@ -81,7 +196,7 @@ public static NeonOrganizationCollection GetNeonOrganizations(this ResourceGroup /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -119,7 +234,7 @@ public static async Task> GetNeonOrganization /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -144,6 +259,78 @@ public static Response GetNeonOrganization(this Resour return GetMockableNeonPostgresResourceGroupResource(resourceGroupResource).GetNeonOrganization(organizationName, cancellationToken); } + /// + /// Action to retrieve the PostgreSQL versions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/getPostgresVersions + /// + /// + /// Operation Id + /// Organizations_GetPostgresVersions + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Post Action to retrieve the PostgreSQL versions. + /// The cancellation token to use. + /// is null. + public static async Task> GetPostgresVersionsOrganizationAsync(this ResourceGroupResource resourceGroupResource, PgVersion pgVersion = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableNeonPostgresResourceGroupResource(resourceGroupResource).GetPostgresVersionsOrganizationAsync(pgVersion, cancellationToken).ConfigureAwait(false); + } + + /// + /// Action to retrieve the PostgreSQL versions. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/getPostgresVersions + /// + /// + /// Operation Id + /// Organizations_GetPostgresVersions + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Post Action to retrieve the PostgreSQL versions. + /// The cancellation token to use. + /// is null. + public static Response GetPostgresVersionsOrganization(this ResourceGroupResource resourceGroupResource, PgVersion pgVersion = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableNeonPostgresResourceGroupResource(resourceGroupResource).GetPostgresVersionsOrganization(pgVersion, cancellationToken); + } + /// /// List OrganizationResource resources by subscription ID /// @@ -157,7 +344,7 @@ public static Response GetNeonOrganization(this Resour /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -193,7 +380,7 @@ public static AsyncPageable GetNeonOrganizationsAsync( /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/BranchOperationSource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/BranchOperationSource.cs new file mode 100644 index 000000000000..e4baf5ec50eb --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/BranchOperationSource.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.NeonPostgres +{ + internal class BranchOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal BranchOperationSource(ArmClient client) + { + _client = client; + } + + BranchResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new BranchResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new BranchResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/ComputeOperationSource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/ComputeOperationSource.cs new file mode 100644 index 000000000000..6bc57eba36f5 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/ComputeOperationSource.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.NeonPostgres +{ + internal class ComputeOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ComputeOperationSource(ArmClient client) + { + _client = client; + } + + ComputeResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new ComputeResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new ComputeResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/EndpointOperationSource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/EndpointOperationSource.cs new file mode 100644 index 000000000000..26483546690a --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/EndpointOperationSource.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.NeonPostgres +{ + internal class EndpointOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal EndpointOperationSource(ArmClient client) + { + _client = client; + } + + EndpointResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new EndpointResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new EndpointResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonDatabaseOperationSource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonDatabaseOperationSource.cs new file mode 100644 index 000000000000..4a137f0d87d7 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonDatabaseOperationSource.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.NeonPostgres +{ + internal class NeonDatabaseOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal NeonDatabaseOperationSource(ArmClient client) + { + _client = client; + } + + NeonDatabaseResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new NeonDatabaseResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new NeonDatabaseResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonRoleOperationSource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonRoleOperationSource.cs new file mode 100644 index 000000000000..6c7a4cb58057 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/NeonRoleOperationSource.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.NeonPostgres +{ + internal class NeonRoleOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal NeonRoleOperationSource(ArmClient client) + { + _client = client; + } + + NeonRoleResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new NeonRoleResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new NeonRoleResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/ProjectOperationSource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/ProjectOperationSource.cs new file mode 100644 index 000000000000..75d0702c7378 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/LongRunningOperation/ProjectOperationSource.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.NeonPostgres +{ + internal class ProjectOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal ProjectOperationSource(ArmClient client) + { + _client = client; + } + + ProjectResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new ProjectResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new ProjectResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.Serialization.cs new file mode 100644 index 000000000000..49b17d0dc60b --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.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.NeonPostgres.Models +{ + public partial class Attributes : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(Attributes)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + 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 + } + } + } + + Attributes IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(Attributes)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAttributes(document.RootElement, options); + } + + internal static Attributes DeserializeAttributes(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string value = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("value"u8)) + { + value = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new Attributes(name, 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(Attributes)} does not support writing '{options.Format}' format."); + } + } + + Attributes IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAttributes(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(Attributes)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.cs new file mode 100644 index 000000000000..31082f4bd0ba --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/Attributes.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.NeonPostgres.Models +{ + /// Additional attributes specific to Neon Resources. + public partial class Attributes + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 attribute. + /// Value of the attribute. + /// or is null. + public Attributes(string name, string value) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(value, nameof(value)); + + Name = name; + Value = value; + } + + /// Initializes a new instance of . + /// Name of the attribute. + /// Value of the attribute. + /// Keeps track of any properties unknown to the library. + internal Attributes(string name, string value, IDictionary serializedAdditionalRawData) + { + Name = name; + Value = value; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal Attributes() + { + } + + /// Name of the attribute. + public string Name { get; set; } + /// Value of the attribute. + public string Value { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.Serialization.cs new file mode 100644 index 000000000000..102dc1d72766 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.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.NeonPostgres.Models +{ + internal partial class BranchListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(BranchListResult)} 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 + } + } + } + + BranchListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(BranchListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeBranchListResult(document.RootElement, options); + } + + internal static BranchListResult DeserializeBranchListResult(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(BranchData.DeserializeBranchData(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 BranchListResult(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(BranchListResult)} does not support writing '{options.Format}' format."); + } + } + + BranchListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeBranchListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(BranchListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.cs new file mode 100644 index 000000000000..a02461bcf393 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/BranchListResult.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.NeonPostgres.Models +{ + /// The response of a Branch list operation. + internal partial class BranchListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 Branch items on this page. + /// is null. + internal BranchListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Branch items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal BranchListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal BranchListResult() + { + } + + /// The Branch items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.Serialization.cs new file mode 100644 index 000000000000..b65a7c1810cd --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.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.NeonPostgres.Models +{ + internal partial class ComputeListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ComputeListResult)} 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 + } + } + } + + ComputeListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ComputeListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeComputeListResult(document.RootElement, options); + } + + internal static ComputeListResult DeserializeComputeListResult(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(ComputeData.DeserializeComputeData(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 ComputeListResult(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(ComputeListResult)} does not support writing '{options.Format}' format."); + } + } + + ComputeListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeComputeListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ComputeListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.cs new file mode 100644 index 000000000000..03aa9c0f3709 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ComputeListResult.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.NeonPostgres.Models +{ + /// The response of a Compute list operation. + internal partial class ComputeListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 Compute items on this page. + /// is null. + internal ComputeListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Compute items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ComputeListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ComputeListResult() + { + } + + /// The Compute items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.Serialization.cs new file mode 100644 index 000000000000..c4623a1eb444 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + public partial class ConnectionUriProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ConnectionUriProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ProjectId)) + { + writer.WritePropertyName("projectId"u8); + writer.WriteStringValue(ProjectId); + } + if (Optional.IsDefined(BranchId)) + { + writer.WritePropertyName("branchId"u8); + writer.WriteStringValue(BranchId); + } + if (Optional.IsDefined(DatabaseName)) + { + writer.WritePropertyName("databaseName"u8); + writer.WriteStringValue(DatabaseName); + } + if (Optional.IsDefined(RoleName)) + { + writer.WritePropertyName("roleName"u8); + writer.WriteStringValue(RoleName); + } + if (Optional.IsDefined(EndpointId)) + { + writer.WritePropertyName("endpointId"u8); + writer.WriteStringValue(EndpointId); + } + if (Optional.IsDefined(IsPooled)) + { + writer.WritePropertyName("isPooled"u8); + writer.WriteBooleanValue(IsPooled.Value); + } + if (options.Format != "W" && Optional.IsDefined(ConnectionStringUri)) + { + writer.WritePropertyName("connectionStringUri"u8); + writer.WriteStringValue(ConnectionStringUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + ConnectionUriProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ConnectionUriProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeConnectionUriProperties(document.RootElement, options); + } + + internal static ConnectionUriProperties DeserializeConnectionUriProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string projectId = default; + string branchId = default; + string databaseName = default; + string roleName = default; + string endpointId = default; + bool? isPooled = default; + string connectionStringUri = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("projectId"u8)) + { + projectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("branchId"u8)) + { + branchId = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseName"u8)) + { + databaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("roleName"u8)) + { + roleName = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpointId"u8)) + { + endpointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("isPooled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPooled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("connectionStringUri"u8)) + { + connectionStringUri = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ConnectionUriProperties( + projectId, + branchId, + databaseName, + roleName, + endpointId, + isPooled, + connectionStringUri, + serializedAdditionalRawData); + } + + BinaryData 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(ConnectionUriProperties)} does not support writing '{options.Format}' format."); + } + } + + ConnectionUriProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeConnectionUriProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ConnectionUriProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.cs new file mode 100644 index 000000000000..3de24453b5ac --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ConnectionUriProperties.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.NeonPostgres.Models +{ + /// Connection uri parameters for the associated database. + public partial class ConnectionUriProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ConnectionUriProperties() + { + } + + /// Initializes a new instance of . + /// Project Id associated with this connection. + /// Branch Id associated with this connection. + /// Database name associated with this connection. + /// The role name used for authentication. + /// the endpoint Id with this connection. + /// Indicates if the connection is pooled. + /// connection uri returned for the database. + /// Keeps track of any properties unknown to the library. + internal ConnectionUriProperties(string projectId, string branchId, string databaseName, string roleName, string endpointId, bool? isPooled, string connectionStringUri, IDictionary serializedAdditionalRawData) + { + ProjectId = projectId; + BranchId = branchId; + DatabaseName = databaseName; + RoleName = roleName; + EndpointId = endpointId; + IsPooled = isPooled; + ConnectionStringUri = connectionStringUri; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Project Id associated with this connection. + public string ProjectId { get; set; } + /// Branch Id associated with this connection. + public string BranchId { get; set; } + /// Database name associated with this connection. + public string DatabaseName { get; set; } + /// The role name used for authentication. + public string RoleName { get; set; } + /// the endpoint Id with this connection. + public string EndpointId { get; set; } + /// Indicates if the connection is pooled. + public bool? IsPooled { get; set; } + /// connection uri returned for the database. + public string ConnectionStringUri { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.Serialization.cs new file mode 100644 index 000000000000..8002a758b0a9 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.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.NeonPostgres.Models +{ + public partial class DefaultEndpointSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DefaultEndpointSettings)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("autoscalingLimitMinCu"u8); + writer.WriteNumberValue(AutoscalingLimitMinCu); + writer.WritePropertyName("autoscalingLimitMaxCu"u8); + writer.WriteNumberValue(AutoscalingLimitMaxCu); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + DefaultEndpointSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DefaultEndpointSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDefaultEndpointSettings(document.RootElement, options); + } + + internal static DefaultEndpointSettings DeserializeDefaultEndpointSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + float autoscalingLimitMinCu = default; + float autoscalingLimitMaxCu = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("autoscalingLimitMinCu"u8)) + { + autoscalingLimitMinCu = property.Value.GetSingle(); + continue; + } + if (property.NameEquals("autoscalingLimitMaxCu"u8)) + { + autoscalingLimitMaxCu = property.Value.GetSingle(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DefaultEndpointSettings(autoscalingLimitMinCu, autoscalingLimitMaxCu, serializedAdditionalRawData); + } + + BinaryData 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(DefaultEndpointSettings)} does not support writing '{options.Format}' format."); + } + } + + DefaultEndpointSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDefaultEndpointSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DefaultEndpointSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.cs new file mode 100644 index 000000000000..ea7accff0b69 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/DefaultEndpointSettings.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.NeonPostgres.Models +{ + /// Default Endpoint Settings for the project. + public partial class DefaultEndpointSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Minimum compute units for autoscaling. + /// Maximum compute units for autoscaling. + public DefaultEndpointSettings(float autoscalingLimitMinCu, float autoscalingLimitMaxCu) + { + AutoscalingLimitMinCu = autoscalingLimitMinCu; + AutoscalingLimitMaxCu = autoscalingLimitMaxCu; + } + + /// Initializes a new instance of . + /// Minimum compute units for autoscaling. + /// Maximum compute units for autoscaling. + /// Keeps track of any properties unknown to the library. + internal DefaultEndpointSettings(float autoscalingLimitMinCu, float autoscalingLimitMaxCu, IDictionary serializedAdditionalRawData) + { + AutoscalingLimitMinCu = autoscalingLimitMinCu; + AutoscalingLimitMaxCu = autoscalingLimitMaxCu; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DefaultEndpointSettings() + { + } + + /// Minimum compute units for autoscaling. + public float AutoscalingLimitMinCu { get; set; } + /// Maximum compute units for autoscaling. + public float AutoscalingLimitMaxCu { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.Serialization.cs new file mode 100644 index 000000000000..0ea58d5338da --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.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.NeonPostgres.Models +{ + internal partial class EndpointListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(EndpointListResult)} 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 + } + } + } + + EndpointListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EndpointListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEndpointListResult(document.RootElement, options); + } + + internal static EndpointListResult DeserializeEndpointListResult(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(EndpointData.DeserializeEndpointData(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 EndpointListResult(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(EndpointListResult)} does not support writing '{options.Format}' format."); + } + } + + EndpointListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEndpointListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EndpointListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.cs new file mode 100644 index 000000000000..b8475a400a97 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointListResult.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.NeonPostgres.Models +{ + /// The response of a Endpoint list operation. + internal partial class EndpointListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 Endpoint items on this page. + /// is null. + internal EndpointListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Endpoint items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal EndpointListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EndpointListResult() + { + } + + /// The Endpoint items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointType.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointType.cs new file mode 100644 index 000000000000..eeffb601434b --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/EndpointType.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.NeonPostgres.Models +{ + /// The compute endpoint type. Either read_write or read_only. + public readonly partial struct EndpointType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EndpointType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReadOnlyValue = "read_only"; + private const string ReadWriteValue = "read_write"; + + /// ReadOnly compute endpoint type. + public static EndpointType ReadOnly { get; } = new EndpointType(ReadOnlyValue); + /// ReadWrite compute endpoint type. + public static EndpointType ReadWrite { get; } = new EndpointType(ReadWriteValue); + /// Determines if two values are the same. + public static bool operator ==(EndpointType left, EndpointType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EndpointType left, EndpointType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EndpointType(string value) => new EndpointType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EndpointType other && Equals(other); + /// + public bool Equals(EndpointType 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/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.Serialization.cs new file mode 100644 index 000000000000..2fd2341179e2 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.Serialization.cs @@ -0,0 +1,323 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.NeonPostgres.Models +{ + public partial class NeonBranchProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NeonBranchProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EntityId)) + { + writer.WritePropertyName("entityId"u8); + writer.WriteStringValue(EntityId); + } + if (Optional.IsDefined(EntityName)) + { + writer.WritePropertyName("entityName"u8); + writer.WriteStringValue(EntityName); + } + if (options.Format != "W" && Optional.IsDefined(CreatedAt)) + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attributes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ProjectId)) + { + writer.WritePropertyName("projectId"u8); + writer.WriteStringValue(ProjectId); + } + if (Optional.IsDefined(ParentId)) + { + writer.WritePropertyName("parentId"u8); + writer.WriteStringValue(ParentId); + } + if (Optional.IsDefined(RoleName)) + { + writer.WritePropertyName("roleName"u8); + writer.WriteStringValue(RoleName); + } + if (Optional.IsDefined(DatabaseName)) + { + writer.WritePropertyName("databaseName"u8); + writer.WriteStringValue(DatabaseName); + } + if (Optional.IsCollectionDefined(Roles)) + { + writer.WritePropertyName("roles"u8); + writer.WriteStartArray(); + foreach (var item in Roles) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Databases)) + { + writer.WritePropertyName("databases"u8); + writer.WriteStartArray(); + foreach (var item in Databases) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Endpoints)) + { + writer.WritePropertyName("endpoints"u8); + writer.WriteStartArray(); + foreach (var item in Endpoints) + { + 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 + } + } + } + + NeonBranchProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeonBranchProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonBranchProperties(document.RootElement, options); + } + + internal static NeonBranchProperties DeserializeNeonBranchProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string entityId = default; + string entityName = default; + string createdAt = default; + NeonResourceProvisioningState? provisioningState = default; + IList attributes = default; + string projectId = default; + string parentId = default; + string roleName = default; + string databaseName = default; + IList roles = default; + IList databases = default; + IList endpoints = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entityId"u8)) + { + entityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityName"u8)) + { + entityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NeonResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.Attributes.DeserializeAttributes(item, options)); + } + attributes = array; + continue; + } + if (property.NameEquals("projectId"u8)) + { + projectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("parentId"u8)) + { + parentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("roleName"u8)) + { + roleName = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseName"u8)) + { + databaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("roles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonRoleProperties.DeserializeNeonRoleProperties(item, options)); + } + roles = array; + continue; + } + if (property.NameEquals("databases"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonDatabaseProperties.DeserializeNeonDatabaseProperties(item, options)); + } + databases = array; + continue; + } + if (property.NameEquals("endpoints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonEndpointProperties.DeserializeNeonEndpointProperties(item, options)); + } + endpoints = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonBranchProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes ?? new ChangeTrackingList(), + projectId, + parentId, + roleName, + databaseName, + roles ?? new ChangeTrackingList(), + databases ?? new ChangeTrackingList(), + endpoints ?? 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(NeonBranchProperties)} does not support writing '{options.Format}' format."); + } + } + + NeonBranchProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeonBranchProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonBranchProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.cs new file mode 100644 index 000000000000..f67b0839be88 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonBranchProperties.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// Properties specific to Branch. + public partial class NeonBranchProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NeonBranchProperties() + { + Attributes = new ChangeTrackingList(); + Roles = new ChangeTrackingList(); + Databases = new ChangeTrackingList(); + Endpoints = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the project this branch belongs to. + /// The ID of the parent branch. + /// Role name associated with the branch. + /// Database name associated with the branch. + /// Roles associated with the branch. + /// Neon Databases associated with the branch. + /// Endpoints associated with the branch. + /// Keeps track of any properties unknown to the library. + internal NeonBranchProperties(string entityId, string entityName, string createdAt, NeonResourceProvisioningState? provisioningState, IList attributes, string projectId, string parentId, string roleName, string databaseName, IList roles, IList databases, IList endpoints, IDictionary serializedAdditionalRawData) + { + EntityId = entityId; + EntityName = entityName; + CreatedAt = createdAt; + ProvisioningState = provisioningState; + Attributes = attributes; + ProjectId = projectId; + ParentId = parentId; + RoleName = roleName; + DatabaseName = databaseName; + Roles = roles; + Databases = databases; + Endpoints = endpoints; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique identifier for the entity. + public string EntityId { get; } + /// Name of the resource. + public string EntityName { get; set; } + /// Timestamp indicating when the entity was created. + public string CreatedAt { get; } + /// Provisioning state of the resource. + public NeonResourceProvisioningState? ProvisioningState { get; } + /// Additional attributes for the entity. + public IList Attributes { get; } + /// The ID of the project this branch belongs to. + public string ProjectId { get; set; } + /// The ID of the parent branch. + public string ParentId { get; set; } + /// Role name associated with the branch. + public string RoleName { get; set; } + /// Database name associated with the branch. + public string DatabaseName { get; set; } + /// Roles associated with the branch. + public IList Roles { get; } + /// Neon Databases associated with the branch. + public IList Databases { get; } + /// Endpoints associated with the branch. + public IList Endpoints { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.Serialization.cs new file mode 100644 index 000000000000..5133c78799a9 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.Serialization.cs @@ -0,0 +1,253 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.NeonPostgres.Models +{ + public partial class NeonComputeProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NeonComputeProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EntityId)) + { + writer.WritePropertyName("entityId"u8); + writer.WriteStringValue(EntityId); + } + if (Optional.IsDefined(EntityName)) + { + writer.WritePropertyName("entityName"u8); + writer.WriteStringValue(EntityName); + } + if (options.Format != "W" && Optional.IsDefined(CreatedAt)) + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attributes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Region)) + { + writer.WritePropertyName("region"u8); + writer.WriteStringValue(Region); + } + if (Optional.IsDefined(CpuCores)) + { + writer.WritePropertyName("cpuCores"u8); + writer.WriteNumberValue(CpuCores.Value); + } + if (Optional.IsDefined(Memory)) + { + writer.WritePropertyName("memory"u8); + writer.WriteNumberValue(Memory.Value); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + NeonComputeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeonComputeProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonComputeProperties(document.RootElement, options); + } + + internal static NeonComputeProperties DeserializeNeonComputeProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string entityId = default; + string entityName = default; + string createdAt = default; + NeonResourceProvisioningState? provisioningState = default; + IList attributes = default; + string region = default; + int? cpuCores = default; + int? memory = default; + string status = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entityId"u8)) + { + entityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityName"u8)) + { + entityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NeonResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.Attributes.DeserializeAttributes(item, options)); + } + attributes = array; + continue; + } + if (property.NameEquals("region"u8)) + { + region = property.Value.GetString(); + continue; + } + if (property.NameEquals("cpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + cpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("memory"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + memory = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonComputeProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes ?? new ChangeTrackingList(), + region, + cpuCores, + memory, + status, + serializedAdditionalRawData); + } + + BinaryData 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(NeonComputeProperties)} does not support writing '{options.Format}' format."); + } + } + + NeonComputeProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeonComputeProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonComputeProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.cs new file mode 100644 index 000000000000..f7907771f2d7 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonComputeProperties.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// Properties specific to Compute. + public partial class NeonComputeProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NeonComputeProperties() + { + Attributes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// Region where the compute instance is located. + /// Number of allocated CPU cores. + /// Memory allocated in GB. + /// Current status of the compute instance. + /// Keeps track of any properties unknown to the library. + internal NeonComputeProperties(string entityId, string entityName, string createdAt, NeonResourceProvisioningState? provisioningState, IList attributes, string region, int? cpuCores, int? memory, string status, IDictionary serializedAdditionalRawData) + { + EntityId = entityId; + EntityName = entityName; + CreatedAt = createdAt; + ProvisioningState = provisioningState; + Attributes = attributes; + Region = region; + CpuCores = cpuCores; + Memory = memory; + Status = status; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique identifier for the entity. + public string EntityId { get; } + /// Name of the resource. + public string EntityName { get; set; } + /// Timestamp indicating when the entity was created. + public string CreatedAt { get; } + /// Provisioning state of the resource. + public NeonResourceProvisioningState? ProvisioningState { get; } + /// Additional attributes for the entity. + public IList Attributes { get; } + /// Region where the compute instance is located. + public string Region { get; set; } + /// Number of allocated CPU cores. + public int? CpuCores { get; set; } + /// Memory allocated in GB. + public int? Memory { get; set; } + /// Current status of the compute instance. + public string Status { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.Serialization.cs new file mode 100644 index 000000000000..ad8612b934b4 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.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.NeonPostgres.Models +{ + internal partial class NeonDatabaseListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NeonDatabaseListResult)} 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 + } + } + } + + NeonDatabaseListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeonDatabaseListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonDatabaseListResult(document.RootElement, options); + } + + internal static NeonDatabaseListResult DeserializeNeonDatabaseListResult(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(NeonDatabaseData.DeserializeNeonDatabaseData(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 NeonDatabaseListResult(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(NeonDatabaseListResult)} does not support writing '{options.Format}' format."); + } + } + + NeonDatabaseListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeonDatabaseListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonDatabaseListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.cs new file mode 100644 index 000000000000..40a7670ee975 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseListResult.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.NeonPostgres.Models +{ + /// The response of a NeonDatabase list operation. + internal partial class NeonDatabaseListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NeonDatabase items on this page. + /// is null. + internal NeonDatabaseListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NeonDatabase items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NeonDatabaseListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NeonDatabaseListResult() + { + } + + /// The NeonDatabase items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.Serialization.cs new file mode 100644 index 000000000000..9a9fb45a241e --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.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.NeonPostgres.Models +{ + public partial class NeonDatabaseProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NeonDatabaseProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EntityId)) + { + writer.WritePropertyName("entityId"u8); + writer.WriteStringValue(EntityId); + } + if (Optional.IsDefined(EntityName)) + { + writer.WritePropertyName("entityName"u8); + writer.WriteStringValue(EntityName); + } + if (options.Format != "W" && Optional.IsDefined(CreatedAt)) + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attributes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(BranchId)) + { + writer.WritePropertyName("branchId"u8); + writer.WriteStringValue(BranchId); + } + if (Optional.IsDefined(OwnerName)) + { + writer.WritePropertyName("ownerName"u8); + writer.WriteStringValue(OwnerName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + NeonDatabaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeonDatabaseProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonDatabaseProperties(document.RootElement, options); + } + + internal static NeonDatabaseProperties DeserializeNeonDatabaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string entityId = default; + string entityName = default; + string createdAt = default; + NeonResourceProvisioningState? provisioningState = default; + IList attributes = default; + string branchId = default; + string ownerName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entityId"u8)) + { + entityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityName"u8)) + { + entityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NeonResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.Attributes.DeserializeAttributes(item, options)); + } + attributes = array; + continue; + } + if (property.NameEquals("branchId"u8)) + { + branchId = property.Value.GetString(); + continue; + } + if (property.NameEquals("ownerName"u8)) + { + ownerName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonDatabaseProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes ?? new ChangeTrackingList(), + branchId, + ownerName, + serializedAdditionalRawData); + } + + BinaryData 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(NeonDatabaseProperties)} does not support writing '{options.Format}' format."); + } + } + + NeonDatabaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeonDatabaseProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonDatabaseProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.cs new file mode 100644 index 000000000000..c156854ffa74 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonDatabaseProperties.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// Properties specific to Databases. + public partial class NeonDatabaseProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NeonDatabaseProperties() + { + Attributes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the branch this database belongs to. + /// The name of the role that owns the database. + /// Keeps track of any properties unknown to the library. + internal NeonDatabaseProperties(string entityId, string entityName, string createdAt, NeonResourceProvisioningState? provisioningState, IList attributes, string branchId, string ownerName, IDictionary serializedAdditionalRawData) + { + EntityId = entityId; + EntityName = entityName; + CreatedAt = createdAt; + ProvisioningState = provisioningState; + Attributes = attributes; + BranchId = branchId; + OwnerName = ownerName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique identifier for the entity. + public string EntityId { get; } + /// Name of the resource. + public string EntityName { get; set; } + /// Timestamp indicating when the entity was created. + public string CreatedAt { get; } + /// Provisioning state of the resource. + public NeonResourceProvisioningState? ProvisioningState { get; } + /// Additional attributes for the entity. + public IList Attributes { get; } + /// The ID of the branch this database belongs to. + public string BranchId { get; set; } + /// The name of the role that owns the database. + public string OwnerName { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.Serialization.cs new file mode 100644 index 000000000000..f721bdeedc0a --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.Serialization.cs @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.NeonPostgres.Models +{ + public partial class NeonEndpointProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NeonEndpointProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EntityId)) + { + writer.WritePropertyName("entityId"u8); + writer.WriteStringValue(EntityId); + } + if (Optional.IsDefined(EntityName)) + { + writer.WritePropertyName("entityName"u8); + writer.WriteStringValue(EntityName); + } + if (options.Format != "W" && Optional.IsDefined(CreatedAt)) + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attributes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(ProjectId)) + { + writer.WritePropertyName("projectId"u8); + writer.WriteStringValue(ProjectId); + } + if (Optional.IsDefined(BranchId)) + { + writer.WritePropertyName("branchId"u8); + writer.WriteStringValue(BranchId); + } + if (Optional.IsDefined(EndpointType)) + { + writer.WritePropertyName("endpointType"u8); + writer.WriteStringValue(EndpointType.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 + } + } + } + + NeonEndpointProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeonEndpointProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonEndpointProperties(document.RootElement, options); + } + + internal static NeonEndpointProperties DeserializeNeonEndpointProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string entityId = default; + string entityName = default; + string createdAt = default; + NeonResourceProvisioningState? provisioningState = default; + IList attributes = default; + string projectId = default; + string branchId = default; + EndpointType? endpointType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entityId"u8)) + { + entityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityName"u8)) + { + entityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NeonResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.Attributes.DeserializeAttributes(item, options)); + } + attributes = array; + continue; + } + if (property.NameEquals("projectId"u8)) + { + projectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("branchId"u8)) + { + branchId = property.Value.GetString(); + continue; + } + if (property.NameEquals("endpointType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endpointType = new EndpointType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonEndpointProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes ?? new ChangeTrackingList(), + projectId, + branchId, + endpointType, + serializedAdditionalRawData); + } + + BinaryData 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(NeonEndpointProperties)} does not support writing '{options.Format}' format."); + } + } + + NeonEndpointProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeonEndpointProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonEndpointProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.cs new file mode 100644 index 000000000000..1578ee283939 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonEndpointProperties.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// Properties specific to Endpoints. + public partial class NeonEndpointProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NeonEndpointProperties() + { + Attributes = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the project this endpoint belongs to. + /// The ID of the branch this endpoint belongs to. + /// The type of the endpoint. + /// Keeps track of any properties unknown to the library. + internal NeonEndpointProperties(string entityId, string entityName, string createdAt, NeonResourceProvisioningState? provisioningState, IList attributes, string projectId, string branchId, EndpointType? endpointType, IDictionary serializedAdditionalRawData) + { + EntityId = entityId; + EntityName = entityName; + CreatedAt = createdAt; + ProvisioningState = provisioningState; + Attributes = attributes; + ProjectId = projectId; + BranchId = branchId; + EndpointType = endpointType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique identifier for the entity. + public string EntityId { get; } + /// Name of the resource. + public string EntityName { get; set; } + /// Timestamp indicating when the entity was created. + public string CreatedAt { get; } + /// Provisioning state of the resource. + public NeonResourceProvisioningState? ProvisioningState { get; } + /// Additional attributes for the entity. + public IList Attributes { get; } + /// The ID of the project this endpoint belongs to. + public string ProjectId { get; set; } + /// The ID of the branch this endpoint belongs to. + public string BranchId { get; set; } + /// The type of the endpoint. + public EndpointType? EndpointType { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.Serialization.cs index a4fc8025f83f..5c3faddd851a 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.Serialization.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.Serialization.cs @@ -50,6 +50,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("partnerOrganizationProperties"u8); writer.WriteObjectValue(PartnerOrganizationProperties, options); } + if (Optional.IsDefined(ProjectProperties)) + { + writer.WritePropertyName("projectProperties"u8); + writer.WriteObjectValue(ProjectProperties, options); + } if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -92,6 +97,7 @@ internal static NeonOrganizationProperties DeserializeNeonOrganizationProperties NeonCompanyDetails companyDetails = default; NeonResourceProvisioningState? provisioningState = default; PartnerOrganizationProperties partnerOrganizationProperties = default; + NeonProjectProperties projectProperties = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -129,6 +135,15 @@ internal static NeonOrganizationProperties DeserializeNeonOrganizationProperties partnerOrganizationProperties = PartnerOrganizationProperties.DeserializePartnerOrganizationProperties(property.Value, options); continue; } + if (property.NameEquals("projectProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + projectProperties = NeonProjectProperties.DeserializeNeonProjectProperties(property.Value, options); + continue; + } if (options.Format != "W") { rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); @@ -141,6 +156,7 @@ internal static NeonOrganizationProperties DeserializeNeonOrganizationProperties companyDetails, provisioningState, partnerOrganizationProperties, + projectProperties, serializedAdditionalRawData); } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.cs index 90a25e7a9c58..8ad6a24c39ef 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonOrganizationProperties.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.NeonPostgres.Models { - /// Properties specific to Data Organization resource. + /// Properties specific to Neon Organization resource. public partial class NeonOrganizationProperties { /// @@ -66,15 +66,17 @@ public NeonOrganizationProperties(NeonMarketplaceDetails marketplaceDetails, Neo /// Details of the user. /// Details of the company. /// Provisioning state of the resource. - /// Organization properties. + /// Neon Organization properties. + /// Neon Project Properties. /// Keeps track of any properties unknown to the library. - internal NeonOrganizationProperties(NeonMarketplaceDetails marketplaceDetails, NeonUserDetails userDetails, NeonCompanyDetails companyDetails, NeonResourceProvisioningState? provisioningState, PartnerOrganizationProperties partnerOrganizationProperties, IDictionary serializedAdditionalRawData) + internal NeonOrganizationProperties(NeonMarketplaceDetails marketplaceDetails, NeonUserDetails userDetails, NeonCompanyDetails companyDetails, NeonResourceProvisioningState? provisioningState, PartnerOrganizationProperties partnerOrganizationProperties, NeonProjectProperties projectProperties, IDictionary serializedAdditionalRawData) { MarketplaceDetails = marketplaceDetails; UserDetails = userDetails; CompanyDetails = companyDetails; ProvisioningState = provisioningState; PartnerOrganizationProperties = partnerOrganizationProperties; + ProjectProperties = projectProperties; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -91,7 +93,9 @@ internal NeonOrganizationProperties() public NeonCompanyDetails CompanyDetails { get; set; } /// Provisioning state of the resource. public NeonResourceProvisioningState? ProvisioningState { get; } - /// Organization properties. + /// Neon Organization properties. public PartnerOrganizationProperties PartnerOrganizationProperties { get; set; } + /// Neon Project Properties. + public NeonProjectProperties ProjectProperties { get; set; } } } diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.Serialization.cs new file mode 100644 index 000000000000..b70cb6b729a1 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.Serialization.cs @@ -0,0 +1,367 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.NeonPostgres.Models +{ + public partial class NeonProjectProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NeonProjectProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EntityId)) + { + writer.WritePropertyName("entityId"u8); + writer.WriteStringValue(EntityId); + } + if (Optional.IsDefined(EntityName)) + { + writer.WritePropertyName("entityName"u8); + writer.WriteStringValue(EntityName); + } + if (options.Format != "W" && Optional.IsDefined(CreatedAt)) + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Attribute)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attribute) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RegionId)) + { + writer.WritePropertyName("regionId"u8); + writer.WriteStringValue(RegionId); + } + if (Optional.IsDefined(Storage)) + { + writer.WritePropertyName("storage"u8); + writer.WriteNumberValue(Storage.Value); + } + if (Optional.IsDefined(PostgresVersion)) + { + writer.WritePropertyName("pgVersion"u8); + writer.WriteNumberValue(PostgresVersion.Value); + } + if (Optional.IsDefined(HistoryRetention)) + { + writer.WritePropertyName("historyRetention"u8); + writer.WriteNumberValue(HistoryRetention.Value); + } + if (Optional.IsDefined(DefaultEndpointSettings)) + { + writer.WritePropertyName("defaultEndpointSettings"u8); + writer.WriteObjectValue(DefaultEndpointSettings, options); + } + if (Optional.IsDefined(Branch)) + { + writer.WritePropertyName("branch"u8); + writer.WriteObjectValue(Branch, options); + } + if (Optional.IsCollectionDefined(Roles)) + { + writer.WritePropertyName("roles"u8); + writer.WriteStartArray(); + foreach (var item in Roles) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Databases)) + { + writer.WritePropertyName("databases"u8); + writer.WriteStartArray(); + foreach (var item in Databases) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(Endpoints)) + { + writer.WritePropertyName("endpoints"u8); + writer.WriteStartArray(); + foreach (var item in Endpoints) + { + 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 + } + } + } + + NeonProjectProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeonProjectProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonProjectProperties(document.RootElement, options); + } + + internal static NeonProjectProperties DeserializeNeonProjectProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string entityId = default; + string entityName = default; + string createdAt = default; + NeonResourceProvisioningState? provisioningState = default; + IList attributes = default; + string regionId = default; + long? storage = default; + int? pgVersion = default; + int? historyRetention = default; + DefaultEndpointSettings defaultEndpointSettings = default; + NeonBranchProperties branch = default; + IList roles = default; + IList databases = default; + IList endpoints = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entityId"u8)) + { + entityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityName"u8)) + { + entityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NeonResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Attributes.DeserializeAttributes(item, options)); + } + attributes = array; + continue; + } + if (property.NameEquals("regionId"u8)) + { + regionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storage = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("pgVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pgVersion = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("historyRetention"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + historyRetention = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("defaultEndpointSettings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + defaultEndpointSettings = DefaultEndpointSettings.DeserializeDefaultEndpointSettings(property.Value, options); + continue; + } + if (property.NameEquals("branch"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + branch = NeonBranchProperties.DeserializeNeonBranchProperties(property.Value, options); + continue; + } + if (property.NameEquals("roles"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonRoleProperties.DeserializeNeonRoleProperties(item, options)); + } + roles = array; + continue; + } + if (property.NameEquals("databases"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonDatabaseProperties.DeserializeNeonDatabaseProperties(item, options)); + } + databases = array; + continue; + } + if (property.NameEquals("endpoints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NeonEndpointProperties.DeserializeNeonEndpointProperties(item, options)); + } + endpoints = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonProjectProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes ?? new ChangeTrackingList(), + regionId, + storage, + pgVersion, + historyRetention, + defaultEndpointSettings, + branch, + roles ?? new ChangeTrackingList(), + databases ?? new ChangeTrackingList(), + endpoints ?? 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(NeonProjectProperties)} does not support writing '{options.Format}' format."); + } + } + + NeonProjectProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeonProjectProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonProjectProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.cs new file mode 100644 index 000000000000..b2793a39c170 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonProjectProperties.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + /// Properties specific to Project. + public partial class NeonProjectProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NeonProjectProperties() + { + Attribute = new ChangeTrackingList(); + Roles = new ChangeTrackingList(); + Databases = new ChangeTrackingList(); + Endpoints = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// Region where the project is created. + /// Data Storage bytes per hour for the project. + /// Postgres version for the project. + /// The retention period for project history in seconds. + /// Default endpoint settings for the project. + /// The Branch properties of the project. This is optional. + /// Roles associated with the project. + /// Neon Databases associated with the project. + /// Endpoints associated with the project. + /// Keeps track of any properties unknown to the library. + internal NeonProjectProperties(string entityId, string entityName, string createdAt, NeonResourceProvisioningState? provisioningState, IList attribute, string regionId, long? storage, int? postgresVersion, int? historyRetention, DefaultEndpointSettings defaultEndpointSettings, NeonBranchProperties branch, IList roles, IList databases, IList endpoints, IDictionary serializedAdditionalRawData) + { + EntityId = entityId; + EntityName = entityName; + CreatedAt = createdAt; + ProvisioningState = provisioningState; + Attribute = attribute; + RegionId = regionId; + Storage = storage; + PostgresVersion = postgresVersion; + HistoryRetention = historyRetention; + DefaultEndpointSettings = defaultEndpointSettings; + Branch = branch; + Roles = roles; + Databases = databases; + Endpoints = endpoints; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique identifier for the entity. + public string EntityId { get; } + /// Name of the resource. + public string EntityName { get; set; } + /// Timestamp indicating when the entity was created. + public string CreatedAt { get; } + /// Provisioning state of the resource. + public NeonResourceProvisioningState? ProvisioningState { get; } + /// Additional attributes for the entity. + public IList Attribute { get; } + /// Region where the project is created. + public string RegionId { get; set; } + /// Data Storage bytes per hour for the project. + public long? Storage { get; set; } + /// Postgres version for the project. + public int? PostgresVersion { get; set; } + /// The retention period for project history in seconds. + public int? HistoryRetention { get; set; } + /// Default endpoint settings for the project. + public DefaultEndpointSettings DefaultEndpointSettings { get; set; } + /// The Branch properties of the project. This is optional. + public NeonBranchProperties Branch { get; set; } + /// Roles associated with the project. + public IList Roles { get; } + /// Neon Databases associated with the project. + public IList Databases { get; } + /// Endpoints associated with the project. + public IList Endpoints { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.Serialization.cs new file mode 100644 index 000000000000..17a286c67479 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.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.NeonPostgres.Models +{ + internal partial class NeonRoleListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NeonRoleListResult)} 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 + } + } + } + + NeonRoleListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeonRoleListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonRoleListResult(document.RootElement, options); + } + + internal static NeonRoleListResult DeserializeNeonRoleListResult(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(NeonRoleData.DeserializeNeonRoleData(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 NeonRoleListResult(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(NeonRoleListResult)} does not support writing '{options.Format}' format."); + } + } + + NeonRoleListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeonRoleListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonRoleListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.cs new file mode 100644 index 000000000000..b4130ba1b902 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleListResult.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.NeonPostgres.Models +{ + /// The response of a NeonRole list operation. + internal partial class NeonRoleListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NeonRole items on this page. + /// is null. + internal NeonRoleListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The NeonRole items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal NeonRoleListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal NeonRoleListResult() + { + } + + /// The NeonRole items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.Serialization.cs new file mode 100644 index 000000000000..8931ed3bdb1d --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.Serialization.cs @@ -0,0 +1,251 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.NeonPostgres.Models +{ + public partial class NeonRoleProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NeonRoleProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(EntityId)) + { + writer.WritePropertyName("entityId"u8); + writer.WriteStringValue(EntityId); + } + if (Optional.IsDefined(EntityName)) + { + writer.WritePropertyName("entityName"u8); + writer.WriteStringValue(EntityName); + } + if (options.Format != "W" && Optional.IsDefined(CreatedAt)) + { + writer.WritePropertyName("createdAt"u8); + writer.WriteStringValue(CreatedAt); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsCollectionDefined(Attributes)) + { + writer.WritePropertyName("attributes"u8); + writer.WriteStartArray(); + foreach (var item in Attributes) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(BranchId)) + { + writer.WritePropertyName("branchId"u8); + writer.WriteStringValue(BranchId); + } + if (Optional.IsCollectionDefined(Permissions)) + { + writer.WritePropertyName("permissions"u8); + writer.WriteStartArray(); + foreach (var item in Permissions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(IsSuperUser)) + { + writer.WritePropertyName("isSuperUser"u8); + writer.WriteBooleanValue(IsSuperUser.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 + } + } + } + + NeonRoleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeonRoleProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonRoleProperties(document.RootElement, options); + } + + internal static NeonRoleProperties DeserializeNeonRoleProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string entityId = default; + string entityName = default; + string createdAt = default; + NeonResourceProvisioningState? provisioningState = default; + IList attributes = default; + string branchId = default; + IList permissions = default; + bool? isSuperUser = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("entityId"u8)) + { + entityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("entityName"u8)) + { + entityName = property.Value.GetString(); + continue; + } + if (property.NameEquals("createdAt"u8)) + { + createdAt = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new NeonResourceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("attributes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.Attributes.DeserializeAttributes(item, options)); + } + attributes = array; + continue; + } + if (property.NameEquals("branchId"u8)) + { + branchId = property.Value.GetString(); + continue; + } + if (property.NameEquals("permissions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + permissions = array; + continue; + } + if (property.NameEquals("isSuperUser"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSuperUser = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NeonRoleProperties( + entityId, + entityName, + createdAt, + provisioningState, + attributes ?? new ChangeTrackingList(), + branchId, + permissions ?? new ChangeTrackingList(), + isSuperUser, + serializedAdditionalRawData); + } + + BinaryData 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(NeonRoleProperties)} does not support writing '{options.Format}' format."); + } + } + + NeonRoleProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeonRoleProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonRoleProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.cs new file mode 100644 index 000000000000..d19464e943da --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/NeonRoleProperties.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.NeonPostgres.Models +{ + /// Properties specific to Roles. + public partial class NeonRoleProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NeonRoleProperties() + { + Attributes = new ChangeTrackingList(); + Permissions = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Unique identifier for the entity. + /// Name of the resource. + /// Timestamp indicating when the entity was created. + /// Provisioning state of the resource. + /// Additional attributes for the entity. + /// The ID of the branch this role belongs to. + /// Permissions assigned to the role. + /// Indicates whether the role has superuser privileges. + /// Keeps track of any properties unknown to the library. + internal NeonRoleProperties(string entityId, string entityName, string createdAt, NeonResourceProvisioningState? provisioningState, IList attributes, string branchId, IList permissions, bool? isSuperUser, IDictionary serializedAdditionalRawData) + { + EntityId = entityId; + EntityName = entityName; + CreatedAt = createdAt; + ProvisioningState = provisioningState; + Attributes = attributes; + BranchId = branchId; + Permissions = permissions; + IsSuperUser = isSuperUser; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Unique identifier for the entity. + public string EntityId { get; } + /// Name of the resource. + public string EntityName { get; set; } + /// Timestamp indicating when the entity was created. + public string CreatedAt { get; } + /// Provisioning state of the resource. + public NeonResourceProvisioningState? ProvisioningState { get; } + /// Additional attributes for the entity. + public IList Attributes { get; } + /// The ID of the branch this role belongs to. + public string BranchId { get; set; } + /// Permissions assigned to the role. + public IList Permissions { get; } + /// Indicates whether the role has superuser privileges. + public bool? IsSuperUser { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.Serialization.cs new file mode 100644 index 000000000000..4e7d3b310594 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.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.NeonPostgres.Models +{ + public partial class PgVersion : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(PgVersion)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteNumberValue(Version.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 + } + } + } + + PgVersion IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PgVersion)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePgVersion(document.RootElement, options); + } + + internal static PgVersion DeserializePgVersion(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int? version = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("version"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + version = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PgVersion(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(PgVersion)} does not support writing '{options.Format}' format."); + } + } + + PgVersion IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePgVersion(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PgVersion)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.cs new file mode 100644 index 000000000000..ece8eba8f59e --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersion.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.NeonPostgres.Models +{ + /// PostgreSQL Version model. + public partial class PgVersion + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 PgVersion() + { + } + + /// Initializes a new instance of . + /// The major PostgreSQL version number. + /// Keeps track of any properties unknown to the library. + internal PgVersion(int? version, IDictionary serializedAdditionalRawData) + { + Version = version; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The major PostgreSQL version number. + public int? Version { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.Serialization.cs new file mode 100644 index 000000000000..800c3245dc86 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.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.NeonPostgres.Models +{ + public partial class PgVersionsResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(PgVersionsResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("versions"u8); + writer.WriteStartArray(); + foreach (var item in Versions) + { + 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 + } + } + } + + PgVersionsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PgVersionsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePgVersionsResult(document.RootElement, options); + } + + internal static PgVersionsResult DeserializePgVersionsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList versions = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("versions"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(PgVersion.DeserializePgVersion(item, options)); + } + versions = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PgVersionsResult(versions, serializedAdditionalRawData); + } + + BinaryData 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(PgVersionsResult)} does not support writing '{options.Format}' format."); + } + } + + PgVersionsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePgVersionsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PgVersionsResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.cs new file mode 100644 index 000000000000..deea19e022be --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/PgVersionsResult.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.NeonPostgres.Models +{ + /// Response model for PostgreSQL versions. + public partial class PgVersionsResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// List of PostgreSQL versions. + /// is null. + internal PgVersionsResult(IEnumerable versions) + { + Argument.AssertNotNull(versions, nameof(versions)); + + Versions = versions.ToList(); + } + + /// Initializes a new instance of . + /// List of PostgreSQL versions. + /// Keeps track of any properties unknown to the library. + internal PgVersionsResult(IReadOnlyList versions, IDictionary serializedAdditionalRawData) + { + Versions = versions; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PgVersionsResult() + { + } + + /// List of PostgreSQL versions. + public IReadOnlyList Versions { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.Serialization.cs new file mode 100644 index 000000000000..05ee8440c730 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.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.NeonPostgres.Models +{ + internal partial class ProjectListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ProjectListResult)} 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 + } + } + } + + ProjectListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectListResult(document.RootElement, options); + } + + internal static ProjectListResult DeserializeProjectListResult(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(ProjectData.DeserializeProjectData(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 ProjectListResult(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(ProjectListResult)} does not support writing '{options.Format}' format."); + } + } + + ProjectListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProjectListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.cs new file mode 100644 index 000000000000..939c66f610d1 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/Models/ProjectListResult.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.NeonPostgres.Models +{ + /// The response of a Project list operation. + internal partial class ProjectListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 Project items on this page. + /// is null. + internal ProjectListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The Project items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ProjectListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProjectListResult() + { + } + + /// The Project items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseCollection.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseCollection.cs new file mode 100644 index 000000000000..6c6e5bb61efa --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseCollection.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.NeonPostgres +{ + /// + /// 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 GetNeonDatabases method from an instance of . + /// + public partial class NeonDatabaseCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _neonDatabaseClientDiagnostics; + private readonly NeonDatabasesRestOperations _neonDatabaseRestClient; + + /// Initializes a new instance of the class for mocking. + protected NeonDatabaseCollection() + { + } + + /// 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 NeonDatabaseCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _neonDatabaseClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", NeonDatabaseResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NeonDatabaseResource.ResourceType, out string neonDatabaseApiVersion); + _neonDatabaseRestClient = new NeonDatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, neonDatabaseApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != BranchResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BranchResource.ResourceType), nameof(id)); + } + + /// + /// Create a NeonDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_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 NeonDatabase. + /// 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 neonDatabaseName, NeonDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _neonDatabaseRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonDatabaseName, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new NeonDatabaseOperationSource(Client), _neonDatabaseClientDiagnostics, Pipeline, _neonDatabaseRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonDatabaseName, 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 NeonDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_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 NeonDatabase. + /// 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 neonDatabaseName, NeonDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _neonDatabaseRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonDatabaseName, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new NeonDatabaseOperationSource(Client), _neonDatabaseClientDiagnostics, Pipeline, _neonDatabaseRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonDatabaseName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a NeonDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonDatabase. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string neonDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + + using var scope = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseCollection.Get"); + scope.Start(); + try + { + var response = await _neonDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonDatabaseName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NeonDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a NeonDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonDatabase. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string neonDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + + using var scope = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseCollection.Get"); + scope.Start(); + try + { + var response = _neonDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonDatabaseName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NeonDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List NeonDatabase resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases + /// + /// + /// Operation Id + /// NeonDatabase_List + /// + /// + /// 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) => _neonDatabaseRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _neonDatabaseRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NeonDatabaseResource(Client, NeonDatabaseData.DeserializeNeonDatabaseData(e)), _neonDatabaseClientDiagnostics, Pipeline, "NeonDatabaseCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List NeonDatabase resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases + /// + /// + /// Operation Id + /// NeonDatabase_List + /// + /// + /// 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) => _neonDatabaseRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _neonDatabaseRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NeonDatabaseResource(Client, NeonDatabaseData.DeserializeNeonDatabaseData(e)), _neonDatabaseClientDiagnostics, Pipeline, "NeonDatabaseCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonDatabase. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string neonDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + + using var scope = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseCollection.Exists"); + scope.Start(); + try + { + var response = await _neonDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonDatabaseName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonDatabase. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string neonDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + + using var scope = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseCollection.Exists"); + scope.Start(); + try + { + var response = _neonDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonDatabaseName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonDatabase. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string neonDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + + using var scope = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _neonDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonDatabaseName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NeonDatabaseResource(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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonDatabase. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string neonDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + + using var scope = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseCollection.GetIfExists"); + scope.Start(); + try + { + var response = _neonDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonDatabaseName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NeonDatabaseResource(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/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseData.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseData.Serialization.cs new file mode 100644 index 000000000000..64dcdf487f97 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseData.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + public partial class NeonDatabaseData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NeonDatabaseData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + NeonDatabaseData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeonDatabaseData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonDatabaseData(document.RootElement, options); + } + + internal static NeonDatabaseData DeserializeNeonDatabaseData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NeonDatabaseProperties 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 = NeonDatabaseProperties.DeserializeNeonDatabaseProperties(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 NeonDatabaseData( + 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(NeonDatabaseData)} does not support writing '{options.Format}' format."); + } + } + + NeonDatabaseData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeonDatabaseData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonDatabaseData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseData.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseData.cs new file mode 100644 index 000000000000..5ea8c17cbac3 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseData.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + /// + /// A class representing the NeonDatabase data model. + /// The Neon Database resource type. + /// + public partial class NeonDatabaseData : 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 NeonDatabaseData() + { + } + + /// 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 NeonDatabaseData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NeonDatabaseProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public NeonDatabaseProperties Properties { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseResource.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseResource.Serialization.cs new file mode 100644 index 000000000000..0defd6d6acc4 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseResource.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.NeonPostgres +{ + public partial class NeonDatabaseResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NeonDatabaseData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + NeonDatabaseData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseResource.cs new file mode 100644 index 000000000000..54b31f98c454 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonDatabaseResource.cs @@ -0,0 +1,353 @@ +// 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.NeonPostgres +{ + /// + /// A Class representing a NeonDatabase 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 GetNeonDatabaseResource method. + /// Otherwise you can get one from its parent resource using the GetNeonDatabase method. + /// + public partial class NeonDatabaseResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The organizationName. + /// The projectName. + /// The branchName. + /// The neonDatabaseName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonDatabaseName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _neonDatabaseClientDiagnostics; + private readonly NeonDatabasesRestOperations _neonDatabaseRestClient; + private readonly NeonDatabaseData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Neon.Postgres/organizations/projects/branches/neonDatabases"; + + /// Initializes a new instance of the class for mocking. + protected NeonDatabaseResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal NeonDatabaseResource(ArmClient client, NeonDatabaseData 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 NeonDatabaseResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _neonDatabaseClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string neonDatabaseApiVersion); + _neonDatabaseRestClient = new NeonDatabasesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, neonDatabaseApiVersion); +#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 NeonDatabaseData 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 NeonDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseResource.Get"); + scope.Start(); + try + { + var response = await _neonDatabaseRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NeonDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a NeonDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseResource.Get"); + scope.Start(); + try + { + var response = _neonDatabaseRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NeonDatabaseResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a NeonDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_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 = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseResource.Delete"); + scope.Start(); + try + { + var response = await _neonDatabaseRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _neonDatabaseRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a NeonDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_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 = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseResource.Delete"); + scope.Start(); + try + { + var response = _neonDatabaseRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _neonDatabaseRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a NeonDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_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, NeonDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseResource.Update"); + scope.Start(); + try + { + var response = await _neonDatabaseRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new NeonDatabaseOperationSource(Client), _neonDatabaseClientDiagnostics, Pipeline, _neonDatabaseRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a NeonDatabase + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonDatabases/{neonDatabaseName} + /// + /// + /// Operation Id + /// NeonDatabase_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, NeonDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonDatabaseClientDiagnostics.CreateScope("NeonDatabaseResource.Update"); + scope.Start(); + try + { + var response = _neonDatabaseRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new NeonDatabaseOperationSource(Client), _neonDatabaseClientDiagnostics, Pipeline, _neonDatabaseRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationCollection.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationCollection.cs index 29184c380db9..c4259daa0a47 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationCollection.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationCollection.cs @@ -65,7 +65,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -114,7 +114,7 @@ public virtual async Task> CreateOrUpdate /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -163,7 +163,7 @@ public virtual ArmOperation CreateOrUpdate(WaitUntil w /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -208,7 +208,7 @@ public virtual async Task> GetAsync(string or /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -253,7 +253,7 @@ public virtual Response Get(string organizationName, C /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -283,7 +283,7 @@ public virtual AsyncPageable GetAllAsync(CancellationT /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -313,7 +313,7 @@ public virtual Pageable GetAll(CancellationToken cance /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -356,7 +356,7 @@ public virtual async Task> ExistsAsync(string organizationName, C /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -399,7 +399,7 @@ public virtual Response Exists(string organizationName, CancellationToken /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -444,7 +444,7 @@ public virtual async Task> GetIfExist /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationResource.cs index ac4517a26e4a..e1cc6035b1fc 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationResource.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonOrganizationResource.cs @@ -89,6 +89,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 ProjectResources in the NeonOrganization. + /// An object representing collection of ProjectResources and their operations over a ProjectResource. + public virtual ProjectCollection GetProjects() + { + return GetCachedClient(client => new ProjectCollection(client, Id)); + } + + /// + /// Get a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetProjectAsync(string projectName, CancellationToken cancellationToken = default) + { + return await GetProjects().GetAsync(projectName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetProject(string projectName, CancellationToken cancellationToken = default) + { + return GetProjects().Get(projectName, cancellationToken); + } + /// /// Get a OrganizationResource /// @@ -102,7 +171,7 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -142,7 +211,7 @@ public virtual async Task> GetAsync(Cancellat /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -182,7 +251,7 @@ public virtual Response Get(CancellationToken cancella /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -224,7 +293,7 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -266,7 +335,7 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -312,7 +381,7 @@ public virtual async Task> UpdateAsync(Wa /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -358,7 +427,7 @@ public virtual ArmOperation Update(WaitUntil waitUntil /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -420,7 +489,7 @@ public virtual async Task> AddTagAsync(string /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -482,7 +551,7 @@ public virtual Response AddTag(string key, string valu /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -539,7 +608,7 @@ public virtual async Task> SetTagsAsync(IDict /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -596,7 +665,7 @@ public virtual Response SetTags(IDictionary /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource @@ -656,7 +725,7 @@ public virtual async Task> RemoveTagAsync(str /// /// /// Default Api Version - /// 2024-08-01-preview + /// 2025-03-01 /// /// /// Resource diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleCollection.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleCollection.cs new file mode 100644 index 000000000000..cbf7b17cca45 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleCollection.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.NeonPostgres +{ + /// + /// 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 GetNeonRoles method from an instance of . + /// + public partial class NeonRoleCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _neonRoleClientDiagnostics; + private readonly NeonRolesRestOperations _neonRoleRestClient; + + /// Initializes a new instance of the class for mocking. + protected NeonRoleCollection() + { + } + + /// 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 NeonRoleCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _neonRoleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", NeonRoleResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(NeonRoleResource.ResourceType, out string neonRoleApiVersion); + _neonRoleRestClient = new NeonRolesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, neonRoleApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != BranchResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, BranchResource.ResourceType), nameof(id)); + } + + /// + /// Create a NeonRole + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_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 NeonRole. + /// 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 neonRoleName, NeonRoleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonRoleClientDiagnostics.CreateScope("NeonRoleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _neonRoleRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonRoleName, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new NeonRoleOperationSource(Client), _neonRoleClientDiagnostics, Pipeline, _neonRoleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonRoleName, 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 NeonRole + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_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 NeonRole. + /// 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 neonRoleName, NeonRoleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonRoleClientDiagnostics.CreateScope("NeonRoleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _neonRoleRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonRoleName, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new NeonRoleOperationSource(Client), _neonRoleClientDiagnostics, Pipeline, _neonRoleRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonRoleName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a NeonRole + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonRole. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string neonRoleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + + using var scope = _neonRoleClientDiagnostics.CreateScope("NeonRoleCollection.Get"); + scope.Start(); + try + { + var response = await _neonRoleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonRoleName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NeonRoleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a NeonRole + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonRole. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string neonRoleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + + using var scope = _neonRoleClientDiagnostics.CreateScope("NeonRoleCollection.Get"); + scope.Start(); + try + { + var response = _neonRoleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonRoleName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NeonRoleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List NeonRole resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles + /// + /// + /// Operation Id + /// NeonRole_List + /// + /// + /// 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) => _neonRoleRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _neonRoleRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new NeonRoleResource(Client, NeonRoleData.DeserializeNeonRoleData(e)), _neonRoleClientDiagnostics, Pipeline, "NeonRoleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List NeonRole resources by Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles + /// + /// + /// Operation Id + /// NeonRole_List + /// + /// + /// 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) => _neonRoleRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _neonRoleRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new NeonRoleResource(Client, NeonRoleData.DeserializeNeonRoleData(e)), _neonRoleClientDiagnostics, Pipeline, "NeonRoleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonRole. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string neonRoleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + + using var scope = _neonRoleClientDiagnostics.CreateScope("NeonRoleCollection.Exists"); + scope.Start(); + try + { + var response = await _neonRoleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonRoleName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonRole. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string neonRoleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + + using var scope = _neonRoleClientDiagnostics.CreateScope("NeonRoleCollection.Exists"); + scope.Start(); + try + { + var response = _neonRoleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonRoleName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonRole. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string neonRoleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + + using var scope = _neonRoleClientDiagnostics.CreateScope("NeonRoleCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _neonRoleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonRoleName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NeonRoleResource(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/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the NeonRole. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string neonRoleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + + using var scope = _neonRoleClientDiagnostics.CreateScope("NeonRoleCollection.GetIfExists"); + scope.Start(); + try + { + var response = _neonRoleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, neonRoleName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new NeonRoleResource(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/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleData.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleData.Serialization.cs new file mode 100644 index 000000000000..2e7407d61ac3 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleData.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + public partial class NeonRoleData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NeonRoleData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + NeonRoleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NeonRoleData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNeonRoleData(document.RootElement, options); + } + + internal static NeonRoleData DeserializeNeonRoleData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NeonRoleProperties 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 = NeonRoleProperties.DeserializeNeonRoleProperties(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 NeonRoleData( + 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(NeonRoleData)} does not support writing '{options.Format}' format."); + } + } + + NeonRoleData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNeonRoleData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NeonRoleData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleData.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleData.cs new file mode 100644 index 000000000000..f40f18133a1d --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleData.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + /// + /// A class representing the NeonRole data model. + /// The Neon Role resource type. + /// + public partial class NeonRoleData : 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 NeonRoleData() + { + } + + /// 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 NeonRoleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NeonRoleProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public NeonRoleProperties Properties { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleResource.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleResource.Serialization.cs new file mode 100644 index 000000000000..13c6c17c0a84 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleResource.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.NeonPostgres +{ + public partial class NeonRoleResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + NeonRoleData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + NeonRoleData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleResource.cs new file mode 100644 index 000000000000..c61b903a5ef7 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/NeonRoleResource.cs @@ -0,0 +1,353 @@ +// 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.NeonPostgres +{ + /// + /// A Class representing a NeonRole 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 GetNeonRoleResource method. + /// Otherwise you can get one from its parent resource using the GetNeonRole method. + /// + public partial class NeonRoleResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The organizationName. + /// The projectName. + /// The branchName. + /// The neonRoleName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonRoleName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _neonRoleClientDiagnostics; + private readonly NeonRolesRestOperations _neonRoleRestClient; + private readonly NeonRoleData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Neon.Postgres/organizations/projects/branches/neonRoles"; + + /// Initializes a new instance of the class for mocking. + protected NeonRoleResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal NeonRoleResource(ArmClient client, NeonRoleData 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 NeonRoleResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _neonRoleClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string neonRoleApiVersion); + _neonRoleRestClient = new NeonRolesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, neonRoleApiVersion); +#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 NeonRoleData 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 NeonRole + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _neonRoleClientDiagnostics.CreateScope("NeonRoleResource.Get"); + scope.Start(); + try + { + var response = await _neonRoleRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NeonRoleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a NeonRole + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _neonRoleClientDiagnostics.CreateScope("NeonRoleResource.Get"); + scope.Start(); + try + { + var response = _neonRoleRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new NeonRoleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a NeonRole + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_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 = _neonRoleClientDiagnostics.CreateScope("NeonRoleResource.Delete"); + scope.Start(); + try + { + var response = await _neonRoleRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _neonRoleRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a NeonRole + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_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 = _neonRoleClientDiagnostics.CreateScope("NeonRoleResource.Delete"); + scope.Start(); + try + { + var response = _neonRoleRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _neonRoleRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a NeonRole + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_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, NeonRoleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonRoleClientDiagnostics.CreateScope("NeonRoleResource.Update"); + scope.Start(); + try + { + var response = await _neonRoleRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new NeonRoleOperationSource(Client), _neonRoleClientDiagnostics, Pipeline, _neonRoleRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a NeonRole + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName}/neonRoles/{neonRoleName} + /// + /// + /// Operation Id + /// NeonRole_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, NeonRoleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _neonRoleClientDiagnostics.CreateScope("NeonRoleResource.Update"); + scope.Start(); + try + { + var response = _neonRoleRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new NeonRoleOperationSource(Client), _neonRoleClientDiagnostics, Pipeline, _neonRoleRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectCollection.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectCollection.cs new file mode 100644 index 000000000000..638454ab0ed7 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectCollection.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.NeonPostgres +{ + /// + /// 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 GetProjects method from an instance of . + /// + public partial class ProjectCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _projectClientDiagnostics; + private readonly ProjectsRestOperations _projectRestClient; + + /// Initializes a new instance of the class for mocking. + protected ProjectCollection() + { + } + + /// 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 ProjectCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _projectClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ProjectResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ProjectResource.ResourceType, out string projectApiVersion); + _projectRestClient = new ProjectsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, projectApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != NeonOrganizationResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, NeonOrganizationResource.ResourceType), nameof(id)); + } + + /// + /// Create a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_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 Project. + /// 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 projectName, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _projectRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new ProjectOperationSource(Client), _projectClientDiagnostics, Pipeline, _projectRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, 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 Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_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 Project. + /// 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 projectName, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _projectRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new ProjectOperationSource(Client), _projectClientDiagnostics, Pipeline, _projectRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.Get"); + scope.Start(); + try + { + var response = await _projectRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.Get"); + scope.Start(); + try + { + var response = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List Project resources by OrganizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects + /// + /// + /// Operation Id + /// Project_List + /// + /// + /// 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) => _projectRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _projectRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ProjectResource(Client, ProjectData.DeserializeProjectData(e)), _projectClientDiagnostics, Pipeline, "ProjectCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List Project resources by OrganizationResource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects + /// + /// + /// Operation Id + /// Project_List + /// + /// + /// 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) => _projectRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _projectRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ProjectResource(Client, ProjectData.DeserializeProjectData(e)), _projectClientDiagnostics, Pipeline, "ProjectCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.Exists"); + scope.Start(); + try + { + var response = await _projectRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.Exists"); + scope.Start(); + try + { + var response = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, 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/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _projectRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(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/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Project. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectCollection.GetIfExists"); + scope.Start(); + try + { + var response = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, projectName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(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/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectData.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectData.Serialization.cs new file mode 100644 index 000000000000..cd30b13a6d2b --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectData.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + public partial class ProjectData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ProjectData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + ProjectData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProjectData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProjectData(document.RootElement, options); + } + + internal static ProjectData DeserializeProjectData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NeonProjectProperties 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 = NeonProjectProperties.DeserializeNeonProjectProperties(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 ProjectData( + 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(ProjectData)} does not support writing '{options.Format}' format."); + } + } + + ProjectData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProjectData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProjectData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectData.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectData.cs new file mode 100644 index 000000000000..4f00d3579d1e --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectData.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + /// + /// A class representing the Project data model. + /// The Project resource type. + /// + public partial class ProjectData : 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 ProjectData() + { + } + + /// 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 ProjectData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NeonProjectProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public NeonProjectProperties Properties { get; set; } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectResource.Serialization.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectResource.Serialization.cs new file mode 100644 index 000000000000..4e45bb94f0ef --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectResource.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.NeonPostgres +{ + public partial class ProjectResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + ProjectData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + ProjectData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectResource.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectResource.cs new file mode 100644 index 000000000000..6c0f6085231d --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/ProjectResource.cs @@ -0,0 +1,505 @@ +// 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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + /// + /// A Class representing a Project 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 GetProjectResource method. + /// Otherwise you can get one from its parent resource using the GetProject method. + /// + public partial class ProjectResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The organizationName. + /// The projectName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _projectClientDiagnostics; + private readonly ProjectsRestOperations _projectRestClient; + private readonly ProjectData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Neon.Postgres/organizations/projects"; + + /// Initializes a new instance of the class for mocking. + protected ProjectResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal ProjectResource(ArmClient client, ProjectData 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 ProjectResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _projectClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.NeonPostgres", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string projectApiVersion); + _projectRestClient = new ProjectsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, projectApiVersion); +#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 ProjectData 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 BranchResources in the Project. + /// An object representing collection of BranchResources and their operations over a BranchResource. + public virtual BranchCollection GetBranches() + { + return GetCachedClient(client => new BranchCollection(client, Id)); + } + + /// + /// Get a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetBranchAsync(string branchName, CancellationToken cancellationToken = default) + { + return await GetBranches().GetAsync(branchName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a Branch + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/branches/{branchName} + /// + /// + /// Operation Id + /// Branch_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Branch. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetBranch(string branchName, CancellationToken cancellationToken = default) + { + return GetBranches().Get(branchName, cancellationToken); + } + + /// + /// Get a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.Get"); + scope.Start(); + try + { + var response = await _projectRestClient.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 ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_Get + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.Get"); + scope.Start(); + try + { + var response = _projectRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new ProjectResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_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 = _projectClientDiagnostics.CreateScope("ProjectResource.Delete"); + scope.Start(); + try + { + var response = await _projectRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var uri = _projectRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Delete a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_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 = _projectClientDiagnostics.CreateScope("ProjectResource.Delete"); + scope.Start(); + try + { + var response = _projectRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var uri = _projectRestClient.CreateDeleteRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Delete, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new NeonPostgresArmOperation(response, rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Update a Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_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, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.Update"); + scope.Start(); + try + { + var response = await _projectRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new NeonPostgresArmOperation(new ProjectOperationSource(Client), _projectClientDiagnostics, Pipeline, _projectRestClient.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 Project + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName} + /// + /// + /// Operation Id + /// Project_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, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.Update"); + scope.Start(); + try + { + var response = _projectRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new NeonPostgresArmOperation(new ProjectOperationSource(Client), _projectClientDiagnostics, Pipeline, _projectRestClient.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; + } + } + + /// + /// Action to retrieve the connection URI for the Neon Database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/getConnectionUri + /// + /// + /// Operation Id + /// Projects_GetConnectionUri + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Additional parameters for retrieving the database connection URI. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetConnectionUriAsync(ConnectionUriProperties connectionUriParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(connectionUriParameters, nameof(connectionUriParameters)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.GetConnectionUri"); + scope.Start(); + try + { + var response = await _projectRestClient.GetConnectionUriAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionUriParameters, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Action to retrieve the connection URI for the Neon Database. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Neon.Postgres/organizations/{organizationName}/projects/{projectName}/getConnectionUri + /// + /// + /// Operation Id + /// Projects_GetConnectionUri + /// + /// + /// Default Api Version + /// 2025-03-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Additional parameters for retrieving the database connection URI. + /// The cancellation token to use. + /// is null. + public virtual Response GetConnectionUri(ConnectionUriProperties connectionUriParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(connectionUriParameters, nameof(connectionUriParameters)); + + using var scope = _projectClientDiagnostics.CreateScope("ProjectResource.GetConnectionUri"); + scope.Start(); + try + { + var response = _projectRestClient.GetConnectionUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, connectionUriParameters, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/BranchesRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/BranchesRestOperations.cs new file mode 100644 index 000000000000..8137b0dd41c9 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/BranchesRestOperations.cs @@ -0,0 +1,657 @@ +// 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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + internal partial class BranchesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of BranchesRestOperations. + /// 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 BranchesRestOperations(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 organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BranchData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BranchData.DeserializeBranchData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BranchData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BranchData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BranchData.DeserializeBranchData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((BranchData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, BranchData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, BranchData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, 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 Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, BranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, 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 Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, BranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, 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 organizationName, string projectName, string branchName, BranchData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, BranchData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, 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 Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, BranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, 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 Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, BranchData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, data); + _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 organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// 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 organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Branch resources by Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BranchListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BranchListResult.DeserializeBranchListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Branch resources by Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BranchListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BranchListResult.DeserializeBranchListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + 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 Branch resources by Project. + /// 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. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + BranchListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = BranchListResult.DeserializeBranchListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Branch resources by Project. + /// 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. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + BranchListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = BranchListResult.DeserializeBranchListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ComputesRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ComputesRestOperations.cs new file mode 100644 index 000000000000..9eb97c7a32e8 --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ComputesRestOperations.cs @@ -0,0 +1,701 @@ +// 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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + internal partial class ComputesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ComputesRestOperations. + /// 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 ComputesRestOperations(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 organizationName, string projectName, string branchName, string computeName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string computeName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Compute. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Compute. + /// 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 organizationName, string projectName, string branchName, string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, computeName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ComputeData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ComputeData.DeserializeComputeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ComputeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Compute. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Compute. + /// 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 organizationName, string projectName, string branchName, string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, computeName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ComputeData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ComputeData.DeserializeComputeData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ComputeData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string computeName, ComputeData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string computeName, ComputeData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, 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 Compute. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Compute. + /// 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 organizationName, string projectName, string branchName, string computeName, ComputeData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, computeName, 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 Compute. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Compute. + /// 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 organizationName, string projectName, string branchName, string computeName, ComputeData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, computeName, 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 organizationName, string projectName, string branchName, string computeName, ComputeData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string computeName, ComputeData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, 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 Compute. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Compute. + /// 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 organizationName, string projectName, string branchName, string computeName, ComputeData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, computeName, 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 Compute. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Compute. + /// 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 organizationName, string projectName, string branchName, string computeName, ComputeData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, computeName, data); + _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 organizationName, string projectName, string branchName, string computeName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string computeName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/computes/", false); + uri.AppendPath(computeName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Compute. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Compute. + /// 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 organizationName, string projectName, string branchName, string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, computeName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Compute. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Compute. + /// 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 organizationName, string projectName, string branchName, string computeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(computeName, nameof(computeName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, computeName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/computes", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/computes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Compute resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ComputeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ComputeListResult.DeserializeComputeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Compute resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ComputeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ComputeListResult.DeserializeComputeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + 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 Compute resources by Branch. + /// 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. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ComputeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ComputeListResult.DeserializeComputeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Compute resources by Branch. + /// 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. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ComputeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ComputeListResult.DeserializeComputeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/EndpointsRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/EndpointsRestOperations.cs new file mode 100644 index 000000000000..fd46a6bfa0aa --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/EndpointsRestOperations.cs @@ -0,0 +1,701 @@ +// 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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + internal partial class EndpointsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EndpointsRestOperations. + /// 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 EndpointsRestOperations(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 organizationName, string projectName, string branchName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string endpointName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Endpoint. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Endpoint. + /// 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 organizationName, string projectName, string branchName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EndpointData.DeserializeEndpointData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Endpoint. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Endpoint. + /// 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 organizationName, string projectName, string branchName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EndpointData.DeserializeEndpointData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((EndpointData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string endpointName, EndpointData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string endpointName, EndpointData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, 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 Endpoint. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Endpoint. + /// 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 organizationName, string projectName, string branchName, string endpointName, EndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, endpointName, 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 Endpoint. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Endpoint. + /// 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 organizationName, string projectName, string branchName, string endpointName, EndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, endpointName, 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 organizationName, string projectName, string branchName, string endpointName, EndpointData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string endpointName, EndpointData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, 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 Endpoint. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Endpoint. + /// 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 organizationName, string projectName, string branchName, string endpointName, EndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, endpointName, 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 Endpoint. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Endpoint. + /// 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 organizationName, string projectName, string branchName, string endpointName, EndpointData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, endpointName, data); + _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 organizationName, string projectName, string branchName, string endpointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string endpointName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/endpoints/", false); + uri.AppendPath(endpointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Endpoint. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Endpoint. + /// 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 organizationName, string projectName, string branchName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, endpointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Endpoint. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the Endpoint. + /// 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 organizationName, string projectName, string branchName, string endpointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(endpointName, nameof(endpointName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, endpointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/endpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/endpoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Endpoint resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EndpointListResult.DeserializeEndpointListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Endpoint resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EndpointListResult.DeserializeEndpointListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + 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 Endpoint resources by Branch. + /// 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. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EndpointListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EndpointListResult.DeserializeEndpointListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Endpoint resources by Branch. + /// 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. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EndpointListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EndpointListResult.DeserializeEndpointListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonDatabasesRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonDatabasesRestOperations.cs new file mode 100644 index 000000000000..42c8d8e8fdfa --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonDatabasesRestOperations.cs @@ -0,0 +1,701 @@ +// 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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + internal partial class NeonDatabasesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NeonDatabasesRestOperations. + /// 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 NeonDatabasesRestOperations(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 organizationName, string projectName, string branchName, string neonDatabaseName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonDatabases/", false); + uri.AppendPath(neonDatabaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonDatabaseName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonDatabases/", false); + uri.AppendPath(neonDatabaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a NeonDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonDatabase. + /// 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 organizationName, string projectName, string branchName, string neonDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonDatabaseName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NeonDatabaseData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeonDatabaseData.DeserializeNeonDatabaseData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NeonDatabaseData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a NeonDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonDatabase. + /// 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 organizationName, string projectName, string branchName, string neonDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonDatabaseName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NeonDatabaseData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeonDatabaseData.DeserializeNeonDatabaseData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NeonDatabaseData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonDatabaseName, NeonDatabaseData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonDatabases/", false); + uri.AppendPath(neonDatabaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonDatabaseName, NeonDatabaseData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonDatabases/", false); + uri.AppendPath(neonDatabaseName, 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 NeonDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonDatabase. + /// 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 organizationName, string projectName, string branchName, string neonDatabaseName, NeonDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonDatabaseName, 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 NeonDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonDatabase. + /// 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 organizationName, string projectName, string branchName, string neonDatabaseName, NeonDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonDatabaseName, 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 organizationName, string projectName, string branchName, string neonDatabaseName, NeonDatabaseData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonDatabases/", false); + uri.AppendPath(neonDatabaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonDatabaseName, NeonDatabaseData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonDatabases/", false); + uri.AppendPath(neonDatabaseName, 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 NeonDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonDatabase. + /// 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 organizationName, string projectName, string branchName, string neonDatabaseName, NeonDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonDatabaseName, 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 NeonDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonDatabase. + /// 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 organizationName, string projectName, string branchName, string neonDatabaseName, NeonDatabaseData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonDatabaseName, data); + _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 organizationName, string projectName, string branchName, string neonDatabaseName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonDatabases/", false); + uri.AppendPath(neonDatabaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonDatabaseName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonDatabases/", false); + uri.AppendPath(neonDatabaseName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a NeonDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonDatabase. + /// 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 organizationName, string projectName, string branchName, string neonDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonDatabaseName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a NeonDatabase. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonDatabase. + /// 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 organizationName, string projectName, string branchName, string neonDatabaseName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonDatabaseName, nameof(neonDatabaseName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonDatabaseName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonDatabases", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonDatabases", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List NeonDatabase resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NeonDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeonDatabaseListResult.DeserializeNeonDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List NeonDatabase resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NeonDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeonDatabaseListResult.DeserializeNeonDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + 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 NeonDatabase resources by Branch. + /// 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. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NeonDatabaseListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeonDatabaseListResult.DeserializeNeonDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List NeonDatabase resources by Branch. + /// 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. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NeonDatabaseListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeonDatabaseListResult.DeserializeNeonDatabaseListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonRolesRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonRolesRestOperations.cs new file mode 100644 index 000000000000..c0db69d7c50f --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/NeonRolesRestOperations.cs @@ -0,0 +1,701 @@ +// 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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + internal partial class NeonRolesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of NeonRolesRestOperations. + /// 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 NeonRolesRestOperations(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 organizationName, string projectName, string branchName, string neonRoleName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonRoles/", false); + uri.AppendPath(neonRoleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonRoleName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonRoles/", false); + uri.AppendPath(neonRoleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a NeonRole. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonRole. + /// 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 organizationName, string projectName, string branchName, string neonRoleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonRoleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NeonRoleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeonRoleData.DeserializeNeonRoleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NeonRoleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a NeonRole. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonRole. + /// 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 organizationName, string projectName, string branchName, string neonRoleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonRoleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NeonRoleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeonRoleData.DeserializeNeonRoleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((NeonRoleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonRoleName, NeonRoleData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonRoles/", false); + uri.AppendPath(neonRoleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonRoleName, NeonRoleData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonRoles/", false); + uri.AppendPath(neonRoleName, 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 NeonRole. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonRole. + /// 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 organizationName, string projectName, string branchName, string neonRoleName, NeonRoleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonRoleName, 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 NeonRole. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonRole. + /// 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 organizationName, string projectName, string branchName, string neonRoleName, NeonRoleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonRoleName, 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 organizationName, string projectName, string branchName, string neonRoleName, NeonRoleData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonRoles/", false); + uri.AppendPath(neonRoleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonRoleName, NeonRoleData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonRoles/", false); + uri.AppendPath(neonRoleName, 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 NeonRole. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonRole. + /// 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 organizationName, string projectName, string branchName, string neonRoleName, NeonRoleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonRoleName, 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 NeonRole. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonRole. + /// 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 organizationName, string projectName, string branchName, string neonRoleName, NeonRoleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonRoleName, data); + _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 organizationName, string projectName, string branchName, string neonRoleName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonRoles/", false); + uri.AppendPath(neonRoleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, string neonRoleName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonRoles/", false); + uri.AppendPath(neonRoleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a NeonRole. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonRole. + /// 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 organizationName, string projectName, string branchName, string neonRoleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonRoleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a NeonRole. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The name of the NeonRole. + /// 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 organizationName, string projectName, string branchName, string neonRoleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + Argument.AssertNotNullOrEmpty(neonRoleName, nameof(neonRoleName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName, neonRoleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonRoles", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/branches/", false); + uri.AppendPath(branchName, true); + uri.AppendPath("/neonRoles", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List NeonRole resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NeonRoleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeonRoleListResult.DeserializeNeonRoleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List NeonRole resources by Branch. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NeonRoleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeonRoleListResult.DeserializeNeonRoleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName) + { + 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 NeonRole resources by Branch. + /// 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. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NeonRoleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NeonRoleListResult.DeserializeNeonRoleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List NeonRole resources by Branch. + /// 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. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// The name of the Branch. + /// The cancellation token to use. + /// , , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, string projectName, string branchName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNullOrEmpty(branchName, nameof(branchName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName, projectName, branchName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NeonRoleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NeonRoleListResult.DeserializeNeonRoleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/OrganizationsRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/OrganizationsRestOperations.cs index e528c86be1c8..c63d449c2906 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/OrganizationsRestOperations.cs +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/OrganizationsRestOperations.cs @@ -32,7 +32,7 @@ public OrganizationsRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-08-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -564,6 +564,101 @@ public Response ListBySubscription(string subscr } } + internal RequestUriBuilder CreateGetPostgresVersionsRequestUri(string subscriptionId, string resourceGroupName, PgVersion pgVersion) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/getPostgresVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetPostgresVersionsRequest(string subscriptionId, string resourceGroupName, PgVersion pgVersion) + { + 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/Neon.Postgres/getPostgresVersions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (pgVersion != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(pgVersion, ModelSerializationExtensions.WireOptions); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Action to retrieve the PostgreSQL versions. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Post Action to retrieve the PostgreSQL versions. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetPostgresVersionsAsync(string subscriptionId, string resourceGroupName, PgVersion pgVersion = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateGetPostgresVersionsRequest(subscriptionId, resourceGroupName, pgVersion); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PgVersionsResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PgVersionsResult.DeserializePgVersionsResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Action to retrieve the PostgreSQL versions. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Post Action to retrieve the PostgreSQL versions. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response GetPostgresVersions(string subscriptionId, string resourceGroupName, PgVersion pgVersion = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateGetPostgresVersionsRequest(subscriptionId, resourceGroupName, pgVersion); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PgVersionsResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PgVersionsResult.DeserializePgVersionsResult(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(); diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ProjectsRestOperations.cs b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ProjectsRestOperations.cs new file mode 100644 index 000000000000..efb9ed1700bb --- /dev/null +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/src/Generated/RestOperations/ProjectsRestOperations.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.NeonPostgres.Models; + +namespace Azure.ResourceManager.NeonPostgres +{ + internal partial class ProjectsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ProjectsRestOperations. + /// 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 ProjectsRestOperations(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 organizationName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProjectData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProjectData.DeserializeProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProjectData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, organizationName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProjectData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProjectData.DeserializeProjectData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ProjectData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, ProjectData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, ProjectData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, 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 Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, 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 Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, 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 organizationName, string projectName, ProjectData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, ProjectData 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, 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 Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, 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 Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, ProjectData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, organizationName, projectName, data); + _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 organizationName, string projectName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Delete a Project. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// 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 organizationName, string projectName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, organizationName, projectName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string organizationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string organizationName) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List Project resources by OrganizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string organizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProjectListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProjectListResult.DeserializeProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Project resources by OrganizationResource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string organizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, organizationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProjectListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProjectListResult.DeserializeProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetConnectionUriRequestUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, ConnectionUriProperties connectionUriParameters) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/getConnectionUri", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetConnectionUriRequest(string subscriptionId, string resourceGroupName, string organizationName, string projectName, ConnectionUriProperties connectionUriParameters) + { + 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/Neon.Postgres/organizations/", false); + uri.AppendPath(organizationName, true); + uri.AppendPath("/projects/", false); + uri.AppendPath(projectName, true); + uri.AppendPath("/getConnectionUri", 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(connectionUriParameters, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Action to retrieve the connection URI for the Neon Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// Additional parameters for retrieving the database connection URI. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetConnectionUriAsync(string subscriptionId, string resourceGroupName, string organizationName, string projectName, ConnectionUriProperties connectionUriParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(connectionUriParameters, nameof(connectionUriParameters)); + + using var message = CreateGetConnectionUriRequest(subscriptionId, resourceGroupName, organizationName, projectName, connectionUriParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ConnectionUriProperties value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ConnectionUriProperties.DeserializeConnectionUriProperties(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Action to retrieve the connection URI for the Neon Database. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Name of the Neon Organizations resource. + /// The name of the Project. + /// Additional parameters for retrieving the database connection URI. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetConnectionUri(string subscriptionId, string resourceGroupName, string organizationName, string projectName, ConnectionUriProperties connectionUriParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + Argument.AssertNotNullOrEmpty(projectName, nameof(projectName)); + Argument.AssertNotNull(connectionUriParameters, nameof(connectionUriParameters)); + + using var message = CreateGetConnectionUriRequest(subscriptionId, resourceGroupName, organizationName, projectName, connectionUriParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ConnectionUriProperties value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ConnectionUriProperties.DeserializeConnectionUriProperties(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string organizationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string organizationName) + { + 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 Project resources by OrganizationResource. + /// 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. + /// Name of the Neon Organizations resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProjectListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProjectListResult.DeserializeProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List Project resources by OrganizationResource. + /// 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. + /// Name of the Neon Organizations resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string organizationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(organizationName, nameof(organizationName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, organizationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProjectListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProjectListResult.DeserializeProjectListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/tsp-location.yaml b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/tsp-location.yaml index 4216dd4fa9fb..f6671dd7f9ab 100644 --- a/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/tsp-location.yaml +++ b/sdk/neonpostgres/Azure.ResourceManager.NeonPostgres/tsp-location.yaml @@ -1,3 +1,4 @@ directory: specification/liftrneon/Neon.Postgres.Management -commit: 462574dbd02088c209bb1da3eef0d93f699e8de2 +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b repo: Azure/azure-rest-api-specs +additionalDirectories: 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ApexDetailsType.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ApexDetailsType.cs new file mode 100644 index 000000000000..9e346ee2f4d5 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/ApexDetailsType.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 +{ + /// Information about Oracle APEX Application Development. + public partial class ApexDetailsType + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ApexDetailsType() + { + } + + /// 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 ApexDetailsType(string apexVersion, string ordsVersion, IDictionary serializedAdditionalRawData) + { + ApexVersion = apexVersion; + OrdsVersion = ordsVersion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// 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/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.Serialization.cs b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.Serialization.cs new file mode 100644 index 000000000000..b91fa0e5f4ed --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/src/Generated/Models/AutonomousDatabaseCharacterSetProperties.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 AutonomousDatabaseCharacterSetProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(AutonomousDatabaseCharacterSetProperties)} 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 + } + } + } + + AutonomousDatabaseCharacterSetProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AutonomousDatabaseCharacterSetProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAutonomousDatabaseCharacterSetProperties(document.RootElement, options); + } + + internal static AutonomousDatabaseCharacterSetProperties DeserializeAutonomousDatabaseCharacterSetProperties(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 AutonomousDatabaseCharacterSetProperties(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(AutonomousDatabaseCharacterSetProperties)} does not support writing '{options.Format}' format."); + } + } + + AutonomousDatabaseCharacterSetProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAutonomousDatabaseCharacterSetProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AutonomousDatabaseCharacterSetProperties)} does not support reading '{options.Format}' format."); + } + } + + 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..b900849d62a2 --- /dev/null +++ b/sdk/oracledatabase/Azure.ResourceManager.OracleDatabase/tsp-location.yaml @@ -0,0 +1,5 @@ +directory: specification/oracle/Oracle.Database.Management +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b +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/pineconevectordb/ci.yml b/sdk/pineconevectordb/ci.yml deleted file mode 100644 index 0b8325c8c903..000000000000 --- a/sdk/pineconevectordb/ci.yml +++ /dev/null @@ -1,35 +0,0 @@ -# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. - -trigger: - branches: - include: - - main - - hotfix/* - - release/* - paths: - include: - - sdk/pineconevectordb - - sdk/pineconevectordb/ci.yml - - sdk/pineconevectordb/Azure.ResourceManager.PineconeVectorDb - -pr: - branches: - include: - - main - - feature/* - - hotfix/* - - release/* - paths: - include: - - sdk/pineconevectordb - - sdk/pineconevectordb/ci.yml - - sdk/pineconevectordb/Azure.ResourceManager.PineconeVectorDb - -extends: - template: /eng/pipelines/templates/stages/archetype-sdk-client.yml - parameters: - ServiceDirectory: pineconevectordb - ArtifactName: packages - Artifacts: - - name: Azure.ResourceManager.PineconeVectorDb - safeName: AzureResourceManagerPineconeVectorDb diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Azure.ResourceManager.RecoveryServicesDataReplication.sln b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Azure.ResourceManager.RecoveryServicesDataReplication.sln new file mode 100644 index 000000000000..fa8a7db58bc9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Azure.ResourceManager.RecoveryServicesDataReplication.sln @@ -0,0 +1,56 @@ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29709.97 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Azure.ResourceManager.RecoveryServicesDataReplication.Samples", "samples\Azure.ResourceManager.RecoveryServicesDataReplication.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.RecoveryServicesDataReplication", "src\Azure.ResourceManager.RecoveryServicesDataReplication.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.RecoveryServicesDataReplication.Tests", "tests\Azure.ResourceManager.RecoveryServicesDataReplication.Tests.csproj", "{1F1CD1D4-9932-4B73-99D8-C252A67D4B46}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B0C276D1-2930-4887-B29A-D1A33E7009A2}.Release|Any CPU.Build.0 = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E9A77AC-792A-4432-8320-ACFD46730401}.Release|Any CPU.Build.0 = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7A2DFF15-5746-49F4-BD0F-C6C35337088A}.Release|Any CPU.Build.0 = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A4241C1F-A53D-474C-9E4E-075054407E74}.Release|Any CPU.Build.0 = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {FA8BD3F1-8616-47B6-974C-7576CDF4717E}.Release|Any CPU.Build.0 = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Debug|Any CPU.Build.0 = Debug|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.ActiveCfg = Release|Any CPU + {85677AD3-C214-42FA-AE6E-49B956CAC8DC}.Release|Any CPU.Build.0 = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Debug|Any CPU.Build.0 = Debug|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.ActiveCfg = Release|Any CPU + {28FF4005-4467-4E36-92E7-DEA27DEB1519}.Release|Any CPU.Build.0 = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1F1CD1D4-9932-4B73-99D8-C252A67D4B46}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {A97F4B90-2591-4689-B1F8-5F21FE6D6CAE} + EndGlobalSection +EndGlobal diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/CHANGELOG.md b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/CHANGELOG.md @@ -0,0 +1,11 @@ +# Release History + +## 1.0.0-beta.1 (Unreleased) + +### Features Added + +### Breaking Changes + +### Bugs Fixed + +### Other Changes \ No newline at end of file diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Directory.Build.props b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/README.md b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/README.md new file mode 100644 index 000000000000..8531bbf7e62c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure RecoveryServicesDataReplication management client library for .NET + +**[Describe the service briefly first.]** + +This library follows the [new Azure SDK guidelines](https://azure.github.io/azure-sdk/general_introduction.html), and provides many core capabilities: + + - Support MSAL.NET, Azure.Identity is out of box for supporting MSAL.NET. + - Support [OpenTelemetry](https://opentelemetry.io/) for distributed tracing. + - HTTP pipeline with custom policies. + - Better error-handling. + - Support uniform telemetry across all languages. + +## Getting started + +### Install the package + +Install the Microsoft Azure RecoveryServicesDataReplication management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.RecoveryServicesDataReplication --prerelease +``` + +### Prerequisites + +* You must have an [Microsoft Azure subscription](https://azure.microsoft.com/free/dotnet/). + +### Authenticate the Client + +To create an authenticated client and start interacting with Microsoft Azure resources, see the [quickstart guide here](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). + +## Key concepts + +Key concepts of the Microsoft Azure SDK for .NET can be found [here](https://azure.github.io/azure-sdk/dotnet_introduction.html) + +## Documentation + +Documentation is available to help you learn how to use this package: + +- [Quickstart](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/dev/mgmt_quickstart.md). +- [API References](https://learn.microsoft.com/dotnet/api/?view=azure-dotnet). +- [Authentication](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/identity/Azure.Identity/README.md). + +## Examples + +Code samples for using the management library for .NET can be found in the following locations +- [.NET Management Library Code Samples](https://aka.ms/azuresdk-net-mgmt-samples) + +## Troubleshooting + +- File an issue via [GitHub Issues](https://github.com/Azure/azure-sdk-for-net/issues). +- Check [previous questions](https://stackoverflow.com/questions/tagged/azure+.net) or ask new ones on Stack Overflow using Azure and .NET tags. + +## Next steps + +For more information about Microsoft Azure SDK, see [this website](https://azure.github.io/azure-sdk/). + +## Contributing + +For details on contributing to this repository, see the [contributing +guide][cg]. + +This project welcomes contributions and suggestions. Most contributions +require you to agree to a Contributor License Agreement (CLA) declaring +that you have the right to, and actually do, grant us the rights to use +your contribution. For details, visit . + +When you submit a pull request, a CLA-bot will automatically determine +whether you need to provide a CLA and decorate the PR appropriately +(for example, label, comment). Follow the instructions provided by the +bot. You'll only need to do this action once across all repositories +using our CLA. + +This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For +more information, see the [Code of Conduct FAQ][coc_faq] or contact + with any other questions or comments. + + +[cg]: https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/resourcemanager/Azure.ResourceManager/docs/CONTRIBUTING.md +[coc]: https://opensource.microsoft.com/codeofconduct/ +[coc_faq]: https://opensource.microsoft.com/codeofconduct/faq/ \ No newline at end of file diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.net8.0.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.net8.0.cs new file mode 100644 index 000000000000..b1039fce0a9e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.net8.0.cs @@ -0,0 +1,2383 @@ +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationEmailConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationEmailConfigurationCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string emailConfigurationName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string emailConfigurationName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationEmailConfigurationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationEmailConfigurationData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEmailConfigurationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationEmailConfigurationResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationEventCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationEventCollection() { } + public virtual Azure.Response Exists(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationEventData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationEventData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEventResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationEventResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string eventName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationExtensionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationExtensionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationExtensionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationExtensionData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationExtensionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationExtensionResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationFabricAgentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationFabricAgentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricAgentName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fabricAgentName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationFabricAgentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricAgentData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricAgentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationFabricAgentResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationFabricCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationFabricCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fabricName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationFabricData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationFabricResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDataReplicationFabricAgent(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationFabricAgentAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentCollection GetDataReplicationFabricAgents() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationJobCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationJobCollection() { } + public virtual Azure.Response Exists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationJobData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationJobData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationJobResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationJobResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string jobName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string policyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string policyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationPolicyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPolicyData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPolicyResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string policyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPrivateEndpointConnectionProxyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionProxyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionProxyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionProxyData() { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPrivateEndpointConnectionProxyResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Validate(Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ValidateAsync(Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationPrivateLinkResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPrivateLinkResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPrivateLinkResourceCollection() { } + public virtual Azure.Response Exists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationPrivateLinkResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationPrivateLinkResourceData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationProtectedItemCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string protectedItemName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string protectedItemName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationProtectedItemData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationProtectedItemData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationProtectedItemResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, bool? forceDelete = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, bool? forceDelete = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDataReplicationRecoveryPoint(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationRecoveryPointAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointCollection GetDataReplicationRecoveryPoints() { throw null; } + public virtual Azure.ResourceManager.ArmOperation PlannedFailover(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PlannedFailoverAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationRecoveryPointCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationRecoveryPointCollection() { } + public virtual Azure.Response Exists(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationRecoveryPointData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationRecoveryPointData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationRecoveryPointResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationRecoveryPointResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationVaultCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationVaultCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationVaultData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationVaultData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationVaultResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationVaultResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDataReplicationEmailConfiguration(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationEmailConfigurationAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationCollection GetDataReplicationEmailConfigurations() { throw null; } + public virtual Azure.Response GetDataReplicationEvent(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationEventAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventCollection GetDataReplicationEvents() { throw null; } + public virtual Azure.Response GetDataReplicationExtension(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationExtensionAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionCollection GetDataReplicationExtensions() { throw null; } + public virtual Azure.Response GetDataReplicationJob(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationJobAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobCollection GetDataReplicationJobs() { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyCollection GetDataReplicationPolicies() { throw null; } + public virtual Azure.Response GetDataReplicationPolicy(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPolicyAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDataReplicationPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyCollection GetDataReplicationPrivateEndpointConnectionProxies() { throw null; } + public virtual Azure.Response GetDataReplicationPrivateEndpointConnectionProxy(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPrivateEndpointConnectionProxyAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionCollection GetDataReplicationPrivateEndpointConnections() { throw null; } + public virtual Azure.Response GetDataReplicationPrivateLinkResource(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPrivateLinkResourceAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceCollection GetDataReplicationPrivateLinkResources() { throw null; } + public virtual Azure.Response GetDataReplicationProtectedItem(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationProtectedItemAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemCollection GetDataReplicationProtectedItems() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class RecoveryServicesDataReplicationExtensions + { + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventResource GetDataReplicationEventResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionResource GetDataReplicationExtensionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetDataReplicationFabric(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentResource GetDataReplicationFabricAgentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static System.Threading.Tasks.Task> GetDataReplicationFabricAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricResource GetDataReplicationFabricResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricCollection GetDataReplicationFabrics(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDataReplicationFabrics(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDataReplicationFabricsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobResource GetDataReplicationJobResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyResource GetDataReplicationPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyResource GetDataReplicationPrivateEndpointConnectionProxyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionResource GetDataReplicationPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResource GetDataReplicationPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetDataReplicationVault(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDataReplicationVaultAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultResource GetDataReplicationVaultResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultCollection GetDataReplicationVaults(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDataReplicationVaults(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDataReplicationVaultsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostCheckNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostCheckNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostDeploymentPreflight(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostDeploymentPreflightAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + public partial class MockableRecoveryServicesDataReplicationArmClient : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationArmClient() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventResource GetDataReplicationEventResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionResource GetDataReplicationExtensionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentResource GetDataReplicationFabricAgentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricResource GetDataReplicationFabricResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobResource GetDataReplicationJobResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyResource GetDataReplicationPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyResource GetDataReplicationPrivateEndpointConnectionProxyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionResource GetDataReplicationPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResource GetDataReplicationPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultResource GetDataReplicationVaultResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableRecoveryServicesDataReplicationResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationResourceGroupResource() { } + public virtual Azure.Response GetDataReplicationFabric(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationFabricAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricCollection GetDataReplicationFabrics() { throw null; } + public virtual Azure.Response GetDataReplicationVault(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationVaultAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultCollection GetDataReplicationVaults() { throw null; } + public virtual Azure.Response PostDeploymentPreflight(string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostDeploymentPreflightAsync(string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MockableRecoveryServicesDataReplicationSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationSubscriptionResource() { } + public virtual Azure.Pageable GetDataReplicationFabrics(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDataReplicationFabricsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDataReplicationVaults(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDataReplicationVaultsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response PostCheckNameAvailability(Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostCheckNameAvailabilityAsync(Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public static partial class ArmRecoveryServicesDataReplicationModelFactory + { + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciFabricCustomProperties AzStackHciFabricCustomProperties(Azure.Core.ResourceIdentifier azStackHciSiteId = null, System.Collections.Generic.IEnumerable applianceName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties cluster = null, Azure.Core.ResourceIdentifier fabricResourceId = null, Azure.Core.ResourceIdentifier fabricContainerId = null, Azure.Core.ResourceIdentifier migrationSolutionId = null, System.Uri migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData DataReplicationEmailConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties DataReplicationEmailConfigurationProperties(bool sendToOwners = false, System.Collections.Generic.IEnumerable customEmailAddresses = null, string locale = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationErrorInfo DataReplicationErrorInfo(string code = null, string type = null, string severity = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData DataReplicationEventData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties DataReplicationEventProperties(Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), string resourceName = null, string eventType = null, string eventName = null, System.DateTimeOffset? occurredOn = default(System.DateTimeOffset?), string severity = null, string description = null, string correlationId = null, System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData DataReplicationExtensionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties DataReplicationExtensionProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData DataReplicationFabricAgentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties DataReplicationFabricAgentProperties(string correlationId = null, string machineId = null, string machineName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity authenticationIdentity = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity resourceAccessIdentity = null, bool? isResponsive = default(bool?), System.DateTimeOffset? lastHeartbeatOn = default(System.DateTimeOffset?), string versionNumber = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData DataReplicationFabricData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch DataReplicationFabricPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties DataReplicationFabricProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), string serviceEndpoint = null, Azure.Core.ResourceIdentifier serviceResourceId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? health = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthErrorInfo DataReplicationHealthErrorInfo(Azure.Core.ResourceType? affectedResourceType = default(Azure.Core.ResourceType?), System.Collections.Generic.IEnumerable affectedResourceCorrelationIds = null, System.Collections.Generic.IEnumerable childErrors = null, string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), bool? isCustomerResolvable = default(bool?), string summary = null, string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationInnerHealthErrorInfo DataReplicationInnerHealthErrorInfo(string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), bool? isCustomerResolvable = default(bool?), string summary = null, string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties DataReplicationJobCustomProperties(string instanceType = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData DataReplicationJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties DataReplicationJobProperties(string displayName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState? state = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string objectId = null, string objectName = null, string objectInternalId = null, string objectInternalName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType? objectType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType?), string replicationProviderId = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, System.Collections.Generic.IEnumerable allowedActions = null, string activityId = null, System.Collections.Generic.IEnumerable tasks = null, System.Collections.Generic.IEnumerable errors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityResult DataReplicationNameAvailabilityResult(bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData DataReplicationPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties DataReplicationPolicyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData DataReplicationPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties DataReplicationPrivateEndpointConnectionProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData DataReplicationPrivateEndpointConnectionProxyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties DataReplicationPrivateEndpointConnectionProxyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint remotePrivateEndpoint = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData DataReplicationPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties DataReplicationPrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData DataReplicationProtectedItemData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch DataReplicationProtectedItemPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties DataReplicationProtectedItemProperties(string policyName = null, string replicationExtensionName = null, string correlationId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState? protectionState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState?), string protectionStateDescription = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState? testFailoverState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState?), string testFailoverStateDescription = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState? resynchronizationState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState?), string fabricObjectId = null, string fabricObjectName = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, string fabricId = null, string targetFabricId = null, string fabricAgentId = null, string targetFabricAgentId = null, bool? isResyncRequired = default(bool?), System.DateTimeOffset? lastSuccessfulPlannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulUnplannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulTestFailoverOn = default(System.DateTimeOffset?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties currentJob = null, System.Collections.Generic.IEnumerable allowedJobs = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastFailedEnableProtectionJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastFailedPlannedFailoverJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastTestFailoverJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? replicationHealth = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData DataReplicationRecoveryPointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties DataReplicationRecoveryPointProperties(System.DateTimeOffset recoveryPointOn = default(System.DateTimeOffset), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType recoveryPointType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTask DataReplicationTask(string taskName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState? state = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string customInstanceType = null, System.Collections.Generic.IEnumerable childrenJobs = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData DataReplicationVaultData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch DataReplicationVaultPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties DataReplicationVaultProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.Core.ResourceIdentifier serviceResourceId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType? vaultType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobCustomProperties FailoverJobCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties FailoverProtectedItemProperties(string protectedItemName = null, string vmName = null, string testVmName = null, string recoveryPointId = null, System.DateTimeOffset? recoveryPointOn = default(System.DateTimeOffset?), string networkName = null, string subnet = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricCustomProperties HyperVMigrateFabricCustomProperties(Azure.Core.ResourceIdentifier hyperVSiteId = null, Azure.Core.ResourceIdentifier fabricResourceId = null, Azure.Core.ResourceIdentifier fabricContainerId = null, Azure.Core.ResourceIdentifier migrationSolutionId = null, System.Uri migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciEventCustomProperties HyperVToAzStackHciEventCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciNicInput HyperVToAzStackHciNicInput(string nicId = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection), bool? isStaticIPMigrationEnabled = default(bool?), bool? isMacMigrationEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedDiskProperties HyperVToAzStackHciProtectedDiskProperties(Azure.Core.ResourceIdentifier storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = default(bool?), long? capacityInBytes = default(long?), bool? isDynamic = default(bool?), string diskType = null, long? diskBlockSize = default(long?), long? diskLogicalSectorSize = default(long?), long? diskPhysicalSectorSize = default(long?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomProperties HyperVToAzStackHciProtectedItemCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation?), Azure.Core.ResourceIdentifier targetHciClusterId = null, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId = null, System.Collections.Generic.IEnumerable disksToInclude = null, System.Collections.Generic.IEnumerable nicsToInclude = null, string sourceVmName = null, int? sourceCpuCores = default(int?), double? sourceMemoryInMegaBytes = default(double?), string targetVmName = null, Azure.Core.ResourceIdentifier targetResourceGroupId = null, Azure.Core.ResourceIdentifier storageContainerId = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = default(int?), bool? isDynamicRam = default(bool?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = default(int?), string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string osType = null, string osName = null, string firmwareType = null, string targetLocation = null, string customLocationRegion = null, string failoverRecoveryPointId = null, System.DateTimeOffset? lastRecoveryPointReceivedOn = default(System.DateTimeOffset?), string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = default(int?), int? resyncProgressPercentage = default(int?), System.Collections.Generic.IEnumerable protectedDisks = null, System.Collections.Generic.IEnumerable protectedNics = null, string targetVmBiosId = null, System.DateTimeOffset? lastReplicationUpdateOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedNicProperties HyperVToAzStackHciProtectedNicProperties(string nicId = null, string macAddress = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciRecoveryPointCustomProperties HyperVToAzStackHciRecoveryPointCustomProperties(System.Collections.Generic.IEnumerable diskIds = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciReplicationExtensionCustomProperties HyperVToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier hyperVFabricArmId = null, Azure.Core.ResourceIdentifier hyperVSiteId = null, Azure.Core.ResourceIdentifier azStackHciFabricArmId = null, Azure.Core.ResourceIdentifier azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, System.Uri asrServiceUri = null, System.Uri rcmServiceUri = null, System.Uri gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails JobModelCustomPropertiesAffectedObjectDetails(string description = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType? type = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties ProtectedItemJobProperties(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobCustomProperties TestFailoverCleanupJobCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, string comments = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobCustomProperties TestFailoverJobCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciEventCustomProperties VMwareToAzStackHciEventCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciNicInput VMwareToAzStackHciNicInput(string nicId = null, string label = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection), bool? isStaticIPMigrationEnabled = default(bool?), bool? isMacMigrationEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedDiskProperties VMwareToAzStackHciProtectedDiskProperties(Azure.Core.ResourceIdentifier storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = default(bool?), long? capacityInBytes = default(long?), bool? isDynamic = default(bool?), string diskType = null, long? diskBlockSize = default(long?), long? diskLogicalSectorSize = default(long?), long? diskPhysicalSectorSize = default(long?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomProperties VMwareToAzStackHciProtectedItemCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation?), Azure.Core.ResourceIdentifier targetHciClusterId = null, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, Azure.Core.ResourceIdentifier storageContainerId = null, Azure.Core.ResourceIdentifier targetResourceGroupId = null, string targetLocation = null, string customLocationRegion = null, System.Collections.Generic.IEnumerable disksToInclude = null, System.Collections.Generic.IEnumerable nicsToInclude = null, System.Collections.Generic.IEnumerable protectedDisks = null, System.Collections.Generic.IEnumerable protectedNics = null, string targetVmBiosId = null, string targetVmName = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = default(int?), bool? isDynamicRam = default(bool?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = default(int?), string osType = null, string osName = null, string firmwareType = null, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId = null, string sourceVmName = null, int? sourceCpuCores = default(int?), double? sourceMemoryInMegaBytes = default(double?), string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string failoverRecoveryPointId = null, System.DateTimeOffset? lastRecoveryPointReceivedOn = default(System.DateTimeOffset?), string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = default(int?), int? migrationProgressPercentage = default(int?), int? resumeProgressPercentage = default(int?), int? resyncProgressPercentage = default(int?), long? resyncRetryCount = default(long?), bool? resyncRequired = default(bool?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState? resyncState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState?), bool? performAutoResync = default(bool?), long? resumeRetryCount = default(long?), System.DateTimeOffset? lastReplicationUpdateOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedNicProperties VMwareToAzStackHciProtectedNicProperties(string nicId = null, string macAddress = null, string label = null, bool? isPrimaryNic = default(bool?), string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciRecoveryPointCustomProperties VMwareToAzStackHciRecoveryPointCustomProperties(System.Collections.Generic.IEnumerable diskIds = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciReplicationExtensionCustomProperties VMwareToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier vmwareFabricArmId = null, Azure.Core.ResourceIdentifier vmwareSiteId = null, Azure.Core.ResourceIdentifier azStackHciFabricArmId = null, Azure.Core.ResourceIdentifier azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, System.Uri asrServiceUri = null, System.Uri rcmServiceUri = null, System.Uri gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) { throw null; } + } + public partial class AzStackHciClusterProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzStackHciClusterProperties(string clusterName, string resourceName, string storageAccountName, System.Collections.Generic.IEnumerable storageContainers) { } + public string ClusterName { get { throw null; } set { } } + public string ResourceName { get { throw null; } set { } } + public string StorageAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList StorageContainers { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzStackHciFabricCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzStackHciFabricCustomProperties(Azure.Core.ResourceIdentifier azStackHciSiteId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties cluster, Azure.Core.ResourceIdentifier migrationSolutionId) { } + public System.Collections.Generic.IReadOnlyList ApplianceName { get { throw null; } } + public Azure.Core.ResourceIdentifier AzStackHciSiteId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties Cluster { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier FabricContainerId { get { throw null; } } + public Azure.Core.ResourceIdentifier FabricResourceId { get { throw null; } } + public System.Uri MigrationHubUri { get { throw null; } } + public Azure.Core.ResourceIdentifier MigrationSolutionId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationDiskControllerInputs : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationDiskControllerInputs(string controllerName, int controllerId, int controllerLocation) { } + public int ControllerId { get { throw null; } set { } } + public int ControllerLocation { get { throw null; } set { } } + public string ControllerName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEmailConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationEmailConfigurationProperties(bool sendToOwners) { } + public System.Collections.Generic.IList CustomEmailAddresses { get { throw null; } } + public string Locale { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public bool SendToOwners { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationErrorInfo() { } + public string Causes { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationEventCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationEventCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEventProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationEventProperties() { } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties CustomProperties { get { throw null; } } + public string Description { get { throw null; } } + public string EventName { get { throw null; } } + public string EventType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public System.DateTimeOffset? OccurredOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ResourceName { get { throw null; } } + public Azure.Core.ResourceType? ResourceType { get { throw null; } } + public string Severity { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationExtensionCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationExtensionCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationExtensionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationExtensionProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationFabricAgentCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationFabricAgentCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricAgentProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricAgentProperties(string machineId, string machineName, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity authenticationIdentity, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity resourceAccessIdentity, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity AuthenticationIdentity { get { throw null; } set { } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties CustomProperties { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public bool? IsResponsive { get { throw null; } } + public System.DateTimeOffset? LastHeartbeatOn { get { throw null; } } + public string MachineId { get { throw null; } set { } } + public string MachineName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity ResourceAccessIdentity { get { throw null; } set { } } + public string VersionNumber { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationFabricCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationFabricCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricPatch() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? Health { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ServiceEndpoint { get { throw null; } } + public Azure.Core.ResourceIdentifier ServiceResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationHealthErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationHealthErrorInfo() { } + public System.Collections.Generic.IReadOnlyList AffectedResourceCorrelationIds { get { throw null; } } + public Azure.Core.ResourceType? AffectedResourceType { get { throw null; } } + public string Category { get { throw null; } } + public string Causes { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ChildErrors { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string HealthCategory { get { throw null; } } + public bool? IsCustomerResolvable { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Source { get { throw null; } } + public string Summary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationHealthStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationHealthStatus(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus Critical { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus Normal { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationIdentity(System.Guid tenantId, string applicationId, string objectId, string audience, string aadAuthority) { } + public string AadAuthority { get { throw null; } set { } } + public string ApplicationId { get { throw null; } set { } } + public string Audience { get { throw null; } set { } } + public string ObjectId { get { throw null; } set { } } + public System.Guid TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationInnerHealthErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationInnerHealthErrorInfo() { } + public string Category { get { throw null; } } + public string Causes { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string HealthCategory { get { throw null; } } + public bool? IsCustomerResolvable { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Source { get { throw null; } } + public string Summary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationInnerHealthErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationInnerHealthErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationJobCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationJobCustomProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails AffectedObjectDetails { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationJobObjectType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationJobObjectType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType AvsDiskPool { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType Fabric { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType FabricAgent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType Policy { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType ProtectedItem { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType RecoveryPlan { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType ReplicationExtension { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType Vault { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationJobProperties() { } + public string ActivityId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList AllowedActions { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties CustomProperties { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public string ObjectId { get { throw null; } } + public string ObjectInternalId { get { throw null; } } + public string ObjectInternalName { get { throw null; } } + public string ObjectName { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType? ObjectType { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ReplicationProviderId { get { throw null; } } + public string SourceFabricProviderId { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState? State { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Tasks { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationJobState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationJobState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Cancelled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Cancelling { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState CompletedWithErrors { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState CompletedWithInformation { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState CompletedWithWarnings { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Started { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationNameAvailabilityContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationNameAvailabilityContent() { } + public string Name { get { throw null; } set { } } + public Azure.Core.ResourceType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationNameAvailabilityResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationNameAvailabilityResult() { } + public bool? IsNameAvailable { get { throw null; } } + public string Message { get { throw null; } } + public string Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationPolicyCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationPolicyCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPolicyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionProperties() { } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionProxyProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint RemotePrivateEndpoint { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationPrivateEndpointConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationPrivateEndpointConnectionStatus(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Approved { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Disconnected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationPrivateLinkResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationPrivateLinkResourceProperties() { } + public string GroupId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkServiceConnection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateLinkServiceConnection() { } + public System.Collections.Generic.IList GroupIds { get { throw null; } } + public string Name { get { throw null; } set { } } + public string RequestMessage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkServiceConnectionState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateLinkServiceConnectionState() { } + public string ActionsRequired { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkServiceProxy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateLinkServiceProxy() { } + public System.Collections.Generic.IList GroupConnectivityInformation { get { throw null; } } + public string Id { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier RemotePrivateEndpointConnectionId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState RemotePrivateLinkServiceConnectionState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceProxy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceProxy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationProtectedItemCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationProtectedItemCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationProtectedItemCustomPropertiesUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationProtectedItemCustomPropertiesUpdate() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationProtectedItemPatch() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate CustomProperties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationProtectedItemProperties(string policyName, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties customProperties) { } + public System.Collections.Generic.IReadOnlyList AllowedJobs { get { throw null; } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties CurrentJob { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties CustomProperties { get { throw null; } set { } } + public string FabricAgentId { get { throw null; } } + public string FabricId { get { throw null; } } + public string FabricObjectId { get { throw null; } } + public string FabricObjectName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public bool? IsResyncRequired { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastFailedEnableProtectionJob { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastFailedPlannedFailoverJob { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulPlannedFailoverOn { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulTestFailoverOn { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulUnplannedFailoverOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastTestFailoverJob { get { throw null; } } + public string PolicyName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState? ProtectionState { get { throw null; } } + public string ProtectionStateDescription { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ReplicationExtensionName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? ReplicationHealth { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState? ResynchronizationState { get { throw null; } } + public string SourceFabricProviderId { get { throw null; } } + public string TargetFabricAgentId { get { throw null; } } + public string TargetFabricId { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState? TestFailoverState { get { throw null; } } + public string TestFailoverStateDescription { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationProtectionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationProtectionState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState DisablingFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState DisablingProtection { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState EnablingFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState EnablingProtection { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationCompletedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationCompletedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationInProgress { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState Protected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ProtectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ProtectedStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnprotectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnprotectedStatesEnd { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Deleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class DataReplicationRecoveryPointCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationRecoveryPointCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationRecoveryPointProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationRecoveryPointProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties CustomProperties { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public System.DateTimeOffset RecoveryPointOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType RecoveryPointType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationRecoveryPointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationRecoveryPointType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType ApplicationConsistent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType CrashConsistent { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationResynchronizationState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationResynchronizationState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState ResynchronizationCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState ResynchronizationFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState ResynchronizationInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationTask : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationTask() { } + public System.Collections.Generic.IReadOnlyList ChildrenJobs { get { throw null; } } + public string CustomInstanceType { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState? State { get { throw null; } } + public string TaskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTask System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTask System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationTaskState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationTaskState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Cancelled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Skipped { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Started { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationTestFailoverState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationTestFailoverState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCleanupCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCleanupInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationVaultPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationVaultPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationVaultProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier ServiceResourceId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType? VaultType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationVaultType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationVaultType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType DisasterRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType Migrate { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DeploymentPreflight : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentPreflight() { } + public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentPreflightResourceInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentPreflightResourceInfo() { } + public string ApiVersion { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.BinaryData Properties { get { throw null; } set { } } + public Azure.Core.ResourceType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FailoverJobCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FailoverJobCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FailoverProtectedItemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FailoverProtectedItemProperties() { } + public string NetworkName { get { throw null; } } + public string ProtectedItemName { get { throw null; } } + public string RecoveryPointId { get { throw null; } } + public System.DateTimeOffset? RecoveryPointOn { get { throw null; } } + public string Subnet { get { throw null; } } + public string TestVmName { get { throw null; } } + public string VmName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GroupConnectivityInformation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GroupConnectivityInformation() { } + public System.Collections.Generic.IList CustomerVisibleFqdns { get { throw null; } } + public string GroupId { get { throw null; } set { } } + public string InternalFqdn { get { throw null; } set { } } + public string MemberName { get { throw null; } set { } } + public string PrivateLinkServiceArmRegion { get { throw null; } set { } } + public string RedirectMapId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.GroupConnectivityInformation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.GroupConnectivityInformation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVMigrateFabricCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVMigrateFabricCustomProperties(Azure.Core.ResourceIdentifier hyperVSiteId, Azure.Core.ResourceIdentifier migrationSolutionId) { } + public Azure.Core.ResourceIdentifier FabricContainerId { get { throw null; } } + public Azure.Core.ResourceIdentifier FabricResourceId { get { throw null; } } + public Azure.Core.ResourceIdentifier HyperVSiteId { get { throw null; } set { } } + public System.Uri MigrationHubUri { get { throw null; } } + public Azure.Core.ResourceIdentifier MigrationSolutionId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciDiskInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public long? DiskBlockSize { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs DiskController { get { throw null; } set { } } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public string DiskIdentifier { get { throw null; } set { } } + public long? DiskLogicalSectorSize { get { throw null; } set { } } + public long? DiskPhysicalSectorSize { get { throw null; } set { } } + public long DiskSizeGB { get { throw null; } set { } } + public bool? IsDynamic { get { throw null; } set { } } + public bool IsOSDisk { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciDiskInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciDiskInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciEventCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciEventCustomProperties() { } + public string EventSourceFriendlyName { get { throw null; } } + public string ProtectedItemFriendlyName { get { throw null; } } + public string ServerType { get { throw null; } } + public string SourceApplianceName { get { throw null; } } + public string TargetApplianceName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciEventCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciEventCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciNicInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciNicInput(string nicId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover) { } + public bool? IsMacMigrationEnabled { get { throw null; } set { } } + public bool? IsStaticIPMigrationEnabled { get { throw null; } set { } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectionTypeForFailover { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciNicInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciNicInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciPlannedFailoverCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciPlannedFailoverCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciPolicyCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciPolicyCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) { } + public int AppConsistentFrequencyInMinutes { get { throw null; } set { } } + public int CrashConsistentFrequencyInMinutes { get { throw null; } set { } } + public int RecoveryPointHistoryInMinutes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedDiskProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public long? DiskBlockSize { get { throw null; } } + public long? DiskLogicalSectorSize { get { throw null; } } + public long? DiskPhysicalSectorSize { get { throw null; } } + public string DiskType { get { throw null; } } + public bool? IsDynamic { get { throw null; } } + public bool? IsOSDisk { get { throw null; } } + public string MigrateDiskName { get { throw null; } } + public string SeedDiskName { get { throw null; } } + public string SourceDiskId { get { throw null; } } + public string SourceDiskName { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedItemCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciProtectedItemCustomProperties(Azure.Core.ResourceIdentifier targetHciClusterId, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, Azure.Core.ResourceIdentifier targetResourceGroupId, Azure.Core.ResourceIdentifier storageContainerId, string hyperVGeneration, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, string customLocationRegion) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? ActiveLocation { get { throw null; } } + public string CustomLocationRegion { get { throw null; } set { } } + public System.Collections.Generic.IList DisksToInclude { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier FabricDiscoveryMachineId { get { throw null; } set { } } + public string FailoverRecoveryPointId { get { throw null; } } + public string FirmwareType { get { throw null; } } + public string HyperVGeneration { get { throw null; } set { } } + public int? InitialReplicationProgressPercentage { get { throw null; } } + public bool? IsDynamicRam { get { throw null; } set { } } + public string LastRecoveryPointId { get { throw null; } } + public System.DateTimeOffset? LastRecoveryPointReceivedOn { get { throw null; } } + public System.DateTimeOffset? LastReplicationUpdateOn { get { throw null; } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSName { get { throw null; } } + public string OSType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedNics { get { throw null; } } + public int? ResyncProgressPercentage { get { throw null; } } + public string RunAsAccountId { get { throw null; } set { } } + public string SourceApplianceName { get { throw null; } } + public int? SourceCpuCores { get { throw null; } } + public string SourceFabricAgentName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetFabricAgentName { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier TargetHciClusterId { get { throw null; } set { } } + public string TargetLocation { get { throw null; } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier TargetResourceGroupId { get { throw null; } set { } } + public string TargetVmBiosId { get { throw null; } } + public string TargetVmName { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedItemCustomPropertiesUpdate : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciProtectedItemCustomPropertiesUpdate() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public bool? IsDynamicRam { get { throw null; } set { } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSType { get { throw null; } set { } } + public int? TargetCpuCores { get { throw null; } set { } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedNicProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciProtectedNicProperties() { } + public string MacAddress { get { throw null; } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? SelectionTypeForFailover { get { throw null; } } + public string TargetNetworkId { get { throw null; } } + public string TestNetworkId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciRecoveryPointCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciRecoveryPointCustomProperties() { } + public System.Collections.Generic.IReadOnlyList DiskIds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciReplicationExtensionCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier hyperVFabricArmId, Azure.Core.ResourceIdentifier azStackHciFabricArmId) { } + public System.Uri AsrServiceUri { get { throw null; } } + public Azure.Core.ResourceIdentifier AzStackHciFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier AzStackHciSiteId { get { throw null; } } + public System.Uri GatewayServiceUri { get { throw null; } } + public Azure.Core.ResourceIdentifier HyperVFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier HyperVSiteId { get { throw null; } } + public System.Uri RcmServiceUri { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceLocation { get { throw null; } } + public string SourceGatewayServiceId { get { throw null; } } + public string SourceStorageContainerName { get { throw null; } } + public string StorageAccountId { get { throw null; } set { } } + public string StorageAccountSasSecretName { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } } + public string TargetGatewayServiceId { get { throw null; } } + public string TargetStorageContainerName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class JobModelCustomPropertiesAffectedObjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal JobModelCustomPropertiesAffectedObjectDetails() { } + public string Description { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType? Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobModelCustomPropertiesAffectedObjectDetailsType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobModelCustomPropertiesAffectedObjectDetailsType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType Object { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PlannedFailover : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlannedFailover(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverProperties properties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties PlannedFailoverCustomProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class PlannedFailoverCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected PlannedFailoverCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlannedFailoverProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlannedFailoverProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties CustomProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProtectedItemActiveLocation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProtectedItemActiveLocation(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation Primary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation Recovery { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ProtectedItemDynamicMemoryConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProtectedItemDynamicMemoryConfig(long maximumMemoryInMegaBytes, long minimumMemoryInMegaBytes, int targetMemoryBufferPercentage) { } + public long MaximumMemoryInMegaBytes { get { throw null; } set { } } + public long MinimumMemoryInMegaBytes { get { throw null; } set { } } + public int TargetMemoryBufferPercentage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectedItemJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProtectedItemJobProperties() { } + public string DisplayName { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public string ScenarioName { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public string State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RemotePrivateEndpoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RemotePrivateEndpoint(string id) { } + public System.Collections.Generic.IList ConnectionDetails { get { throw null; } } + public string Id { get { throw null; } set { } } + public System.Collections.Generic.IList ManualPrivateLinkServiceConnections { get { throw null; } } + public System.Collections.Generic.IList PrivateLinkServiceConnections { get { throw null; } } + public System.Collections.Generic.IList PrivateLinkServiceProxies { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RemotePrivateEndpointConnectionDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RemotePrivateEndpointConnectionDetails() { } + public string GroupId { get { throw null; } set { } } + public string Id { get { throw null; } set { } } + public string LinkIdentifier { get { throw null; } set { } } + public string MemberName { get { throw null; } set { } } + public string PrivateIPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpointConnectionDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpointConnectionDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StorageContainerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StorageContainerProperties(string name, string clusterSharedVolumePath) { } + public string ClusterSharedVolumePath { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.StorageContainerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.StorageContainerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestFailoverCleanupJobCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestFailoverCleanupJobCustomProperties() { } + public string Comments { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestFailoverJobCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestFailoverJobCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VmNicSelection : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VmNicSelection(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection NotSelected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectedByDefault { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectedByUser { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectedByUserOverride { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VMwareFabricAgentCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareFabricAgentCustomProperties(string biosId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity marsAuthenticationIdentity) { } + public string BiosId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity MarsAuthenticationIdentity { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareFabricAgentCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareFabricAgentCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareMigrateFabricCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareMigrateFabricCustomProperties(Azure.Core.ResourceIdentifier vmwareSiteId, Azure.Core.ResourceIdentifier migrationSolutionId) { } + public Azure.Core.ResourceIdentifier MigrationSolutionId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier VmwareSiteId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareMigrateFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareMigrateFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciDiskInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public long? DiskBlockSize { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs DiskController { get { throw null; } set { } } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public string DiskIdentifier { get { throw null; } set { } } + public long? DiskLogicalSectorSize { get { throw null; } set { } } + public long? DiskPhysicalSectorSize { get { throw null; } set { } } + public long DiskSizeGB { get { throw null; } set { } } + public bool? IsDynamic { get { throw null; } set { } } + public bool IsOSDisk { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciDiskInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciDiskInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciEventCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciEventCustomProperties() { } + public string EventSourceFriendlyName { get { throw null; } } + public string ProtectedItemFriendlyName { get { throw null; } } + public string ServerType { get { throw null; } } + public string SourceApplianceName { get { throw null; } } + public string TargetApplianceName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciEventCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciEventCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciNicInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciNicInput(string nicId, string label, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover) { } + public bool? IsMacMigrationEnabled { get { throw null; } set { } } + public bool? IsStaticIPMigrationEnabled { get { throw null; } set { } } + public string Label { get { throw null; } set { } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectionTypeForFailover { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciNicInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciNicInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciPlannedFailoverCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciPlannedFailoverCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciPolicyCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciPolicyCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) { } + public int AppConsistentFrequencyInMinutes { get { throw null; } set { } } + public int CrashConsistentFrequencyInMinutes { get { throw null; } set { } } + public int RecoveryPointHistoryInMinutes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedDiskProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public long? DiskBlockSize { get { throw null; } } + public long? DiskLogicalSectorSize { get { throw null; } } + public long? DiskPhysicalSectorSize { get { throw null; } } + public string DiskType { get { throw null; } } + public bool? IsDynamic { get { throw null; } } + public bool? IsOSDisk { get { throw null; } } + public string MigrateDiskName { get { throw null; } } + public string SeedDiskName { get { throw null; } } + public string SourceDiskId { get { throw null; } } + public string SourceDiskName { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedItemCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciProtectedItemCustomProperties(Azure.Core.ResourceIdentifier targetHciClusterId, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId, Azure.Core.ResourceIdentifier storageContainerId, Azure.Core.ResourceIdentifier targetResourceGroupId, string customLocationRegion, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, string hyperVGeneration, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? ActiveLocation { get { throw null; } } + public string CustomLocationRegion { get { throw null; } set { } } + public System.Collections.Generic.IList DisksToInclude { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier FabricDiscoveryMachineId { get { throw null; } set { } } + public string FailoverRecoveryPointId { get { throw null; } } + public string FirmwareType { get { throw null; } } + public string HyperVGeneration { get { throw null; } set { } } + public int? InitialReplicationProgressPercentage { get { throw null; } } + public bool? IsDynamicRam { get { throw null; } set { } } + public string LastRecoveryPointId { get { throw null; } } + public System.DateTimeOffset? LastRecoveryPointReceivedOn { get { throw null; } } + public System.DateTimeOffset? LastReplicationUpdateOn { get { throw null; } } + public int? MigrationProgressPercentage { get { throw null; } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSName { get { throw null; } } + public string OSType { get { throw null; } } + public bool? PerformAutoResync { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList ProtectedDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedNics { get { throw null; } } + public int? ResumeProgressPercentage { get { throw null; } } + public long? ResumeRetryCount { get { throw null; } } + public int? ResyncProgressPercentage { get { throw null; } } + public bool? ResyncRequired { get { throw null; } } + public long? ResyncRetryCount { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState? ResyncState { get { throw null; } } + public string RunAsAccountId { get { throw null; } set { } } + public string SourceApplianceName { get { throw null; } } + public int? SourceCpuCores { get { throw null; } } + public string SourceFabricAgentName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetFabricAgentName { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier TargetHciClusterId { get { throw null; } set { } } + public string TargetLocation { get { throw null; } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier TargetResourceGroupId { get { throw null; } set { } } + public string TargetVmBiosId { get { throw null; } } + public string TargetVmName { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedItemCustomPropertiesUpdate : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciProtectedItemCustomPropertiesUpdate() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public bool? IsDynamicRam { get { throw null; } set { } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSType { get { throw null; } set { } } + public int? TargetCpuCores { get { throw null; } set { } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedNicProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciProtectedNicProperties() { } + public bool? IsPrimaryNic { get { throw null; } } + public string Label { get { throw null; } } + public string MacAddress { get { throw null; } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? SelectionTypeForFailover { get { throw null; } } + public string TargetNetworkId { get { throw null; } } + public string TestNetworkId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciRecoveryPointCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciRecoveryPointCustomProperties() { } + public System.Collections.Generic.IReadOnlyList DiskIds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciReplicationExtensionCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier vmwareFabricArmId, Azure.Core.ResourceIdentifier azStackHciFabricArmId) { } + public System.Uri AsrServiceUri { get { throw null; } } + public Azure.Core.ResourceIdentifier AzStackHciFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier AzStackHciSiteId { get { throw null; } } + public System.Uri GatewayServiceUri { get { throw null; } } + public System.Uri RcmServiceUri { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceLocation { get { throw null; } } + public string SourceGatewayServiceId { get { throw null; } } + public string SourceStorageContainerName { get { throw null; } } + public string StorageAccountId { get { throw null; } set { } } + public string StorageAccountSasSecretName { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } } + public string TargetGatewayServiceId { get { throw null; } } + public string TargetStorageContainerName { get { throw null; } } + public Azure.Core.ResourceIdentifier VmwareFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier VmwareSiteId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VMwareToAzureMigrateResyncState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VMwareToAzureMigrateResyncState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState PreparedForResynchronization { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState StartedResynchronization { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.netstandard2.0.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.netstandard2.0.cs new file mode 100644 index 000000000000..b1039fce0a9e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/api/Azure.ResourceManager.RecoveryServicesDataReplication.netstandard2.0.cs @@ -0,0 +1,2383 @@ +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationEmailConfigurationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationEmailConfigurationCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string emailConfigurationName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string emailConfigurationName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationEmailConfigurationData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationEmailConfigurationData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEmailConfigurationResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationEmailConfigurationResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationEventCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationEventCollection() { } + public virtual Azure.Response Exists(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationEventData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationEventData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEventResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationEventResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string eventName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationExtensionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationExtensionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationExtensionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationExtensionData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationExtensionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationExtensionResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationFabricAgentCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationFabricAgentCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricAgentName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fabricAgentName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationFabricAgentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricAgentData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricAgentResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationFabricAgentResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationFabricCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationFabricCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string fabricName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string fabricName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationFabricData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationFabricResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDataReplicationFabricAgent(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationFabricAgentAsync(string fabricAgentName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentCollection GetDataReplicationFabricAgents() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationJobCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationJobCollection() { } + public virtual Azure.Response Exists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationJobData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationJobData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationJobResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationJobResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string jobName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPolicyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPolicyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string policyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string policyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationPolicyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPolicyData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPolicyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPolicyResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string policyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPrivateEndpointConnectionCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPrivateEndpointConnectionProxyCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string privateEndpointConnectionProxyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string privateEndpointConnectionProxyName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionProxyData() { } + public Azure.ETag? ETag { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPrivateEndpointConnectionProxyResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Validate(Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ValidateAsync(Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPrivateEndpointConnectionResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationPrivateLinkResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationPrivateLinkResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkResourceCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationPrivateLinkResourceCollection() { } + public virtual Azure.Response Exists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationPrivateLinkResourceData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationPrivateLinkResourceData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationProtectedItemCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string protectedItemName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string protectedItemName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = default(int?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationProtectedItemData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationProtectedItemData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationProtectedItemResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, bool? forceDelete = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, bool? forceDelete = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDataReplicationRecoveryPoint(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationRecoveryPointAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointCollection GetDataReplicationRecoveryPoints() { throw null; } + public virtual Azure.ResourceManager.ArmOperation PlannedFailover(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PlannedFailoverAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover body, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class DataReplicationRecoveryPointCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationRecoveryPointCollection() { } + public virtual Azure.Response Exists(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string recoveryPointName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationRecoveryPointData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationRecoveryPointData() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties Properties { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationRecoveryPointResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationRecoveryPointResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationVaultCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected DataReplicationVaultCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string vaultName, Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(string continuationToken = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.NullableResponse GetIfExists(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetIfExistsAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class DataReplicationVaultData : Azure.ResourceManager.Models.TrackedResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationVaultData(Azure.Core.AzureLocation location) { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationVaultResource : Azure.ResourceManager.ArmResource, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public static readonly Azure.Core.ResourceType ResourceType; + protected DataReplicationVaultResource() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDataReplicationEmailConfiguration(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationEmailConfigurationAsync(string emailConfigurationName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationCollection GetDataReplicationEmailConfigurations() { throw null; } + public virtual Azure.Response GetDataReplicationEvent(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationEventAsync(string eventName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventCollection GetDataReplicationEvents() { throw null; } + public virtual Azure.Response GetDataReplicationExtension(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationExtensionAsync(string replicationExtensionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionCollection GetDataReplicationExtensions() { throw null; } + public virtual Azure.Response GetDataReplicationJob(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationJobAsync(string jobName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobCollection GetDataReplicationJobs() { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyCollection GetDataReplicationPolicies() { throw null; } + public virtual Azure.Response GetDataReplicationPolicy(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPolicyAsync(string policyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetDataReplicationPrivateEndpointConnection(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPrivateEndpointConnectionAsync(string privateEndpointConnectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyCollection GetDataReplicationPrivateEndpointConnectionProxies() { throw null; } + public virtual Azure.Response GetDataReplicationPrivateEndpointConnectionProxy(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPrivateEndpointConnectionProxyAsync(string privateEndpointConnectionProxyName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionCollection GetDataReplicationPrivateEndpointConnections() { throw null; } + public virtual Azure.Response GetDataReplicationPrivateLinkResource(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationPrivateLinkResourceAsync(string privateLinkResourceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceCollection GetDataReplicationPrivateLinkResources() { throw null; } + public virtual Azure.Response GetDataReplicationProtectedItem(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationProtectedItemAsync(string protectedItemName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemCollection GetDataReplicationProtectedItems() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public static partial class RecoveryServicesDataReplicationExtensions + { + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventResource GetDataReplicationEventResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionResource GetDataReplicationExtensionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetDataReplicationFabric(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentResource GetDataReplicationFabricAgentResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static System.Threading.Tasks.Task> GetDataReplicationFabricAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricResource GetDataReplicationFabricResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricCollection GetDataReplicationFabrics(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDataReplicationFabrics(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDataReplicationFabricsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobResource GetDataReplicationJobResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyResource GetDataReplicationPolicyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyResource GetDataReplicationPrivateEndpointConnectionProxyResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionResource GetDataReplicationPrivateEndpointConnectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResource GetDataReplicationPrivateLinkResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetDataReplicationVault(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetDataReplicationVaultAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultResource GetDataReplicationVaultResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultCollection GetDataReplicationVaults(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetDataReplicationVaults(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetDataReplicationVaultsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostCheckNameAvailability(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostCheckNameAvailabilityAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Response PostDeploymentPreflight(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> PostDeploymentPreflightAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + public partial class MockableRecoveryServicesDataReplicationArmClient : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationArmClient() { } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventResource GetDataReplicationEventResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionResource GetDataReplicationExtensionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentResource GetDataReplicationFabricAgentResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricResource GetDataReplicationFabricResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobResource GetDataReplicationJobResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyResource GetDataReplicationPolicyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyResource GetDataReplicationPrivateEndpointConnectionProxyResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionResource GetDataReplicationPrivateEndpointConnectionResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResource GetDataReplicationPrivateLinkResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(Azure.Core.ResourceIdentifier id) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultResource GetDataReplicationVaultResource(Azure.Core.ResourceIdentifier id) { throw null; } + } + public partial class MockableRecoveryServicesDataReplicationResourceGroupResource : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationResourceGroupResource() { } + public virtual Azure.Response GetDataReplicationFabric(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationFabricAsync(string fabricName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricCollection GetDataReplicationFabrics() { throw null; } + public virtual Azure.Response GetDataReplicationVault(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetDataReplicationVaultAsync(string vaultName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultCollection GetDataReplicationVaults() { throw null; } + public virtual Azure.Response PostDeploymentPreflight(string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostDeploymentPreflightAsync(string deploymentId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight body = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } + public partial class MockableRecoveryServicesDataReplicationSubscriptionResource : Azure.ResourceManager.ArmResource + { + protected MockableRecoveryServicesDataReplicationSubscriptionResource() { } + public virtual Azure.Pageable GetDataReplicationFabrics(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDataReplicationFabricsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetDataReplicationVaults(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetDataReplicationVaultsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response PostCheckNameAvailability(Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> PostCheckNameAvailabilityAsync(Azure.Core.AzureLocation location, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent content = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } +} +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public static partial class ArmRecoveryServicesDataReplicationModelFactory + { + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciFabricCustomProperties AzStackHciFabricCustomProperties(Azure.Core.ResourceIdentifier azStackHciSiteId = null, System.Collections.Generic.IEnumerable applianceName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties cluster = null, Azure.Core.ResourceIdentifier fabricResourceId = null, Azure.Core.ResourceIdentifier fabricContainerId = null, Azure.Core.ResourceIdentifier migrationSolutionId = null, System.Uri migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEmailConfigurationData DataReplicationEmailConfigurationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties DataReplicationEmailConfigurationProperties(bool sendToOwners = false, System.Collections.Generic.IEnumerable customEmailAddresses = null, string locale = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationErrorInfo DataReplicationErrorInfo(string code = null, string type = null, string severity = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationEventData DataReplicationEventData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties DataReplicationEventProperties(Azure.Core.ResourceType? resourceType = default(Azure.Core.ResourceType?), string resourceName = null, string eventType = null, string eventName = null, System.DateTimeOffset? occurredOn = default(System.DateTimeOffset?), string severity = null, string description = null, string correlationId = null, System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationExtensionData DataReplicationExtensionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties DataReplicationExtensionProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricAgentData DataReplicationFabricAgentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties DataReplicationFabricAgentProperties(string correlationId = null, string machineId = null, string machineName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity authenticationIdentity = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity resourceAccessIdentity = null, bool? isResponsive = default(bool?), System.DateTimeOffset? lastHeartbeatOn = default(System.DateTimeOffset?), string versionNumber = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationFabricData DataReplicationFabricData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch DataReplicationFabricPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties DataReplicationFabricProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), string serviceEndpoint = null, Azure.Core.ResourceIdentifier serviceResourceId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? health = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthErrorInfo DataReplicationHealthErrorInfo(Azure.Core.ResourceType? affectedResourceType = default(Azure.Core.ResourceType?), System.Collections.Generic.IEnumerable affectedResourceCorrelationIds = null, System.Collections.Generic.IEnumerable childErrors = null, string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), bool? isCustomerResolvable = default(bool?), string summary = null, string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationInnerHealthErrorInfo DataReplicationInnerHealthErrorInfo(string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), bool? isCustomerResolvable = default(bool?), string summary = null, string message = null, string causes = null, string recommendation = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties DataReplicationJobCustomProperties(string instanceType = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationJobData DataReplicationJobData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties DataReplicationJobProperties(string displayName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState? state = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string objectId = null, string objectName = null, string objectInternalId = null, string objectInternalName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType? objectType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType?), string replicationProviderId = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, System.Collections.Generic.IEnumerable allowedActions = null, string activityId = null, System.Collections.Generic.IEnumerable tasks = null, System.Collections.Generic.IEnumerable errors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityResult DataReplicationNameAvailabilityResult(bool? isNameAvailable = default(bool?), string reason = null, string message = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPolicyData DataReplicationPolicyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties DataReplicationPolicyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionData DataReplicationPrivateEndpointConnectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties DataReplicationPrivateEndpointConnectionProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.Core.ResourceIdentifier privateEndpointId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateEndpointConnectionProxyData DataReplicationPrivateEndpointConnectionProxyData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties properties = null, Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties DataReplicationPrivateEndpointConnectionProxyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint remotePrivateEndpoint = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationPrivateLinkResourceData DataReplicationPrivateLinkResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties DataReplicationPrivateLinkResourceProperties(string groupId = null, System.Collections.Generic.IEnumerable requiredMembers = null, System.Collections.Generic.IEnumerable requiredZoneNames = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationProtectedItemData DataReplicationProtectedItemData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch DataReplicationProtectedItemPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties DataReplicationProtectedItemProperties(string policyName = null, string replicationExtensionName = null, string correlationId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState? protectionState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState?), string protectionStateDescription = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState? testFailoverState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState?), string testFailoverStateDescription = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState? resynchronizationState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState?), string fabricObjectId = null, string fabricObjectName = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, string fabricId = null, string targetFabricId = null, string fabricAgentId = null, string targetFabricAgentId = null, bool? isResyncRequired = default(bool?), System.DateTimeOffset? lastSuccessfulPlannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulUnplannedFailoverOn = default(System.DateTimeOffset?), System.DateTimeOffset? lastSuccessfulTestFailoverOn = default(System.DateTimeOffset?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties currentJob = null, System.Collections.Generic.IEnumerable allowedJobs = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastFailedEnableProtectionJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastFailedPlannedFailoverJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties lastTestFailoverJob = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? replicationHealth = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus?), System.Collections.Generic.IEnumerable healthErrors = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties customProperties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationRecoveryPointData DataReplicationRecoveryPointData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties properties = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties DataReplicationRecoveryPointProperties(System.DateTimeOffset recoveryPointOn = default(System.DateTimeOffset), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType recoveryPointType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties customProperties = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTask DataReplicationTask(string taskName = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState? state = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState?), System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string customInstanceType = null, System.Collections.Generic.IEnumerable childrenJobs = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.DataReplicationVaultData DataReplicationVaultData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch DataReplicationVaultPatch(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties DataReplicationVaultProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? provisioningState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState?), Azure.Core.ResourceIdentifier serviceResourceId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType? vaultType = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobCustomProperties FailoverJobCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties FailoverProtectedItemProperties(string protectedItemName = null, string vmName = null, string testVmName = null, string recoveryPointId = null, System.DateTimeOffset? recoveryPointOn = default(System.DateTimeOffset?), string networkName = null, string subnet = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricCustomProperties HyperVMigrateFabricCustomProperties(Azure.Core.ResourceIdentifier hyperVSiteId = null, Azure.Core.ResourceIdentifier fabricResourceId = null, Azure.Core.ResourceIdentifier fabricContainerId = null, Azure.Core.ResourceIdentifier migrationSolutionId = null, System.Uri migrationHubUri = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciEventCustomProperties HyperVToAzStackHciEventCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciNicInput HyperVToAzStackHciNicInput(string nicId = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection), bool? isStaticIPMigrationEnabled = default(bool?), bool? isMacMigrationEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedDiskProperties HyperVToAzStackHciProtectedDiskProperties(Azure.Core.ResourceIdentifier storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = default(bool?), long? capacityInBytes = default(long?), bool? isDynamic = default(bool?), string diskType = null, long? diskBlockSize = default(long?), long? diskLogicalSectorSize = default(long?), long? diskPhysicalSectorSize = default(long?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomProperties HyperVToAzStackHciProtectedItemCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation?), Azure.Core.ResourceIdentifier targetHciClusterId = null, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId = null, System.Collections.Generic.IEnumerable disksToInclude = null, System.Collections.Generic.IEnumerable nicsToInclude = null, string sourceVmName = null, int? sourceCpuCores = default(int?), double? sourceMemoryInMegaBytes = default(double?), string targetVmName = null, Azure.Core.ResourceIdentifier targetResourceGroupId = null, Azure.Core.ResourceIdentifier storageContainerId = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = default(int?), bool? isDynamicRam = default(bool?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = default(int?), string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string osType = null, string osName = null, string firmwareType = null, string targetLocation = null, string customLocationRegion = null, string failoverRecoveryPointId = null, System.DateTimeOffset? lastRecoveryPointReceivedOn = default(System.DateTimeOffset?), string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = default(int?), int? resyncProgressPercentage = default(int?), System.Collections.Generic.IEnumerable protectedDisks = null, System.Collections.Generic.IEnumerable protectedNics = null, string targetVmBiosId = null, System.DateTimeOffset? lastReplicationUpdateOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedNicProperties HyperVToAzStackHciProtectedNicProperties(string nicId = null, string macAddress = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciRecoveryPointCustomProperties HyperVToAzStackHciRecoveryPointCustomProperties(System.Collections.Generic.IEnumerable diskIds = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciReplicationExtensionCustomProperties HyperVToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier hyperVFabricArmId = null, Azure.Core.ResourceIdentifier hyperVSiteId = null, Azure.Core.ResourceIdentifier azStackHciFabricArmId = null, Azure.Core.ResourceIdentifier azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, System.Uri asrServiceUri = null, System.Uri rcmServiceUri = null, System.Uri gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails JobModelCustomPropertiesAffectedObjectDetails(string description = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType? type = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties ProtectedItemJobProperties(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobCustomProperties TestFailoverCleanupJobCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, string comments = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobCustomProperties TestFailoverJobCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, System.Collections.Generic.IEnumerable protectedItemDetails = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciEventCustomProperties VMwareToAzStackHciEventCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciNicInput VMwareToAzStackHciNicInput(string nicId = null, string label = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection), bool? isStaticIPMigrationEnabled = default(bool?), bool? isMacMigrationEnabled = default(bool?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedDiskProperties VMwareToAzStackHciProtectedDiskProperties(Azure.Core.ResourceIdentifier storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = default(bool?), long? capacityInBytes = default(long?), bool? isDynamic = default(bool?), string diskType = null, long? diskBlockSize = default(long?), long? diskLogicalSectorSize = default(long?), long? diskPhysicalSectorSize = default(long?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomProperties VMwareToAzStackHciProtectedItemCustomProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? activeLocation = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation?), Azure.Core.ResourceIdentifier targetHciClusterId = null, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, Azure.Core.ResourceIdentifier storageContainerId = null, Azure.Core.ResourceIdentifier targetResourceGroupId = null, string targetLocation = null, string customLocationRegion = null, System.Collections.Generic.IEnumerable disksToInclude = null, System.Collections.Generic.IEnumerable nicsToInclude = null, System.Collections.Generic.IEnumerable protectedDisks = null, System.Collections.Generic.IEnumerable protectedNics = null, string targetVmBiosId = null, string targetVmName = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = default(int?), bool? isDynamicRam = default(bool?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = default(int?), string osType = null, string osName = null, string firmwareType = null, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId = null, string sourceVmName = null, int? sourceCpuCores = default(int?), double? sourceMemoryInMegaBytes = default(double?), string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string failoverRecoveryPointId = null, System.DateTimeOffset? lastRecoveryPointReceivedOn = default(System.DateTimeOffset?), string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = default(int?), int? migrationProgressPercentage = default(int?), int? resumeProgressPercentage = default(int?), int? resyncProgressPercentage = default(int?), long? resyncRetryCount = default(long?), bool? resyncRequired = default(bool?), Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState? resyncState = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState?), bool? performAutoResync = default(bool?), long? resumeRetryCount = default(long?), System.DateTimeOffset? lastReplicationUpdateOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedNicProperties VMwareToAzStackHciProtectedNicProperties(string nicId = null, string macAddress = null, string label = null, bool? isPrimaryNic = default(bool?), string networkName = null, string targetNetworkId = null, string testNetworkId = null, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? selectionTypeForFailover = default(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection?)) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciRecoveryPointCustomProperties VMwareToAzStackHciRecoveryPointCustomProperties(System.Collections.Generic.IEnumerable diskIds = null) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciReplicationExtensionCustomProperties VMwareToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier vmwareFabricArmId = null, Azure.Core.ResourceIdentifier vmwareSiteId = null, Azure.Core.ResourceIdentifier azStackHciFabricArmId = null, Azure.Core.ResourceIdentifier azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, System.Uri asrServiceUri = null, System.Uri rcmServiceUri = null, System.Uri gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) { throw null; } + } + public partial class AzStackHciClusterProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzStackHciClusterProperties(string clusterName, string resourceName, string storageAccountName, System.Collections.Generic.IEnumerable storageContainers) { } + public string ClusterName { get { throw null; } set { } } + public string ResourceName { get { throw null; } set { } } + public string StorageAccountName { get { throw null; } set { } } + public System.Collections.Generic.IList StorageContainers { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class AzStackHciFabricCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public AzStackHciFabricCustomProperties(Azure.Core.ResourceIdentifier azStackHciSiteId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties cluster, Azure.Core.ResourceIdentifier migrationSolutionId) { } + public System.Collections.Generic.IReadOnlyList ApplianceName { get { throw null; } } + public Azure.Core.ResourceIdentifier AzStackHciSiteId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciClusterProperties Cluster { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier FabricContainerId { get { throw null; } } + public Azure.Core.ResourceIdentifier FabricResourceId { get { throw null; } } + public System.Uri MigrationHubUri { get { throw null; } } + public Azure.Core.ResourceIdentifier MigrationSolutionId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.AzStackHciFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationDiskControllerInputs : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationDiskControllerInputs(string controllerName, int controllerId, int controllerLocation) { } + public int ControllerId { get { throw null; } set { } } + public int ControllerLocation { get { throw null; } set { } } + public string ControllerName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEmailConfigurationProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationEmailConfigurationProperties(bool sendToOwners) { } + public System.Collections.Generic.IList CustomEmailAddresses { get { throw null; } } + public string Locale { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public bool SendToOwners { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEmailConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationErrorInfo() { } + public string Causes { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationEventCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationEventCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationEventProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationEventProperties() { } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties CustomProperties { get { throw null; } } + public string Description { get { throw null; } } + public string EventName { get { throw null; } } + public string EventType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public System.DateTimeOffset? OccurredOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ResourceName { get { throw null; } } + public Azure.Core.ResourceType? ResourceType { get { throw null; } } + public string Severity { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationExtensionCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationExtensionCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationExtensionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationExtensionProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationFabricAgentCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationFabricAgentCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricAgentProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricAgentProperties(string machineId, string machineName, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity authenticationIdentity, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity resourceAccessIdentity, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity AuthenticationIdentity { get { throw null; } set { } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties CustomProperties { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public bool? IsResponsive { get { throw null; } } + public System.DateTimeOffset? LastHeartbeatOn { get { throw null; } } + public string MachineId { get { throw null; } set { } } + public string MachineName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity ResourceAccessIdentity { get { throw null; } set { } } + public string VersionNumber { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationFabricCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationFabricCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricPatch() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationFabricProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationFabricProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? Health { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ServiceEndpoint { get { throw null; } } + public Azure.Core.ResourceIdentifier ServiceResourceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationHealthErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationHealthErrorInfo() { } + public System.Collections.Generic.IReadOnlyList AffectedResourceCorrelationIds { get { throw null; } } + public Azure.Core.ResourceType? AffectedResourceType { get { throw null; } } + public string Category { get { throw null; } } + public string Causes { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ChildErrors { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string HealthCategory { get { throw null; } } + public bool? IsCustomerResolvable { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Source { get { throw null; } } + public string Summary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationHealthStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationHealthStatus(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus Critical { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus Normal { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus Warning { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationIdentity : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationIdentity(System.Guid tenantId, string applicationId, string objectId, string audience, string aadAuthority) { } + public string AadAuthority { get { throw null; } set { } } + public string ApplicationId { get { throw null; } set { } } + public string Audience { get { throw null; } set { } } + public string ObjectId { get { throw null; } set { } } + public System.Guid TenantId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationInnerHealthErrorInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationInnerHealthErrorInfo() { } + public string Category { get { throw null; } } + public string Causes { get { throw null; } } + public string Code { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } + public string HealthCategory { get { throw null; } } + public bool? IsCustomerResolvable { get { throw null; } } + public string Message { get { throw null; } } + public string Recommendation { get { throw null; } } + public string Severity { get { throw null; } } + public string Source { get { throw null; } } + public string Summary { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationInnerHealthErrorInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationInnerHealthErrorInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationJobCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationJobCustomProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails AffectedObjectDetails { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationJobObjectType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationJobObjectType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType AvsDiskPool { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType Fabric { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType FabricAgent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType Policy { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType ProtectedItem { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType RecoveryPlan { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType ReplicationExtension { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType Vault { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationJobProperties() { } + public string ActivityId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList AllowedActions { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties CustomProperties { get { throw null; } } + public string DisplayName { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } + public string ObjectId { get { throw null; } } + public string ObjectInternalId { get { throw null; } } + public string ObjectInternalName { get { throw null; } } + public string ObjectName { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobObjectType? ObjectType { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ReplicationProviderId { get { throw null; } } + public string SourceFabricProviderId { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState? State { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Tasks { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationJobState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationJobState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Cancelled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Cancelling { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState CompletedWithErrors { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState CompletedWithInformation { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState CompletedWithWarnings { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Started { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationNameAvailabilityContent : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationNameAvailabilityContent() { } + public string Name { get { throw null; } set { } } + public Azure.Core.ResourceType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationNameAvailabilityResult : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationNameAvailabilityResult() { } + public bool? IsNameAvailable { get { throw null; } } + public string Message { get { throw null; } } + public string Reason { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationNameAvailabilityResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationPolicyCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationPolicyCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPolicyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPolicyProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties CustomProperties { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionProperties() { } + public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateEndpointConnectionProxyProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateEndpointConnectionProxyProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint RemotePrivateEndpoint { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionProxyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationPrivateEndpointConnectionStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationPrivateEndpointConnectionStatus(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Approved { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Disconnected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus Rejected { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationPrivateLinkResourceProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationPrivateLinkResourceProperties() { } + public string GroupId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } + public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkResourceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkServiceConnection : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateLinkServiceConnection() { } + public System.Collections.Generic.IList GroupIds { get { throw null; } } + public string Name { get { throw null; } set { } } + public string RequestMessage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkServiceConnectionState : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateLinkServiceConnectionState() { } + public string ActionsRequired { get { throw null; } set { } } + public string Description { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateEndpointConnectionStatus? Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationPrivateLinkServiceProxy : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationPrivateLinkServiceProxy() { } + public System.Collections.Generic.IList GroupConnectivityInformation { get { throw null; } } + public string Id { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier RemotePrivateEndpointConnectionId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceConnectionState RemotePrivateLinkServiceConnectionState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceProxy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPrivateLinkServiceProxy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationProtectedItemCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationProtectedItemCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class DataReplicationProtectedItemCustomPropertiesUpdate : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationProtectedItemCustomPropertiesUpdate() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationProtectedItemPatch() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate CustomProperties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationProtectedItemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationProtectedItemProperties(string policyName, string replicationExtensionName, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties customProperties) { } + public System.Collections.Generic.IReadOnlyList AllowedJobs { get { throw null; } } + public string CorrelationId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties CurrentJob { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties CustomProperties { get { throw null; } set { } } + public string FabricAgentId { get { throw null; } } + public string FabricId { get { throw null; } } + public string FabricObjectId { get { throw null; } } + public string FabricObjectName { get { throw null; } } + public System.Collections.Generic.IReadOnlyList HealthErrors { get { throw null; } } + public bool? IsResyncRequired { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastFailedEnableProtectionJob { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastFailedPlannedFailoverJob { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulPlannedFailoverOn { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulTestFailoverOn { get { throw null; } } + public System.DateTimeOffset? LastSuccessfulUnplannedFailoverOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties LastTestFailoverJob { get { throw null; } } + public string PolicyName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState? ProtectionState { get { throw null; } } + public string ProtectionStateDescription { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public string ReplicationExtensionName { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationHealthStatus? ReplicationHealth { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState? ResynchronizationState { get { throw null; } } + public string SourceFabricProviderId { get { throw null; } } + public string TargetFabricAgentId { get { throw null; } } + public string TargetFabricId { get { throw null; } } + public string TargetFabricProviderId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState? TestFailoverState { get { throw null; } } + public string TestFailoverStateDescription { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationProtectionState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationProtectionState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CancelFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ChangeRecoveryPointStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverFailedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverFailedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverInProgressOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverInProgressOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState CommitFailoverStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState DisablingFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState DisablingProtection { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState EnablingFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState EnablingProtection { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationCompletedOnPrimary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationCompletedOnRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationInProgress { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState InitialReplicationStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState PlannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState Protected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ProtectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ProtectedStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState ReprotectStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverTransitionStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnplannedFailoverTransitionStatesEnd { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnprotectedStatesBegin { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState UnprotectedStatesEnd { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectionState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Creating { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Deleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Deleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + public abstract partial class DataReplicationRecoveryPointCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected DataReplicationRecoveryPointCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationRecoveryPointProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationRecoveryPointProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties CustomProperties { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public System.DateTimeOffset RecoveryPointOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType RecoveryPointType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationRecoveryPointType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationRecoveryPointType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType ApplicationConsistent { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType CrashConsistent { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointType right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationResynchronizationState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationResynchronizationState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState ResynchronizationCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState ResynchronizationFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState ResynchronizationInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationResynchronizationState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationTask : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal DataReplicationTask() { } + public System.Collections.Generic.IReadOnlyList ChildrenJobs { get { throw null; } } + public string CustomInstanceType { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState? State { get { throw null; } } + public string TaskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTask System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTask System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationTaskState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationTaskState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Cancelled { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Failed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Pending { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Skipped { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Started { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState Succeeded { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTaskState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationTestFailoverState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationTestFailoverState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState MarkedForDeletion { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCleanupCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCleanupInitiated { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCompleted { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCompleting { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverCompletionFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverFailed { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState TestFailoverInitiated { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationTestFailoverState right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DataReplicationVaultPatch : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationVaultPatch() { } + public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties Properties { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DataReplicationVaultProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DataReplicationVaultProperties() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProvisioningState? ProvisioningState { get { throw null; } } + public Azure.Core.ResourceIdentifier ServiceResourceId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType? VaultType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct DataReplicationVaultType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public DataReplicationVaultType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType DisasterRecovery { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType Migrate { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationVaultType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class DeploymentPreflight : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentPreflight() { } + public System.Collections.Generic.IList Resources { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflight System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class DeploymentPreflightResourceInfo : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public DeploymentPreflightResourceInfo() { } + public string ApiVersion { get { throw null; } set { } } + public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + public System.BinaryData Properties { get { throw null; } set { } } + public Azure.Core.ResourceType? Type { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.DeploymentPreflightResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FailoverJobCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FailoverJobCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class FailoverProtectedItemProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal FailoverProtectedItemProperties() { } + public string NetworkName { get { throw null; } } + public string ProtectedItemName { get { throw null; } } + public string RecoveryPointId { get { throw null; } } + public System.DateTimeOffset? RecoveryPointOn { get { throw null; } } + public string Subnet { get { throw null; } } + public string TestVmName { get { throw null; } } + public string VmName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.FailoverProtectedItemProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class GroupConnectivityInformation : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public GroupConnectivityInformation() { } + public System.Collections.Generic.IList CustomerVisibleFqdns { get { throw null; } } + public string GroupId { get { throw null; } set { } } + public string InternalFqdn { get { throw null; } set { } } + public string MemberName { get { throw null; } set { } } + public string PrivateLinkServiceArmRegion { get { throw null; } set { } } + public string RedirectMapId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.GroupConnectivityInformation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.GroupConnectivityInformation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVMigrateFabricCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVMigrateFabricCustomProperties(Azure.Core.ResourceIdentifier hyperVSiteId, Azure.Core.ResourceIdentifier migrationSolutionId) { } + public Azure.Core.ResourceIdentifier FabricContainerId { get { throw null; } } + public Azure.Core.ResourceIdentifier FabricResourceId { get { throw null; } } + public Azure.Core.ResourceIdentifier HyperVSiteId { get { throw null; } set { } } + public System.Uri MigrationHubUri { get { throw null; } } + public Azure.Core.ResourceIdentifier MigrationSolutionId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVMigrateFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciDiskInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public long? DiskBlockSize { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs DiskController { get { throw null; } set { } } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public string DiskIdentifier { get { throw null; } set { } } + public long? DiskLogicalSectorSize { get { throw null; } set { } } + public long? DiskPhysicalSectorSize { get { throw null; } set { } } + public long DiskSizeGB { get { throw null; } set { } } + public bool? IsDynamic { get { throw null; } set { } } + public bool IsOSDisk { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciDiskInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciDiskInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciEventCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciEventCustomProperties() { } + public string EventSourceFriendlyName { get { throw null; } } + public string ProtectedItemFriendlyName { get { throw null; } } + public string ServerType { get { throw null; } } + public string SourceApplianceName { get { throw null; } } + public string TargetApplianceName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciEventCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciEventCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciNicInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciNicInput(string nicId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover) { } + public bool? IsMacMigrationEnabled { get { throw null; } set { } } + public bool? IsStaticIPMigrationEnabled { get { throw null; } set { } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectionTypeForFailover { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciNicInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciNicInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciPlannedFailoverCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciPlannedFailoverCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciPolicyCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciPolicyCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) { } + public int AppConsistentFrequencyInMinutes { get { throw null; } set { } } + public int CrashConsistentFrequencyInMinutes { get { throw null; } set { } } + public int RecoveryPointHistoryInMinutes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedDiskProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public long? DiskBlockSize { get { throw null; } } + public long? DiskLogicalSectorSize { get { throw null; } } + public long? DiskPhysicalSectorSize { get { throw null; } } + public string DiskType { get { throw null; } } + public bool? IsDynamic { get { throw null; } } + public bool? IsOSDisk { get { throw null; } } + public string MigrateDiskName { get { throw null; } } + public string SeedDiskName { get { throw null; } } + public string SourceDiskId { get { throw null; } } + public string SourceDiskName { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedItemCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciProtectedItemCustomProperties(Azure.Core.ResourceIdentifier targetHciClusterId, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, Azure.Core.ResourceIdentifier targetResourceGroupId, Azure.Core.ResourceIdentifier storageContainerId, string hyperVGeneration, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, string customLocationRegion) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? ActiveLocation { get { throw null; } } + public string CustomLocationRegion { get { throw null; } set { } } + public System.Collections.Generic.IList DisksToInclude { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier FabricDiscoveryMachineId { get { throw null; } set { } } + public string FailoverRecoveryPointId { get { throw null; } } + public string FirmwareType { get { throw null; } } + public string HyperVGeneration { get { throw null; } set { } } + public int? InitialReplicationProgressPercentage { get { throw null; } } + public bool? IsDynamicRam { get { throw null; } set { } } + public string LastRecoveryPointId { get { throw null; } } + public System.DateTimeOffset? LastRecoveryPointReceivedOn { get { throw null; } } + public System.DateTimeOffset? LastReplicationUpdateOn { get { throw null; } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSName { get { throw null; } } + public string OSType { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedNics { get { throw null; } } + public int? ResyncProgressPercentage { get { throw null; } } + public string RunAsAccountId { get { throw null; } set { } } + public string SourceApplianceName { get { throw null; } } + public int? SourceCpuCores { get { throw null; } } + public string SourceFabricAgentName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetFabricAgentName { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier TargetHciClusterId { get { throw null; } set { } } + public string TargetLocation { get { throw null; } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier TargetResourceGroupId { get { throw null; } set { } } + public string TargetVmBiosId { get { throw null; } } + public string TargetVmName { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedItemCustomPropertiesUpdate : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciProtectedItemCustomPropertiesUpdate() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public bool? IsDynamicRam { get { throw null; } set { } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSType { get { throw null; } set { } } + public int? TargetCpuCores { get { throw null; } set { } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciProtectedNicProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciProtectedNicProperties() { } + public string MacAddress { get { throw null; } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? SelectionTypeForFailover { get { throw null; } } + public string TargetNetworkId { get { throw null; } } + public string TestNetworkId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciRecoveryPointCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal HyperVToAzStackHciRecoveryPointCustomProperties() { } + public System.Collections.Generic.IReadOnlyList DiskIds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class HyperVToAzStackHciReplicationExtensionCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public HyperVToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier hyperVFabricArmId, Azure.Core.ResourceIdentifier azStackHciFabricArmId) { } + public System.Uri AsrServiceUri { get { throw null; } } + public Azure.Core.ResourceIdentifier AzStackHciFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier AzStackHciSiteId { get { throw null; } } + public System.Uri GatewayServiceUri { get { throw null; } } + public Azure.Core.ResourceIdentifier HyperVFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier HyperVSiteId { get { throw null; } } + public System.Uri RcmServiceUri { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceLocation { get { throw null; } } + public string SourceGatewayServiceId { get { throw null; } } + public string SourceStorageContainerName { get { throw null; } } + public string StorageAccountId { get { throw null; } set { } } + public string StorageAccountSasSecretName { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } } + public string TargetGatewayServiceId { get { throw null; } } + public string TargetStorageContainerName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.HyperVToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class JobModelCustomPropertiesAffectedObjectDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal JobModelCustomPropertiesAffectedObjectDetails() { } + public string Description { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType? Type { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct JobModelCustomPropertiesAffectedObjectDetailsType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public JobModelCustomPropertiesAffectedObjectDetailsType(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType Object { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.JobModelCustomPropertiesAffectedObjectDetailsType right) { throw null; } + public override string ToString() { throw null; } + } + public partial class PlannedFailover : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlannedFailover(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverProperties properties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties PlannedFailoverCustomProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailover System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public abstract partial class PlannedFailoverCustomProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + protected PlannedFailoverCustomProperties() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class PlannedFailoverProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public PlannedFailoverProperties(Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties customProperties) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties CustomProperties { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct ProtectedItemActiveLocation : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public ProtectedItemActiveLocation(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation Primary { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation Recovery { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation right) { throw null; } + public override string ToString() { throw null; } + } + public partial class ProtectedItemDynamicMemoryConfig : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public ProtectedItemDynamicMemoryConfig(long maximumMemoryInMegaBytes, long minimumMemoryInMegaBytes, int targetMemoryBufferPercentage) { } + public long MaximumMemoryInMegaBytes { get { throw null; } set { } } + public long MinimumMemoryInMegaBytes { get { throw null; } set { } } + public int TargetMemoryBufferPercentage { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class ProtectedItemJobProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal ProtectedItemJobProperties() { } + public string DisplayName { get { throw null; } } + public System.DateTimeOffset? EndOn { get { throw null; } } + public string Id { get { throw null; } } + public string Name { get { throw null; } } + public string ScenarioName { get { throw null; } } + public System.DateTimeOffset? StartOn { get { throw null; } } + public string State { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RemotePrivateEndpoint : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RemotePrivateEndpoint(string id) { } + public System.Collections.Generic.IList ConnectionDetails { get { throw null; } } + public string Id { get { throw null; } set { } } + public System.Collections.Generic.IList ManualPrivateLinkServiceConnections { get { throw null; } } + public System.Collections.Generic.IList PrivateLinkServiceConnections { get { throw null; } } + public System.Collections.Generic.IList PrivateLinkServiceProxies { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpoint System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class RemotePrivateEndpointConnectionDetails : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public RemotePrivateEndpointConnectionDetails() { } + public string GroupId { get { throw null; } set { } } + public string Id { get { throw null; } set { } } + public string LinkIdentifier { get { throw null; } set { } } + public string MemberName { get { throw null; } set { } } + public string PrivateIPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpointConnectionDetails System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.RemotePrivateEndpointConnectionDetails System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class StorageContainerProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public StorageContainerProperties(string name, string clusterSharedVolumePath) { } + public string ClusterSharedVolumePath { get { throw null; } set { } } + public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.StorageContainerProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.StorageContainerProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestFailoverCleanupJobCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestFailoverCleanupJobCustomProperties() { } + public string Comments { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverCleanupJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class TestFailoverJobCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationJobCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal TestFailoverJobCustomProperties() { } + public System.Collections.Generic.IReadOnlyList ProtectedItemDetails { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.TestFailoverJobCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VmNicSelection : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VmNicSelection(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection NotSelected { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectedByDefault { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectedByUser { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectedByUserOverride { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection right) { throw null; } + public override string ToString() { throw null; } + } + public partial class VMwareFabricAgentCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricAgentCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareFabricAgentCustomProperties(string biosId, Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity marsAuthenticationIdentity) { } + public string BiosId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationIdentity MarsAuthenticationIdentity { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareFabricAgentCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareFabricAgentCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareMigrateFabricCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationFabricCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareMigrateFabricCustomProperties(Azure.Core.ResourceIdentifier vmwareSiteId, Azure.Core.ResourceIdentifier migrationSolutionId) { } + public Azure.Core.ResourceIdentifier MigrationSolutionId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier VmwareSiteId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareMigrateFabricCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareMigrateFabricCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciDiskInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) { } + public long? DiskBlockSize { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationDiskControllerInputs DiskController { get { throw null; } set { } } + public string DiskFileFormat { get { throw null; } set { } } + public string DiskId { get { throw null; } set { } } + public string DiskIdentifier { get { throw null; } set { } } + public long? DiskLogicalSectorSize { get { throw null; } set { } } + public long? DiskPhysicalSectorSize { get { throw null; } set { } } + public long DiskSizeGB { get { throw null; } set { } } + public bool? IsDynamic { get { throw null; } set { } } + public bool IsOSDisk { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciDiskInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciDiskInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciEventCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationEventCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciEventCustomProperties() { } + public string EventSourceFriendlyName { get { throw null; } } + public string ProtectedItemFriendlyName { get { throw null; } } + public string ServerType { get { throw null; } } + public string SourceApplianceName { get { throw null; } } + public string TargetApplianceName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciEventCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciEventCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciNicInput : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciNicInput(string nicId, string label, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection selectionTypeForFailover) { } + public bool? IsMacMigrationEnabled { get { throw null; } set { } } + public bool? IsStaticIPMigrationEnabled { get { throw null; } set { } } + public string Label { get { throw null; } set { } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } set { } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection SelectionTypeForFailover { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciNicInput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciNicInput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciPlannedFailoverCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.PlannedFailoverCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciPlannedFailoverCustomProperties(bool shutdownSourceVm) { } + public bool ShutdownSourceVm { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPlannedFailoverCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciPolicyCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationPolicyCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciPolicyCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) { } + public int AppConsistentFrequencyInMinutes { get { throw null; } set { } } + public int CrashConsistentFrequencyInMinutes { get { throw null; } set { } } + public int RecoveryPointHistoryInMinutes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciPolicyCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedDiskProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciProtectedDiskProperties() { } + public long? CapacityInBytes { get { throw null; } } + public long? DiskBlockSize { get { throw null; } } + public long? DiskLogicalSectorSize { get { throw null; } } + public long? DiskPhysicalSectorSize { get { throw null; } } + public string DiskType { get { throw null; } } + public bool? IsDynamic { get { throw null; } } + public bool? IsOSDisk { get { throw null; } } + public string MigrateDiskName { get { throw null; } } + public string SeedDiskName { get { throw null; } } + public string SourceDiskId { get { throw null; } } + public string SourceDiskName { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } } + public string StorageContainerLocalPath { get { throw null; } } + public string TestMigrateDiskName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedDiskProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedItemCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciProtectedItemCustomProperties(Azure.Core.ResourceIdentifier targetHciClusterId, Azure.Core.ResourceIdentifier targetArcClusterCustomLocationId, Azure.Core.ResourceIdentifier storageContainerId, Azure.Core.ResourceIdentifier targetResourceGroupId, string customLocationRegion, System.Collections.Generic.IEnumerable disksToInclude, System.Collections.Generic.IEnumerable nicsToInclude, string hyperVGeneration, Azure.Core.ResourceIdentifier fabricDiscoveryMachineId, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName) { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemActiveLocation? ActiveLocation { get { throw null; } } + public string CustomLocationRegion { get { throw null; } set { } } + public System.Collections.Generic.IList DisksToInclude { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier FabricDiscoveryMachineId { get { throw null; } set { } } + public string FailoverRecoveryPointId { get { throw null; } } + public string FirmwareType { get { throw null; } } + public string HyperVGeneration { get { throw null; } set { } } + public int? InitialReplicationProgressPercentage { get { throw null; } } + public bool? IsDynamicRam { get { throw null; } set { } } + public string LastRecoveryPointId { get { throw null; } } + public System.DateTimeOffset? LastRecoveryPointReceivedOn { get { throw null; } } + public System.DateTimeOffset? LastReplicationUpdateOn { get { throw null; } } + public int? MigrationProgressPercentage { get { throw null; } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSName { get { throw null; } } + public string OSType { get { throw null; } } + public bool? PerformAutoResync { get { throw null; } set { } } + public System.Collections.Generic.IReadOnlyList ProtectedDisks { get { throw null; } } + public System.Collections.Generic.IReadOnlyList ProtectedNics { get { throw null; } } + public int? ResumeProgressPercentage { get { throw null; } } + public long? ResumeRetryCount { get { throw null; } } + public int? ResyncProgressPercentage { get { throw null; } } + public bool? ResyncRequired { get { throw null; } } + public long? ResyncRetryCount { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState? ResyncState { get { throw null; } } + public string RunAsAccountId { get { throw null; } set { } } + public string SourceApplianceName { get { throw null; } } + public int? SourceCpuCores { get { throw null; } } + public string SourceFabricAgentName { get { throw null; } set { } } + public double? SourceMemoryInMegaBytes { get { throw null; } } + public string SourceVmName { get { throw null; } } + public Azure.Core.ResourceIdentifier StorageContainerId { get { throw null; } set { } } + public string TargetApplianceName { get { throw null; } } + public Azure.Core.ResourceIdentifier TargetArcClusterCustomLocationId { get { throw null; } set { } } + public string TargetAzStackHciClusterName { get { throw null; } } + public int? TargetCpuCores { get { throw null; } set { } } + public string TargetFabricAgentName { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier TargetHciClusterId { get { throw null; } set { } } + public string TargetLocation { get { throw null; } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + public string TargetNetworkId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier TargetResourceGroupId { get { throw null; } set { } } + public string TargetVmBiosId { get { throw null; } } + public string TargetVmName { get { throw null; } set { } } + public string TestNetworkId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedItemCustomPropertiesUpdate : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationProtectedItemCustomPropertiesUpdate, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciProtectedItemCustomPropertiesUpdate() { } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get { throw null; } set { } } + public bool? IsDynamicRam { get { throw null; } set { } } + public System.Collections.Generic.IList NicsToInclude { get { throw null; } } + public string OSType { get { throw null; } set { } } + public int? TargetCpuCores { get { throw null; } set { } } + public int? TargetMemoryInMegaBytes { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedItemCustomPropertiesUpdate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciProtectedNicProperties : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciProtectedNicProperties() { } + public bool? IsPrimaryNic { get { throw null; } } + public string Label { get { throw null; } } + public string MacAddress { get { throw null; } } + public string NetworkName { get { throw null; } } + public string NicId { get { throw null; } } + public Azure.ResourceManager.RecoveryServicesDataReplication.Models.VmNicSelection? SelectionTypeForFailover { get { throw null; } } + public string TargetNetworkId { get { throw null; } } + public string TestNetworkId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciProtectedNicProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciRecoveryPointCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationRecoveryPointCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + internal VMwareToAzStackHciRecoveryPointCustomProperties() { } + public System.Collections.Generic.IReadOnlyList DiskIds { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciRecoveryPointCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + public partial class VMwareToAzStackHciReplicationExtensionCustomProperties : Azure.ResourceManager.RecoveryServicesDataReplication.Models.DataReplicationExtensionCustomProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel + { + public VMwareToAzStackHciReplicationExtensionCustomProperties(Azure.Core.ResourceIdentifier vmwareFabricArmId, Azure.Core.ResourceIdentifier azStackHciFabricArmId) { } + public System.Uri AsrServiceUri { get { throw null; } } + public Azure.Core.ResourceIdentifier AzStackHciFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier AzStackHciSiteId { get { throw null; } } + public System.Uri GatewayServiceUri { get { throw null; } } + public System.Uri RcmServiceUri { get { throw null; } } + public string ResourceGroup { get { throw null; } } + public string ResourceLocation { get { throw null; } } + public string SourceGatewayServiceId { get { throw null; } } + public string SourceStorageContainerName { get { throw null; } } + public string StorageAccountId { get { throw null; } set { } } + public string StorageAccountSasSecretName { get { throw null; } set { } } + public string SubscriptionId { get { throw null; } } + public string TargetGatewayServiceId { get { throw null; } } + public string TargetStorageContainerName { get { throw null; } } + public Azure.Core.ResourceIdentifier VmwareFabricArmId { get { throw null; } set { } } + public Azure.Core.ResourceIdentifier VmwareSiteId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } + Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzStackHciReplicationExtensionCustomProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + string System.ClientModel.Primitives.IPersistableModel.GetFormatFromOptions(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + System.BinaryData System.ClientModel.Primitives.IPersistableModel.Write(System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct VMwareToAzureMigrateResyncState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public VMwareToAzureMigrateResyncState(string value) { throw null; } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState None { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState PreparedForResynchronization { get { throw null; } } + public static Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState StartedResynchronization { get { throw null; } } + public bool Equals(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState right) { throw null; } + public static implicit operator Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState left, Azure.ResourceManager.RecoveryServicesDataReplication.Models.VMwareToAzureMigrateResyncState right) { throw null; } + public override string ToString() { throw null; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/assets.json b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/assets.json new file mode 100644 index 000000000000..f70a74c582ba --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication", + "Tag": "" +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Azure.ResourceManager.RecoveryServicesDataReplication.Samples.csproj b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Azure.ResourceManager.RecoveryServicesDataReplication.Samples.csproj new file mode 100644 index 000000000000..cebebad85cc8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Azure.ResourceManager.RecoveryServicesDataReplication.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationCollection.cs new file mode 100644 index 000000000000..8937987d88b3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationEmailConfigurationCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesEmailConfigurationSettings() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Create.json + // this example is just showing the usage of "EmailConfigurationModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEmailConfigurationResource + DataReplicationEmailConfigurationCollection collection = dataReplicationVault.GetDataReplicationEmailConfigurations(); + + // invoke the operation + string emailConfigurationName = "0"; + DataReplicationEmailConfigurationData data = new DataReplicationEmailConfigurationData + { + Properties = new DataReplicationEmailConfigurationProperties(true) + { + CustomEmailAddresses = { "ketvbducyailcny" }, + Locale = "vpnjxjvdqtebnucyxiyrjiko", + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, emailConfigurationName, data); + DataReplicationEmailConfigurationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEmailConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheEmailConfigurationSetting() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Get.json + // this example is just showing the usage of "EmailConfigurationModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEmailConfigurationResource + DataReplicationEmailConfigurationCollection collection = dataReplicationVault.GetDataReplicationEmailConfigurations(); + + // invoke the operation + string emailConfigurationName = "0"; + DataReplicationEmailConfigurationResource result = await collection.GetAsync(emailConfigurationName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEmailConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheEmailConfigurationSettings() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_List.json + // this example is just showing the usage of "EmailConfigurationModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEmailConfigurationResource + DataReplicationEmailConfigurationCollection collection = dataReplicationVault.GetDataReplicationEmailConfigurations(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationEmailConfigurationResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEmailConfigurationData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheEmailConfigurationSetting() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Get.json + // this example is just showing the usage of "EmailConfigurationModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEmailConfigurationResource + DataReplicationEmailConfigurationCollection collection = dataReplicationVault.GetDataReplicationEmailConfigurations(); + + // invoke the operation + string emailConfigurationName = "0"; + bool result = await collection.ExistsAsync(emailConfigurationName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheEmailConfigurationSetting() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Get.json + // this example is just showing the usage of "EmailConfigurationModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEmailConfigurationResource + DataReplicationEmailConfigurationCollection collection = dataReplicationVault.GetDataReplicationEmailConfigurations(); + + // invoke the operation + string emailConfigurationName = "0"; + NullableResponse response = await collection.GetIfExistsAsync(emailConfigurationName); + DataReplicationEmailConfigurationResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEmailConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationResource.cs new file mode 100644 index 000000000000..3c4b0cc028a9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEmailConfigurationResource.cs @@ -0,0 +1,90 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationEmailConfigurationResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheEmailConfigurationSetting() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Get.json + // this example is just showing the usage of "EmailConfigurationModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationEmailConfigurationResource created on azure + // for more information of creating DataReplicationEmailConfigurationResource, please refer to the document of DataReplicationEmailConfigurationResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string emailConfigurationName = "0"; + ResourceIdentifier dataReplicationEmailConfigurationResourceId = DataReplicationEmailConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, emailConfigurationName); + DataReplicationEmailConfigurationResource dataReplicationEmailConfiguration = client.GetDataReplicationEmailConfigurationResource(dataReplicationEmailConfigurationResourceId); + + // invoke the operation + DataReplicationEmailConfigurationResource result = await dataReplicationEmailConfiguration.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEmailConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreatesEmailConfigurationSettings() + { + // Generated from example definition: 2024-09-01/EmailConfiguration_Create.json + // this example is just showing the usage of "EmailConfigurationModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationEmailConfigurationResource created on azure + // for more information of creating DataReplicationEmailConfigurationResource, please refer to the document of DataReplicationEmailConfigurationResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string emailConfigurationName = "0"; + ResourceIdentifier dataReplicationEmailConfigurationResourceId = DataReplicationEmailConfigurationResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, emailConfigurationName); + DataReplicationEmailConfigurationResource dataReplicationEmailConfiguration = client.GetDataReplicationEmailConfigurationResource(dataReplicationEmailConfigurationResourceId); + + // invoke the operation + DataReplicationEmailConfigurationData data = new DataReplicationEmailConfigurationData + { + Properties = new DataReplicationEmailConfigurationProperties(true) + { + CustomEmailAddresses = { "ketvbducyailcny" }, + Locale = "vpnjxjvdqtebnucyxiyrjiko", + }, + }; + ArmOperation lro = await dataReplicationEmailConfiguration.UpdateAsync(WaitUntil.Completed, data); + DataReplicationEmailConfigurationResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEmailConfigurationData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventCollection.cs new file mode 100644 index 000000000000..3a0cf69cd8eb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventCollection.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationEventCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheEvent() + { + // Generated from example definition: 2024-09-01/Event_Get.json + // this example is just showing the usage of "EventModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEventResource + DataReplicationEventCollection collection = dataReplicationVault.GetDataReplicationEvents(); + + // invoke the operation + string eventName = "231CIG"; + DataReplicationEventResource result = await collection.GetAsync(eventName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEventData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheEvents() + { + // Generated from example definition: 2024-09-01/Event_List.json + // this example is just showing the usage of "EventModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEventResource + DataReplicationEventCollection collection = dataReplicationVault.GetDataReplicationEvents(); + + // invoke the operation and iterate over the result + string continuationToken = "gabpzsxrifposvleqqcjnvofz"; + await foreach (DataReplicationEventResource item in collection.GetAllAsync(continuationToken: continuationToken)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEventData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheEvent() + { + // Generated from example definition: 2024-09-01/Event_Get.json + // this example is just showing the usage of "EventModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEventResource + DataReplicationEventCollection collection = dataReplicationVault.GetDataReplicationEvents(); + + // invoke the operation + string eventName = "231CIG"; + bool result = await collection.ExistsAsync(eventName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheEvent() + { + // Generated from example definition: 2024-09-01/Event_Get.json + // this example is just showing the usage of "EventModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationEventResource + DataReplicationEventCollection collection = dataReplicationVault.GetDataReplicationEvents(); + + // invoke the operation + string eventName = "231CIG"; + NullableResponse response = await collection.GetIfExistsAsync(eventName); + DataReplicationEventResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEventData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventResource.cs new file mode 100644 index 000000000000..f0646e012c1f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationEventResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationEventResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheEvent() + { + // Generated from example definition: 2024-09-01/Event_Get.json + // this example is just showing the usage of "EventModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationEventResource created on azure + // for more information of creating DataReplicationEventResource, please refer to the document of DataReplicationEventResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string eventName = "231CIG"; + ResourceIdentifier dataReplicationEventResourceId = DataReplicationEventResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, eventName); + DataReplicationEventResource dataReplicationEvent = client.GetDataReplicationEventResource(dataReplicationEventResourceId); + + // invoke the operation + DataReplicationEventResource result = await dataReplicationEvent.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationEventData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionCollection.cs new file mode 100644 index 000000000000..8333737e2075 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionCollection.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationExtensionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Create.json + // this example is just showing the usage of "ReplicationExtensionModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationExtensionResource + DataReplicationExtensionCollection collection = dataReplicationVault.GetDataReplicationExtensions(); + + // invoke the operation + string replicationExtensionName = "g16yjJ"; + DataReplicationExtensionData data = new DataReplicationExtensionData + { + Properties = new DataReplicationExtensionProperties(null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, replicationExtensionName, data); + DataReplicationExtensionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationExtensionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Get.json + // this example is just showing the usage of "ReplicationExtensionModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationExtensionResource + DataReplicationExtensionCollection collection = dataReplicationVault.GetDataReplicationExtensions(); + + // invoke the operation + string replicationExtensionName = "g16yjJ"; + DataReplicationExtensionResource result = await collection.GetAsync(replicationExtensionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationExtensionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheReplicationExtensions() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_List.json + // this example is just showing the usage of "ReplicationExtensionModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationExtensionResource + DataReplicationExtensionCollection collection = dataReplicationVault.GetDataReplicationExtensions(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationExtensionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationExtensionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Get.json + // this example is just showing the usage of "ReplicationExtensionModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationExtensionResource + DataReplicationExtensionCollection collection = dataReplicationVault.GetDataReplicationExtensions(); + + // invoke the operation + string replicationExtensionName = "g16yjJ"; + bool result = await collection.ExistsAsync(replicationExtensionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Get.json + // this example is just showing the usage of "ReplicationExtensionModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationExtensionResource + DataReplicationExtensionCollection collection = dataReplicationVault.GetDataReplicationExtensions(); + + // invoke the operation + string replicationExtensionName = "g16yjJ"; + NullableResponse response = await collection.GetIfExistsAsync(replicationExtensionName); + DataReplicationExtensionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationExtensionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionResource.cs new file mode 100644 index 000000000000..237c968b26c9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationExtensionResource.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationExtensionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Get.json + // this example is just showing the usage of "ReplicationExtensionModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationExtensionResource created on azure + // for more information of creating DataReplicationExtensionResource, please refer to the document of DataReplicationExtensionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string replicationExtensionName = "g16yjJ"; + ResourceIdentifier dataReplicationExtensionResourceId = DataReplicationExtensionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + DataReplicationExtensionResource dataReplicationExtension = client.GetDataReplicationExtensionResource(dataReplicationExtensionResourceId); + + // invoke the operation + DataReplicationExtensionResource result = await dataReplicationExtension.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationExtensionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Delete.json + // this example is just showing the usage of "ReplicationExtensionModel_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationExtensionResource created on azure + // for more information of creating DataReplicationExtensionResource, please refer to the document of DataReplicationExtensionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string replicationExtensionName = "g16yjJ"; + ResourceIdentifier dataReplicationExtensionResourceId = DataReplicationExtensionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + DataReplicationExtensionResource dataReplicationExtension = client.GetDataReplicationExtensionResource(dataReplicationExtensionResourceId); + + // invoke the operation + await dataReplicationExtension.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PutsTheReplicationExtension() + { + // Generated from example definition: 2024-09-01/ReplicationExtension_Create.json + // this example is just showing the usage of "ReplicationExtensionModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationExtensionResource created on azure + // for more information of creating DataReplicationExtensionResource, please refer to the document of DataReplicationExtensionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string replicationExtensionName = "g16yjJ"; + ResourceIdentifier dataReplicationExtensionResourceId = DataReplicationExtensionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + DataReplicationExtensionResource dataReplicationExtension = client.GetDataReplicationExtensionResource(dataReplicationExtensionResourceId); + + // invoke the operation + DataReplicationExtensionData data = new DataReplicationExtensionData + { + Properties = new DataReplicationExtensionProperties(null), + }; + ArmOperation lro = await dataReplicationExtension.UpdateAsync(WaitUntil.Completed, data); + DataReplicationExtensionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationExtensionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentCollection.cs new file mode 100644 index 000000000000..53cd90f00db8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentCollection.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationFabricAgentCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Create.json + // this example is just showing the usage of "FabricAgentModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // get the collection of this DataReplicationFabricAgentResource + DataReplicationFabricAgentCollection collection = dataReplicationFabric.GetDataReplicationFabricAgents(); + + // invoke the operation + string fabricAgentName = "M"; + DataReplicationFabricAgentData data = new DataReplicationFabricAgentData + { + Properties = new DataReplicationFabricAgentProperties("envzcoijbqhtrpncbjbhk", "y", new DataReplicationIdentity(Guid.Parse("joclkkdovixwapephhxaqtefubhhmq"), "cwktzrwajuvfyyymfstpey", "khsiaqfbpuhp", "dkjobanyqgzenivyxhvavottpc", "bubwwbowfhdmujrt"), new DataReplicationIdentity(Guid.Parse("joclkkdovixwapephhxaqtefubhhmq"), "cwktzrwajuvfyyymfstpey", "khsiaqfbpuhp", "dkjobanyqgzenivyxhvavottpc", "bubwwbowfhdmujrt"), null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fabricAgentName, data); + DataReplicationFabricAgentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricAgentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Get.json + // this example is just showing the usage of "FabricAgentModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // get the collection of this DataReplicationFabricAgentResource + DataReplicationFabricAgentCollection collection = dataReplicationFabric.GetDataReplicationFabricAgents(); + + // invoke the operation + string fabricAgentName = "M"; + DataReplicationFabricAgentResource result = await collection.GetAsync(fabricAgentName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricAgentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheFabricAgents() + { + // Generated from example definition: 2024-09-01/FabricAgent_List.json + // this example is just showing the usage of "FabricAgentModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // get the collection of this DataReplicationFabricAgentResource + DataReplicationFabricAgentCollection collection = dataReplicationFabric.GetDataReplicationFabricAgents(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationFabricAgentResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricAgentData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Get.json + // this example is just showing the usage of "FabricAgentModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // get the collection of this DataReplicationFabricAgentResource + DataReplicationFabricAgentCollection collection = dataReplicationFabric.GetDataReplicationFabricAgents(); + + // invoke the operation + string fabricAgentName = "M"; + bool result = await collection.ExistsAsync(fabricAgentName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Get.json + // this example is just showing the usage of "FabricAgentModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // get the collection of this DataReplicationFabricAgentResource + DataReplicationFabricAgentCollection collection = dataReplicationFabric.GetDataReplicationFabricAgents(); + + // invoke the operation + string fabricAgentName = "M"; + NullableResponse response = await collection.GetIfExistsAsync(fabricAgentName); + DataReplicationFabricAgentResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricAgentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentResource.cs new file mode 100644 index 000000000000..f02d276b5c8f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricAgentResource.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationFabricAgentResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Get.json + // this example is just showing the usage of "FabricAgentModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricAgentResource created on azure + // for more information of creating DataReplicationFabricAgentResource, please refer to the document of DataReplicationFabricAgentResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + string fabricAgentName = "M"; + ResourceIdentifier dataReplicationFabricAgentResourceId = DataReplicationFabricAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + DataReplicationFabricAgentResource dataReplicationFabricAgent = client.GetDataReplicationFabricAgentResource(dataReplicationFabricAgentResourceId); + + // invoke the operation + DataReplicationFabricAgentResource result = await dataReplicationFabricAgent.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricAgentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Delete.json + // this example is just showing the usage of "FabricAgentModel_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricAgentResource created on azure + // for more information of creating DataReplicationFabricAgentResource, please refer to the document of DataReplicationFabricAgentResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + string fabricAgentName = "M"; + ResourceIdentifier dataReplicationFabricAgentResourceId = DataReplicationFabricAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + DataReplicationFabricAgentResource dataReplicationFabricAgent = client.GetDataReplicationFabricAgentResource(dataReplicationFabricAgentResourceId); + + // invoke the operation + await dataReplicationFabricAgent.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PutsTheFabricAgent() + { + // Generated from example definition: 2024-09-01/FabricAgent_Create.json + // this example is just showing the usage of "FabricAgentModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricAgentResource created on azure + // for more information of creating DataReplicationFabricAgentResource, please refer to the document of DataReplicationFabricAgentResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + string fabricAgentName = "M"; + ResourceIdentifier dataReplicationFabricAgentResourceId = DataReplicationFabricAgentResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + DataReplicationFabricAgentResource dataReplicationFabricAgent = client.GetDataReplicationFabricAgentResource(dataReplicationFabricAgentResourceId); + + // invoke the operation + DataReplicationFabricAgentData data = new DataReplicationFabricAgentData + { + Properties = new DataReplicationFabricAgentProperties("envzcoijbqhtrpncbjbhk", "y", new DataReplicationIdentity(Guid.Parse("joclkkdovixwapephhxaqtefubhhmq"), "cwktzrwajuvfyyymfstpey", "khsiaqfbpuhp", "dkjobanyqgzenivyxhvavottpc", "bubwwbowfhdmujrt"), new DataReplicationIdentity(Guid.Parse("joclkkdovixwapephhxaqtefubhhmq"), "cwktzrwajuvfyyymfstpey", "khsiaqfbpuhp", "dkjobanyqgzenivyxhvavottpc", "bubwwbowfhdmujrt"), null), + }; + ArmOperation lro = await dataReplicationFabricAgent.UpdateAsync(WaitUntil.Completed, data); + DataReplicationFabricAgentResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricAgentData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricCollection.cs new file mode 100644 index 000000000000..6578b367b17c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricCollection.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationFabricCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Create.json + // this example is just showing the usage of "FabricModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationFabricResource + DataReplicationFabricCollection collection = resourceGroupResource.GetDataReplicationFabrics(); + + // invoke the operation + string fabricName = "wPR"; + DataReplicationFabricData data = new DataReplicationFabricData(new AzureLocation("tqygutlpob")) + { + Properties = new DataReplicationFabricProperties(null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, fabricName, data); + DataReplicationFabricResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Get.json + // this example is just showing the usage of "FabricModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationFabricResource + DataReplicationFabricCollection collection = resourceGroupResource.GetDataReplicationFabrics(); + + // invoke the operation + string fabricName = "wPR"; + DataReplicationFabricResource result = await collection.GetAsync(fabricName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheFabrics() + { + // Generated from example definition: 2024-09-01/Fabric_List.json + // this example is just showing the usage of "FabricModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationFabricResource + DataReplicationFabricCollection collection = resourceGroupResource.GetDataReplicationFabrics(); + + // invoke the operation and iterate over the result + string continuationToken = "jw"; + await foreach (DataReplicationFabricResource item in collection.GetAllAsync(continuationToken: continuationToken)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Get.json + // this example is just showing the usage of "FabricModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationFabricResource + DataReplicationFabricCollection collection = resourceGroupResource.GetDataReplicationFabrics(); + + // invoke the operation + string fabricName = "wPR"; + bool result = await collection.ExistsAsync(fabricName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Get.json + // this example is just showing the usage of "FabricModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationFabricResource + DataReplicationFabricCollection collection = resourceGroupResource.GetDataReplicationFabrics(); + + // invoke the operation + string fabricName = "wPR"; + NullableResponse response = await collection.GetIfExistsAsync(fabricName); + DataReplicationFabricResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricResource.cs new file mode 100644 index 000000000000..e3b3757ec21a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationFabricResource.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationFabricResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Get.json + // this example is just showing the usage of "FabricModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // invoke the operation + DataReplicationFabricResource result = await dataReplicationFabric.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Delete.json + // this example is just showing the usage of "FabricModel_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // invoke the operation + await dataReplicationFabric.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdatesTheFabric() + { + // Generated from example definition: 2024-09-01/Fabric_Update.json + // this example is just showing the usage of "FabricModel_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationFabricResource created on azure + // for more information of creating DataReplicationFabricResource, please refer to the document of DataReplicationFabricResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string fabricName = "wPR"; + ResourceIdentifier dataReplicationFabricResourceId = DataReplicationFabricResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, fabricName); + DataReplicationFabricResource dataReplicationFabric = client.GetDataReplicationFabricResource(dataReplicationFabricResourceId); + + // invoke the operation + DataReplicationFabricPatch patch = new DataReplicationFabricPatch + { + Tags = { }, + Properties = new DataReplicationFabricProperties(null), + }; + ArmOperation lro = await dataReplicationFabric.UpdateAsync(WaitUntil.Completed, patch); + DataReplicationFabricResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobCollection.cs new file mode 100644 index 000000000000..295a2fc2e6ed --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobCollection.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationJobCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheJob() + { + // Generated from example definition: 2024-09-01/Job_Get.json + // this example is just showing the usage of "JobModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationJobResource + DataReplicationJobCollection collection = dataReplicationVault.GetDataReplicationJobs(); + + // invoke the operation + string jobName = "ZGH4y"; + DataReplicationJobResource result = await collection.GetAsync(jobName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheJobs() + { + // Generated from example definition: 2024-09-01/Job_List.json + // this example is just showing the usage of "JobModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationJobResource + DataReplicationJobCollection collection = dataReplicationVault.GetDataReplicationJobs(); + + // invoke the operation and iterate over the result + string continuationToken = "rdavrzbethhslmkqgajontnxsue"; + await foreach (DataReplicationJobResource item in collection.GetAllAsync(continuationToken: continuationToken)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationJobData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheJob() + { + // Generated from example definition: 2024-09-01/Job_Get.json + // this example is just showing the usage of "JobModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationJobResource + DataReplicationJobCollection collection = dataReplicationVault.GetDataReplicationJobs(); + + // invoke the operation + string jobName = "ZGH4y"; + bool result = await collection.ExistsAsync(jobName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheJob() + { + // Generated from example definition: 2024-09-01/Job_Get.json + // this example is just showing the usage of "JobModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationJobResource + DataReplicationJobCollection collection = dataReplicationVault.GetDataReplicationJobs(); + + // invoke the operation + string jobName = "ZGH4y"; + NullableResponse response = await collection.GetIfExistsAsync(jobName); + DataReplicationJobResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobResource.cs new file mode 100644 index 000000000000..4d35112545de --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationJobResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationJobResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheJob() + { + // Generated from example definition: 2024-09-01/Job_Get.json + // this example is just showing the usage of "JobModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationJobResource created on azure + // for more information of creating DataReplicationJobResource, please refer to the document of DataReplicationJobResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string jobName = "ZGH4y"; + ResourceIdentifier dataReplicationJobResourceId = DataReplicationJobResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, jobName); + DataReplicationJobResource dataReplicationJob = client.GetDataReplicationJobResource(dataReplicationJobResourceId); + + // invoke the operation + DataReplicationJobResource result = await dataReplicationJob.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationJobData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyCollection.cs new file mode 100644 index 000000000000..aad7c15fac50 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyCollection.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPolicyCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Create.json + // this example is just showing the usage of "PolicyModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPolicyResource + DataReplicationPolicyCollection collection = dataReplicationVault.GetDataReplicationPolicies(); + + // invoke the operation + string policyName = "fafqwc"; + DataReplicationPolicyData data = new DataReplicationPolicyData + { + Properties = new DataReplicationPolicyProperties(null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, policyName, data); + DataReplicationPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Get.json + // this example is just showing the usage of "PolicyModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPolicyResource + DataReplicationPolicyCollection collection = dataReplicationVault.GetDataReplicationPolicies(); + + // invoke the operation + string policyName = "wdqsacasc"; + DataReplicationPolicyResource result = await collection.GetAsync(policyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsThePolicies() + { + // Generated from example definition: 2024-09-01/Policy_List.json + // this example is just showing the usage of "PolicyModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPolicyResource + DataReplicationPolicyCollection collection = dataReplicationVault.GetDataReplicationPolicies(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationPolicyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPolicyData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Get.json + // this example is just showing the usage of "PolicyModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPolicyResource + DataReplicationPolicyCollection collection = dataReplicationVault.GetDataReplicationPolicies(); + + // invoke the operation + string policyName = "wdqsacasc"; + bool result = await collection.ExistsAsync(policyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Get.json + // this example is just showing the usage of "PolicyModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPolicyResource + DataReplicationPolicyCollection collection = dataReplicationVault.GetDataReplicationPolicies(); + + // invoke the operation + string policyName = "wdqsacasc"; + NullableResponse response = await collection.GetIfExistsAsync(policyName); + DataReplicationPolicyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyResource.cs new file mode 100644 index 000000000000..e76b004b6589 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPolicyResource.cs @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPolicyResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Get.json + // this example is just showing the usage of "PolicyModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPolicyResource created on azure + // for more information of creating DataReplicationPolicyResource, please refer to the document of DataReplicationPolicyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string policyName = "wdqsacasc"; + ResourceIdentifier dataReplicationPolicyResourceId = DataReplicationPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, policyName); + DataReplicationPolicyResource dataReplicationPolicy = client.GetDataReplicationPolicyResource(dataReplicationPolicyResourceId); + + // invoke the operation + DataReplicationPolicyResource result = await dataReplicationPolicy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Delete.json + // this example is just showing the usage of "PolicyModel_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPolicyResource created on azure + // for more information of creating DataReplicationPolicyResource, please refer to the document of DataReplicationPolicyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string policyName = "wqfscsdv"; + ResourceIdentifier dataReplicationPolicyResourceId = DataReplicationPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, policyName); + DataReplicationPolicyResource dataReplicationPolicy = client.GetDataReplicationPolicyResource(dataReplicationPolicyResourceId); + + // invoke the operation + await dataReplicationPolicy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_PutsThePolicy() + { + // Generated from example definition: 2024-09-01/Policy_Create.json + // this example is just showing the usage of "PolicyModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPolicyResource created on azure + // for more information of creating DataReplicationPolicyResource, please refer to the document of DataReplicationPolicyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string policyName = "fafqwc"; + ResourceIdentifier dataReplicationPolicyResourceId = DataReplicationPolicyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, policyName); + DataReplicationPolicyResource dataReplicationPolicy = client.GetDataReplicationPolicyResource(dataReplicationPolicyResourceId); + + // invoke the operation + DataReplicationPolicyData data = new DataReplicationPolicyData + { + Properties = new DataReplicationPolicyProperties(null), + }; + ArmOperation lro = await dataReplicationPolicy.UpdateAsync(WaitUntil.Completed, data); + DataReplicationPolicyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPolicyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..a01eefd0873b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionCollection.cs @@ -0,0 +1,209 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPrivateEndpointConnectionCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_UpdatesThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Update.json + // this example is just showing the usage of "PrivateEndpointConnection_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionResource + DataReplicationPrivateEndpointConnectionCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "jitf"; + DataReplicationPrivateEndpointConnectionData data = new DataReplicationPrivateEndpointConnectionData + { + Properties = new DataReplicationPrivateEndpointConnectionProperties + { + PrivateEndpointId = new ResourceIdentifier("cwcdqoynostmqwdwy"), + PrivateLinkServiceConnectionState = new DataReplicationPrivateLinkServiceConnectionState + { + Status = DataReplicationPrivateEndpointConnectionStatus.Approved, + Description = "y", + ActionsRequired = "afwbq", + }, + }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionName, data); + DataReplicationPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Get.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionResource + DataReplicationPrivateEndpointConnectionCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "vbkm"; + DataReplicationPrivateEndpointConnectionResource result = await collection.GetAsync(privateEndpointConnectionName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsThePrivateEndpointConnections() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_List.json + // this example is just showing the usage of "PrivateEndpointConnection_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionResource + DataReplicationPrivateEndpointConnectionCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnections(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationPrivateEndpointConnectionResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Get.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionResource + DataReplicationPrivateEndpointConnectionCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "vbkm"; + bool result = await collection.ExistsAsync(privateEndpointConnectionName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Get.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionResource + DataReplicationPrivateEndpointConnectionCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnections(); + + // invoke the operation + string privateEndpointConnectionName = "vbkm"; + NullableResponse response = await collection.GetIfExistsAsync(privateEndpointConnectionName); + DataReplicationPrivateEndpointConnectionResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyCollection.cs new file mode 100644 index 000000000000..3478399b0a8d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyCollection.cs @@ -0,0 +1,246 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPrivateEndpointConnectionProxyCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_CreatesThePrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Create.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionProxyResource + DataReplicationPrivateEndpointConnectionProxyCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnectionProxies(); + + // invoke the operation + string privateEndpointConnectionProxyName = "d"; + DataReplicationPrivateEndpointConnectionProxyData data = new DataReplicationPrivateEndpointConnectionProxyData + { + Properties = new DataReplicationPrivateEndpointConnectionProxyProperties + { + RemotePrivateEndpoint = new RemotePrivateEndpoint("yipalno") + { + PrivateLinkServiceConnections = {new DataReplicationPrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + ManualPrivateLinkServiceConnections = {new DataReplicationPrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + PrivateLinkServiceProxies = {new DataReplicationPrivateLinkServiceProxy +{ +Id = "nzqxevuyqeedrqnkbnlcyrrrbzxvl", +RemotePrivateLinkServiceConnectionState = new DataReplicationPrivateLinkServiceConnectionState +{ +Status = DataReplicationPrivateEndpointConnectionStatus.Approved, +Description = "y", +ActionsRequired = "afwbq", +}, +RemotePrivateEndpointConnectionId = new ResourceIdentifier("ocunsgawjsqohkrcyxiv"), +GroupConnectivityInformation = {new GroupConnectivityInformation +{ +GroupId = "per", +MemberName = "ybptuypgdqoxkuwqx", +CustomerVisibleFqdns = {"vedcg"}, +InternalFqdn = "maqavwhxwzzhbzjbryyquvitmup", +RedirectMapId = "pezncxcq", +PrivateLinkServiceArmRegion = "rerkqqxinteevmlbrdkktaqhcch", +}}, +}}, + ConnectionDetails = {new RemotePrivateEndpointConnectionDetails +{ +Id = "lenqkogzkes", +PrivateIPAddress = "cyiacdzzyqmxjpijjbwgasegehtqe", +LinkIdentifier = "ravfufhkdowufd", +GroupId = "pjrlygpadir", +MemberName = "ybuysjrlfupewxe", +}}, + }, + }, + ETag = new ETag("hruibxrezstxroxrxweh"), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, privateEndpointConnectionProxyName, data); + DataReplicationPrivateEndpointConnectionProxyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetPrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Get.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionProxyResource + DataReplicationPrivateEndpointConnectionProxyCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnectionProxies(); + + // invoke the operation + string privateEndpointConnectionProxyName = "d"; + DataReplicationPrivateEndpointConnectionProxyResource result = await collection.GetAsync(privateEndpointConnectionProxyName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsThePrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_List.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionProxyResource + DataReplicationPrivateEndpointConnectionProxyCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnectionProxies(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationPrivateEndpointConnectionProxyResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetPrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Get.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionProxyResource + DataReplicationPrivateEndpointConnectionProxyCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnectionProxies(); + + // invoke the operation + string privateEndpointConnectionProxyName = "d"; + bool result = await collection.ExistsAsync(privateEndpointConnectionProxyName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetPrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Get.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateEndpointConnectionProxyResource + DataReplicationPrivateEndpointConnectionProxyCollection collection = dataReplicationVault.GetDataReplicationPrivateEndpointConnectionProxies(); + + // invoke the operation + string privateEndpointConnectionProxyName = "d"; + NullableResponse response = await collection.GetIfExistsAsync(privateEndpointConnectionProxyName); + DataReplicationPrivateEndpointConnectionProxyResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyResource.cs new file mode 100644 index 000000000000..c8786067cd31 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionProxyResource.cs @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPrivateEndpointConnectionProxyResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetPrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Get.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionProxyResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionProxyResource, please refer to the document of DataReplicationPrivateEndpointConnectionProxyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionProxyName = "d"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionProxyResourceId = DataReplicationPrivateEndpointConnectionProxyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + DataReplicationPrivateEndpointConnectionProxyResource dataReplicationPrivateEndpointConnectionProxy = client.GetDataReplicationPrivateEndpointConnectionProxyResource(dataReplicationPrivateEndpointConnectionProxyResourceId); + + // invoke the operation + DataReplicationPrivateEndpointConnectionProxyResource result = await dataReplicationPrivateEndpointConnectionProxy.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesThePrivateEndpointProxyConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Delete.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionProxyResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionProxyResource, please refer to the document of DataReplicationPrivateEndpointConnectionProxyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionProxyName = "d"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionProxyResourceId = DataReplicationPrivateEndpointConnectionProxyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + DataReplicationPrivateEndpointConnectionProxyResource dataReplicationPrivateEndpointConnectionProxy = client.GetDataReplicationPrivateEndpointConnectionProxyResource(dataReplicationPrivateEndpointConnectionProxyResourceId); + + // invoke the operation + await dataReplicationPrivateEndpointConnectionProxy.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_CreatesThePrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Create.json + // this example is just showing the usage of "PrivateEndpointConnectionProxy_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionProxyResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionProxyResource, please refer to the document of DataReplicationPrivateEndpointConnectionProxyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionProxyName = "d"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionProxyResourceId = DataReplicationPrivateEndpointConnectionProxyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + DataReplicationPrivateEndpointConnectionProxyResource dataReplicationPrivateEndpointConnectionProxy = client.GetDataReplicationPrivateEndpointConnectionProxyResource(dataReplicationPrivateEndpointConnectionProxyResourceId); + + // invoke the operation + DataReplicationPrivateEndpointConnectionProxyData data = new DataReplicationPrivateEndpointConnectionProxyData + { + Properties = new DataReplicationPrivateEndpointConnectionProxyProperties + { + RemotePrivateEndpoint = new RemotePrivateEndpoint("yipalno") + { + PrivateLinkServiceConnections = {new DataReplicationPrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + ManualPrivateLinkServiceConnections = {new DataReplicationPrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + PrivateLinkServiceProxies = {new DataReplicationPrivateLinkServiceProxy +{ +Id = "nzqxevuyqeedrqnkbnlcyrrrbzxvl", +RemotePrivateLinkServiceConnectionState = new DataReplicationPrivateLinkServiceConnectionState +{ +Status = DataReplicationPrivateEndpointConnectionStatus.Approved, +Description = "y", +ActionsRequired = "afwbq", +}, +RemotePrivateEndpointConnectionId = new ResourceIdentifier("ocunsgawjsqohkrcyxiv"), +GroupConnectivityInformation = {new GroupConnectivityInformation +{ +GroupId = "per", +MemberName = "ybptuypgdqoxkuwqx", +CustomerVisibleFqdns = {"vedcg"}, +InternalFqdn = "maqavwhxwzzhbzjbryyquvitmup", +RedirectMapId = "pezncxcq", +PrivateLinkServiceArmRegion = "rerkqqxinteevmlbrdkktaqhcch", +}}, +}}, + ConnectionDetails = {new RemotePrivateEndpointConnectionDetails +{ +Id = "lenqkogzkes", +PrivateIPAddress = "cyiacdzzyqmxjpijjbwgasegehtqe", +LinkIdentifier = "ravfufhkdowufd", +GroupId = "pjrlygpadir", +MemberName = "ybuysjrlfupewxe", +}}, + }, + }, + ETag = new ETag("hruibxrezstxroxrxweh"), + }; + ArmOperation lro = await dataReplicationPrivateEndpointConnectionProxy.UpdateAsync(WaitUntil.Completed, data); + DataReplicationPrivateEndpointConnectionProxyResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Validate_ValidatesThePrivateEndpointConnectionProxy() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnectionProxy_Validate.json + // this example is just showing the usage of "PrivateEndpointConnectionProxies_Validate" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionProxyResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionProxyResource, please refer to the document of DataReplicationPrivateEndpointConnectionProxyResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionProxyName = "d"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionProxyResourceId = DataReplicationPrivateEndpointConnectionProxyResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + DataReplicationPrivateEndpointConnectionProxyResource dataReplicationPrivateEndpointConnectionProxy = client.GetDataReplicationPrivateEndpointConnectionProxyResource(dataReplicationPrivateEndpointConnectionProxyResourceId); + + // invoke the operation + DataReplicationPrivateEndpointConnectionProxyData data = new DataReplicationPrivateEndpointConnectionProxyData + { + Properties = new DataReplicationPrivateEndpointConnectionProxyProperties + { + RemotePrivateEndpoint = new RemotePrivateEndpoint("yipalno") + { + PrivateLinkServiceConnections = {new DataReplicationPrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + ManualPrivateLinkServiceConnections = {new DataReplicationPrivateLinkServiceConnection +{ +Name = "jqwntlzfsksl", +GroupIds = {"hvejynjktikteipnioyeja"}, +RequestMessage = "bukgzpkvcvfbmcdmpcbiigbvugicqa", +}}, + PrivateLinkServiceProxies = {new DataReplicationPrivateLinkServiceProxy +{ +Id = "nzqxevuyqeedrqnkbnlcyrrrbzxvl", +RemotePrivateLinkServiceConnectionState = new DataReplicationPrivateLinkServiceConnectionState +{ +Status = DataReplicationPrivateEndpointConnectionStatus.Approved, +Description = "y", +ActionsRequired = "afwbq", +}, +RemotePrivateEndpointConnectionId = new ResourceIdentifier("ocunsgawjsqohkrcyxiv"), +GroupConnectivityInformation = {new GroupConnectivityInformation +{ +GroupId = "per", +MemberName = "ybptuypgdqoxkuwqx", +CustomerVisibleFqdns = {"vedcg"}, +InternalFqdn = "maqavwhxwzzhbzjbryyquvitmup", +RedirectMapId = "pezncxcq", +PrivateLinkServiceArmRegion = "rerkqqxinteevmlbrdkktaqhcch", +}}, +}}, + ConnectionDetails = {new RemotePrivateEndpointConnectionDetails +{ +Id = "lenqkogzkes", +PrivateIPAddress = "cyiacdzzyqmxjpijjbwgasegehtqe", +LinkIdentifier = "ravfufhkdowufd", +GroupId = "pjrlygpadir", +MemberName = "ybuysjrlfupewxe", +}}, + }, + }, + ETag = new ETag("hruibxrezstxroxrxweh"), + }; + DataReplicationPrivateEndpointConnectionProxyResource result = await dataReplicationPrivateEndpointConnectionProxy.ValidateAsync(data); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionProxyData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..a7e99a69865d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateEndpointConnectionResource.cs @@ -0,0 +1,122 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPrivateEndpointConnectionResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Get.json + // this example is just showing the usage of "PrivateEndpointConnection_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionResource, please refer to the document of DataReplicationPrivateEndpointConnectionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionName = "vbkm"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionResourceId = DataReplicationPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + DataReplicationPrivateEndpointConnectionResource dataReplicationPrivateEndpointConnection = client.GetDataReplicationPrivateEndpointConnectionResource(dataReplicationPrivateEndpointConnectionResourceId); + + // invoke the operation + DataReplicationPrivateEndpointConnectionResource result = await dataReplicationPrivateEndpointConnection.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Delete.json + // this example is just showing the usage of "PrivateEndpointConnection_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionResource, please refer to the document of DataReplicationPrivateEndpointConnectionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionName = "sdwqtfhigjirrzhpbmqtzgs"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionResourceId = DataReplicationPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + DataReplicationPrivateEndpointConnectionResource dataReplicationPrivateEndpointConnection = client.GetDataReplicationPrivateEndpointConnectionResource(dataReplicationPrivateEndpointConnectionResourceId); + + // invoke the operation + await dataReplicationPrivateEndpointConnection.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdatesThePrivateEndpointConnection() + { + // Generated from example definition: 2024-09-01/PrivateEndpointConnection_Update.json + // this example is just showing the usage of "PrivateEndpointConnection_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateEndpointConnectionResource created on azure + // for more information of creating DataReplicationPrivateEndpointConnectionResource, please refer to the document of DataReplicationPrivateEndpointConnectionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateEndpointConnectionName = "jitf"; + ResourceIdentifier dataReplicationPrivateEndpointConnectionResourceId = DataReplicationPrivateEndpointConnectionResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + DataReplicationPrivateEndpointConnectionResource dataReplicationPrivateEndpointConnection = client.GetDataReplicationPrivateEndpointConnectionResource(dataReplicationPrivateEndpointConnectionResourceId); + + // invoke the operation + DataReplicationPrivateEndpointConnectionData data = new DataReplicationPrivateEndpointConnectionData + { + Properties = new DataReplicationPrivateEndpointConnectionProperties + { + PrivateEndpointId = new ResourceIdentifier("cwcdqoynostmqwdwy"), + PrivateLinkServiceConnectionState = new DataReplicationPrivateLinkServiceConnectionState + { + Status = DataReplicationPrivateEndpointConnectionStatus.Approved, + Description = "y", + ActionsRequired = "afwbq", + }, + }, + }; + ArmOperation lro = await dataReplicationPrivateEndpointConnection.UpdateAsync(WaitUntil.Completed, data); + DataReplicationPrivateEndpointConnectionResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateEndpointConnectionData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResource.cs new file mode 100644 index 000000000000..fb3c2f216692 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResource.cs @@ -0,0 +1,49 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPrivateLinkResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetPrivateLinkResource() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_Get.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationPrivateLinkResource created on azure + // for more information of creating DataReplicationPrivateLinkResource, please refer to the document of DataReplicationPrivateLinkResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string privateLinkResourceName = "d"; + ResourceIdentifier dataReplicationPrivateLinkResourceId = DataReplicationPrivateLinkResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, privateLinkResourceName); + DataReplicationPrivateLinkResource dataReplicationPrivateLinkResource = client.GetDataReplicationPrivateLinkResource(dataReplicationPrivateLinkResourceId); + + // invoke the operation + DataReplicationPrivateLinkResource result = await dataReplicationPrivateLinkResource.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateLinkResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResourceCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResourceCollection.cs new file mode 100644 index 000000000000..ed489b30f9b9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationPrivateLinkResourceCollection.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationPrivateLinkResourceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetPrivateLinkResource() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_Get.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateLinkResource + DataReplicationPrivateLinkResourceCollection collection = dataReplicationVault.GetDataReplicationPrivateLinkResources(); + + // invoke the operation + string privateLinkResourceName = "d"; + DataReplicationPrivateLinkResource result = await collection.GetAsync(privateLinkResourceName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateLinkResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_PrivateLinkResourceListGeneratedByMaximumSetRule() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_List.json + // this example is just showing the usage of "PrivateLinkResource_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateLinkResource + DataReplicationPrivateLinkResourceCollection collection = dataReplicationVault.GetDataReplicationPrivateLinkResources(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationPrivateLinkResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateLinkResourceData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetPrivateLinkResource() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_Get.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateLinkResource + DataReplicationPrivateLinkResourceCollection collection = dataReplicationVault.GetDataReplicationPrivateLinkResources(); + + // invoke the operation + string privateLinkResourceName = "d"; + bool result = await collection.ExistsAsync(privateLinkResourceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetPrivateLinkResource() + { + // Generated from example definition: 2024-09-01/PrivateLinkResource_Get.json + // this example is just showing the usage of "PrivateLinkResource_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationPrivateLinkResource + DataReplicationPrivateLinkResourceCollection collection = dataReplicationVault.GetDataReplicationPrivateLinkResources(); + + // invoke the operation + string privateLinkResourceName = "d"; + NullableResponse response = await collection.GetIfExistsAsync(privateLinkResourceName); + DataReplicationPrivateLinkResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationPrivateLinkResourceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemCollection.cs new file mode 100644 index 000000000000..e57e7bc5ee7e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemCollection.cs @@ -0,0 +1,200 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationProtectedItemCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Create.json + // this example is just showing the usage of "ProtectedItemModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationProtectedItemResource + DataReplicationProtectedItemCollection collection = dataReplicationVault.GetDataReplicationProtectedItems(); + + // invoke the operation + string protectedItemName = "d"; + DataReplicationProtectedItemData data = new DataReplicationProtectedItemData + { + Properties = new DataReplicationProtectedItemProperties("tjoeiynplt", "jwxdo", null), + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, protectedItemName, data); + DataReplicationProtectedItemResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationProtectedItemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Get.json + // this example is just showing the usage of "ProtectedItemModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationProtectedItemResource + DataReplicationProtectedItemCollection collection = dataReplicationVault.GetDataReplicationProtectedItems(); + + // invoke the operation + string protectedItemName = "d"; + DataReplicationProtectedItemResource result = await collection.GetAsync(protectedItemName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationProtectedItemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheProtectedItems() + { + // Generated from example definition: 2024-09-01/ProtectedItem_List.json + // this example is just showing the usage of "ProtectedItemModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationProtectedItemResource + DataReplicationProtectedItemCollection collection = dataReplicationVault.GetDataReplicationProtectedItems(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationProtectedItemResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationProtectedItemData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Get.json + // this example is just showing the usage of "ProtectedItemModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationProtectedItemResource + DataReplicationProtectedItemCollection collection = dataReplicationVault.GetDataReplicationProtectedItems(); + + // invoke the operation + string protectedItemName = "d"; + bool result = await collection.ExistsAsync(protectedItemName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Get.json + // this example is just showing the usage of "ProtectedItemModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // get the collection of this DataReplicationProtectedItemResource + DataReplicationProtectedItemCollection collection = dataReplicationVault.GetDataReplicationProtectedItems(); + + // invoke the operation + string protectedItemName = "d"; + NullableResponse response = await collection.GetIfExistsAsync(protectedItemName); + DataReplicationProtectedItemResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationProtectedItemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemResource.cs new file mode 100644 index 000000000000..0ea8a0e7859c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationProtectedItemResource.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationProtectedItemResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Get.json + // this example is just showing the usage of "ProtectedItemModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // invoke the operation + DataReplicationProtectedItemResource result = await dataReplicationProtectedItem.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationProtectedItemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesTheProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Delete.json + // this example is just showing the usage of "ProtectedItemModel_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // invoke the operation + bool? forceDelete = true; + await dataReplicationProtectedItem.DeleteAsync(WaitUntil.Completed, forceDelete: forceDelete); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdateProtectedItem() + { + // Generated from example definition: 2024-09-01/ProtectedItem_Update.json + // this example is just showing the usage of "ProtectedItemModel_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // invoke the operation + DataReplicationProtectedItemPatch patch = new DataReplicationProtectedItemPatch(); + ArmOperation lro = await dataReplicationProtectedItem.UpdateAsync(WaitUntil.Completed, patch); + DataReplicationProtectedItemResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationProtectedItemData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task PlannedFailover_PerformsPlannedFailover() + { + // Generated from example definition: 2024-09-01/ProtectedItem_PlannedFailover.json + // this example is just showing the usage of "ProtectedItem_PlannedFailover" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // invoke the operation + PlannedFailover body = new PlannedFailover(new PlannedFailoverProperties(null)); + ArmOperation lro = await dataReplicationProtectedItem.PlannedFailoverAsync(WaitUntil.Completed, body); + PlannedFailover result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointCollection.cs new file mode 100644 index 000000000000..a39049a8d26a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointCollection.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationRecoveryPointCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheRecoveryPoint() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_Get.json + // this example is just showing the usage of "RecoveryPointModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // get the collection of this DataReplicationRecoveryPointResource + DataReplicationRecoveryPointCollection collection = dataReplicationProtectedItem.GetDataReplicationRecoveryPoints(); + + // invoke the operation + string recoveryPointName = "1X"; + DataReplicationRecoveryPointResource result = await collection.GetAsync(recoveryPointName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationRecoveryPointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheRecoveryPoints() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_List.json + // this example is just showing the usage of "RecoveryPointModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // get the collection of this DataReplicationRecoveryPointResource + DataReplicationRecoveryPointCollection collection = dataReplicationProtectedItem.GetDataReplicationRecoveryPoints(); + + // invoke the operation and iterate over the result + await foreach (DataReplicationRecoveryPointResource item in collection.GetAllAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationRecoveryPointData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheRecoveryPoint() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_Get.json + // this example is just showing the usage of "RecoveryPointModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // get the collection of this DataReplicationRecoveryPointResource + DataReplicationRecoveryPointCollection collection = dataReplicationProtectedItem.GetDataReplicationRecoveryPoints(); + + // invoke the operation + string recoveryPointName = "1X"; + bool result = await collection.ExistsAsync(recoveryPointName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheRecoveryPoint() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_Get.json + // this example is just showing the usage of "RecoveryPointModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationProtectedItemResource created on azure + // for more information of creating DataReplicationProtectedItemResource, please refer to the document of DataReplicationProtectedItemResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + ResourceIdentifier dataReplicationProtectedItemResourceId = DataReplicationProtectedItemResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName); + DataReplicationProtectedItemResource dataReplicationProtectedItem = client.GetDataReplicationProtectedItemResource(dataReplicationProtectedItemResourceId); + + // get the collection of this DataReplicationRecoveryPointResource + DataReplicationRecoveryPointCollection collection = dataReplicationProtectedItem.GetDataReplicationRecoveryPoints(); + + // invoke the operation + string recoveryPointName = "1X"; + NullableResponse response = await collection.GetIfExistsAsync(recoveryPointName); + DataReplicationRecoveryPointResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationRecoveryPointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointResource.cs new file mode 100644 index 000000000000..f598d5f26dc4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationRecoveryPointResource.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationRecoveryPointResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheRecoveryPoint() + { + // Generated from example definition: 2024-09-01/RecoveryPoints_Get.json + // this example is just showing the usage of "RecoveryPointModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationRecoveryPointResource created on azure + // for more information of creating DataReplicationRecoveryPointResource, please refer to the document of DataReplicationRecoveryPointResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + string protectedItemName = "d"; + string recoveryPointName = "1X"; + ResourceIdentifier dataReplicationRecoveryPointResourceId = DataReplicationRecoveryPointResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName, protectedItemName, recoveryPointName); + DataReplicationRecoveryPointResource dataReplicationRecoveryPoint = client.GetDataReplicationRecoveryPointResource(dataReplicationRecoveryPointResourceId); + + // invoke the operation + DataReplicationRecoveryPointResource result = await dataReplicationRecoveryPoint.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationRecoveryPointData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultCollection.cs new file mode 100644 index 000000000000..d23d7f613704 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultCollection.cs @@ -0,0 +1,204 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationVaultCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_PutsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Create.json + // this example is just showing the usage of "VaultModel_Create" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationVaultResource + DataReplicationVaultCollection collection = resourceGroupResource.GetDataReplicationVaults(); + + // invoke the operation + string vaultName = "4"; + DataReplicationVaultData data = new DataReplicationVaultData(new AzureLocation("eck")) + { + Properties = new DataReplicationVaultProperties + { + VaultType = DataReplicationVaultType.DisasterRecovery, + }, + Tags = +{ +["key5359"] = "ljfilxolxzuxrauopwtyxghrp" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, vaultName, data); + DataReplicationVaultResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Get.json + // this example is just showing the usage of "VaultModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationVaultResource + DataReplicationVaultCollection collection = resourceGroupResource.GetDataReplicationVaults(); + + // invoke the operation + string vaultName = "4"; + DataReplicationVaultResource result = await collection.GetAsync(vaultName); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAll_ListsTheVaults() + { + // Generated from example definition: 2024-09-01/Vault_List.json + // this example is just showing the usage of "VaultModel_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationVaultResource + DataReplicationVaultCollection collection = resourceGroupResource.GetDataReplicationVaults(); + + // invoke the operation and iterate over the result + string continuationToken = "mwculdaqndp"; + await foreach (DataReplicationVaultResource item in collection.GetAllAsync(continuationToken: continuationToken)) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_GetsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Get.json + // this example is just showing the usage of "VaultModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationVaultResource + DataReplicationVaultCollection collection = resourceGroupResource.GetDataReplicationVaults(); + + // invoke the operation + string vaultName = "4"; + bool result = await collection.ExistsAsync(vaultName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_GetsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Get.json + // this example is just showing the usage of "VaultModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this DataReplicationVaultResource + DataReplicationVaultCollection collection = resourceGroupResource.GetDataReplicationVaults(); + + // invoke the operation + string vaultName = "4"; + NullableResponse response = await collection.GetIfExistsAsync(vaultName); + DataReplicationVaultResource result = response.HasValue ? response.Value : null; + + if (result == null) + { + Console.WriteLine("Succeeded with null as result"); + } + else + { + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultResource.cs new file mode 100644 index 000000000000..03fe545f4ea8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_DataReplicationVaultResource.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_DataReplicationVaultResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_GetsTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Get.json + // this example is just showing the usage of "VaultModel_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // invoke the operation + DataReplicationVaultResource result = await dataReplicationVault.GetAsync(); + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Delete_DeletesTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Delete.json + // this example is just showing the usage of "VaultModel_Delete" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // invoke the operation + await dataReplicationVault.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_UpdatesTheVault() + { + // Generated from example definition: 2024-09-01/Vault_Update.json + // this example is just showing the usage of "VaultModel_Update" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this DataReplicationVaultResource created on azure + // for more information of creating DataReplicationVaultResource, please refer to the document of DataReplicationVaultResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgrecoveryservicesdatareplication"; + string vaultName = "4"; + ResourceIdentifier dataReplicationVaultResourceId = DataReplicationVaultResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, vaultName); + DataReplicationVaultResource dataReplicationVault = client.GetDataReplicationVaultResource(dataReplicationVaultResourceId); + + // invoke the operation + DataReplicationVaultPatch patch = new DataReplicationVaultPatch + { + Tags = +{ +["key8872"] = "pvtc" +}, + Properties = new DataReplicationVaultProperties + { + VaultType = DataReplicationVaultType.DisasterRecovery, + }, + }; + ArmOperation lro = await dataReplicationVault.UpdateAsync(WaitUntil.Completed, patch); + DataReplicationVaultResource result = lro.Value; + + // the variable result is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs new file mode 100644 index 000000000000..62c2faffdd2e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_ResourceGroupResourceExtensions.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_ResourceGroupResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task PostDeploymentPreflight_PerformsResourceDeploymentValidation() + { + // Generated from example definition: 2024-09-01/DeploymentPreflight_Post.json + // this example is just showing the usage of "DeploymentPreflight_Post" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ResourceGroupResource created on azure + // for more information of creating ResourceGroupResource, please refer to the document of ResourceGroupResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + string resourceGroupName = "rgswagger_2024-09-01"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // invoke the operation + string deploymentId = "lnfcwsmlowbwkndkztzvaj"; + DeploymentPreflight body = new DeploymentPreflight + { + Resources = {new DeploymentPreflightResourceInfo +{ +Name = "xtgugoflfc", +Type = new ResourceType("nsnaptduolqcxsikrewvgjbxqpt"), +Location = new AzureLocation("cbsgtxkjdzwbyp"), +ApiVersion = "otihymhvzblycdoxo", +}}, + }; + DeploymentPreflight result = await resourceGroupResource.PostDeploymentPreflightAsync(deploymentId, body: body); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..1e5f0264ceeb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,112 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; +using NUnit.Framework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetDataReplicationVaults_ListsTheVaultsBySubscription() + { + // Generated from example definition: 2024-09-01/Vault_ListBySubscription.json + // this example is just showing the usage of "VaultModel_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (DataReplicationVaultResource item in subscriptionResource.GetDataReplicationVaultsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationVaultData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetDataReplicationFabrics_ListsTheFabricsBySubscription() + { + // Generated from example definition: 2024-09-01/Fabric_ListBySubscription.json + // this example is just showing the usage of "FabricModel_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (DataReplicationFabricResource item in subscriptionResource.GetDataReplicationFabricsAsync()) + { + // the variable item is a resource, you could call other operations on this instance as well + // but just for demo, we get its data from this resource instance + DataReplicationFabricData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task PostCheckNameAvailability_PerformsTheResourceNameAvailabilityCheck() + { + // Generated from example definition: 2024-09-01/CheckNameAvailability_Post.json + // this example is just showing the usage of "CheckNameAvailability_Post" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SubscriptionResource created on azure + // for more information of creating SubscriptionResource, please refer to the document of SubscriptionResource + string subscriptionId = "930CEC23-4430-4513-B855-DBA237E2F3BF"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("trfqtbtmusswpibw"); + DataReplicationNameAvailabilityContent content = new DataReplicationNameAvailabilityContent + { + Name = "updkdcixs", + Type = new ResourceType("gngmcancdauwhdixjjvqnfkvqc"), + }; + DataReplicationNameAvailabilityResult result = await subscriptionResource.PostCheckNameAvailabilityAsync(location, content: content); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Azure.ResourceManager.RecoveryServicesDataReplication.csproj b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Azure.ResourceManager.RecoveryServicesDataReplication.csproj new file mode 100644 index 000000000000..ded5f53eb128 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Azure.ResourceManager.RecoveryServicesDataReplication.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider RecoveryServicesDataReplication. + 1.0.0-beta.1 + azure;management;arm;resource manager;recoveryservicesdatareplication + Azure.ResourceManager.RecoveryServicesDataReplication + + diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ArmRecoveryServicesDataReplicationModelFactory.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ArmRecoveryServicesDataReplicationModelFactory.cs new file mode 100644 index 000000000000..e07788d3eb10 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ArmRecoveryServicesDataReplicationModelFactory.cs @@ -0,0 +1,1413 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Model factory for models. + public static partial class ArmRecoveryServicesDataReplicationModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationEmailConfigurationData DataReplicationEmailConfigurationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationEmailConfigurationProperties properties = null) + { + return new DataReplicationEmailConfigurationData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets a value indicating whether to send email to subscription administrator. + /// Gets or sets the custom email address for sending emails. + /// Gets or sets the locale for the email notification. + /// Gets or sets the provisioning state of the email configuration. + /// A new instance for mocking. + public static DataReplicationEmailConfigurationProperties DataReplicationEmailConfigurationProperties(bool sendToOwners = default, IEnumerable customEmailAddresses = null, string locale = null, DataReplicationProvisioningState? provisioningState = null) + { + customEmailAddresses ??= new List(); + + return new DataReplicationEmailConfigurationProperties(sendToOwners, customEmailAddresses?.ToList(), locale, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. + /// A new instance for mocking. + public static DataReplicationVaultData DataReplicationVaultData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DataReplicationVaultProperties properties = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new DataReplicationVaultData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the vault. + /// Gets or sets the service resource Id. + /// Gets or sets the type of vault. + /// A new instance for mocking. + public static DataReplicationVaultProperties DataReplicationVaultProperties(DataReplicationProvisioningState? provisioningState = null, ResourceIdentifier serviceResourceId = null, DataReplicationVaultType? vaultType = null) + { + return new DataReplicationVaultProperties(provisioningState, serviceResourceId, vaultType, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the resource tags. + /// Vault properties. + /// Vault identity. Current supported identity types: None, SystemAssigned, UserAssigned. + /// A new instance for mocking. + public static DataReplicationVaultPatch DataReplicationVaultPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, DataReplicationVaultProperties properties = null, ManagedServiceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new DataReplicationVaultPatch( + id, + name, + resourceType, + systemData, + tags, + properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationEventData DataReplicationEventData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationEventProperties properties = null) + { + return new DataReplicationEventData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the resource type. + /// Gets or sets the resource name. + /// Gets or sets the event type. + /// Gets or sets the event name. + /// Gets or sets the time at which the event occurred at source. + /// Gets or sets the event severity. + /// Gets or sets the event description. + /// Gets or sets the event correlation Id. + /// Gets or sets the errors associated with this event. + /// + /// Event model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Gets or sets the provisioning state of the event. + /// A new instance for mocking. + public static DataReplicationEventProperties DataReplicationEventProperties(ResourceType? resourceType = null, string resourceName = null, string eventType = null, string eventName = null, DateTimeOffset? occurredOn = null, string severity = null, string description = null, string correlationId = null, IEnumerable healthErrors = null, DataReplicationEventCustomProperties customProperties = null, DataReplicationProvisioningState? provisioningState = null) + { + healthErrors ??= new List(); + + return new DataReplicationEventProperties( + resourceType, + resourceName, + eventType, + eventName, + occurredOn, + severity, + description, + correlationId, + healthErrors?.ToList(), + customProperties, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the type of affected resource type. + /// Gets or sets the list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + /// Gets or sets a list of child health errors associated with this error. + /// Gets or sets the error code. + /// Gets or sets the health category. + /// Gets or sets the error category. + /// Gets or sets the error severity. + /// Gets or sets the error source. + /// Gets or sets the error creation time. + /// Gets or sets a value indicating whether the error is customer resolvable. + /// Gets or sets the error summary. + /// Gets or sets the error message. + /// Gets or sets possible causes of the error. + /// Gets or sets recommended action to resolve the error. + /// A new instance for mocking. + public static DataReplicationHealthErrorInfo DataReplicationHealthErrorInfo(ResourceType? affectedResourceType = null, IEnumerable affectedResourceCorrelationIds = null, IEnumerable childErrors = null, string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, DateTimeOffset? createdOn = null, bool? isCustomerResolvable = null, string summary = null, string message = null, string causes = null, string recommendation = null) + { + affectedResourceCorrelationIds ??= new List(); + childErrors ??= new List(); + + return new DataReplicationHealthErrorInfo( + affectedResourceType, + affectedResourceCorrelationIds?.ToList(), + childErrors?.ToList(), + code, + healthCategory, + category, + severity, + source, + createdOn, + isCustomerResolvable, + summary, + message, + causes, + recommendation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the error code. + /// Gets or sets the health category. + /// Gets or sets the error category. + /// Gets or sets the error severity. + /// Gets or sets the error source. + /// Gets or sets the error creation time. + /// Gets or sets a value indicating whether the error is customer resolvable. + /// Gets or sets the error summary. + /// Gets or sets the error message. + /// Gets or sets possible causes of the error. + /// Gets or sets recommended action to resolve the error. + /// A new instance for mocking. + public static DataReplicationInnerHealthErrorInfo DataReplicationInnerHealthErrorInfo(string code = null, string healthCategory = null, string category = null, string severity = null, string source = null, DateTimeOffset? createdOn = null, bool? isCustomerResolvable = null, string summary = null, string message = null, string causes = null, string recommendation = null) + { + return new DataReplicationInnerHealthErrorInfo( + code, + healthCategory, + category, + severity, + source, + createdOn, + isCustomerResolvable, + summary, + message, + causes, + recommendation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the friendly name of the source which has raised this health event. + /// Gets or sets the protected item friendly name. + /// Gets or sets the source appliance name. + /// Gets or sets the source target name. + /// Gets or sets the server type. + /// A new instance for mocking. + public static HyperVToAzStackHciEventCustomProperties HyperVToAzStackHciEventCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) + { + return new HyperVToAzStackHciEventCustomProperties( + "HyperVToAzStackHCI", + serializedAdditionalRawData: null, + eventSourceFriendlyName, + protectedItemFriendlyName, + sourceApplianceName, + targetApplianceName, + serverType); + } + + /// Initializes a new instance of . + /// Gets or sets the friendly name of the source which has raised this health event. + /// Gets or sets the protected item friendly name. + /// Gets or sets the source appliance name. + /// Gets or sets the source target name. + /// Gets or sets the server type. + /// A new instance for mocking. + public static VMwareToAzStackHciEventCustomProperties VMwareToAzStackHciEventCustomProperties(string eventSourceFriendlyName = null, string protectedItemFriendlyName = null, string sourceApplianceName = null, string targetApplianceName = null, string serverType = null) + { + return new VMwareToAzStackHciEventCustomProperties( + "VMwareToAzStackHCI", + serializedAdditionalRawData: null, + eventSourceFriendlyName, + protectedItemFriendlyName, + sourceApplianceName, + targetApplianceName, + serverType); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationFabricData DataReplicationFabricData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, DataReplicationFabricProperties properties = null) + { + tags ??= new Dictionary(); + + return new DataReplicationFabricData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the fabric. + /// Gets or sets the service endpoint. + /// Gets or sets the service resource Id. + /// Gets or sets the fabric health. + /// Gets or sets the list of health errors. + /// + /// Fabric model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// A new instance for mocking. + public static DataReplicationFabricProperties DataReplicationFabricProperties(DataReplicationProvisioningState? provisioningState = null, string serviceEndpoint = null, ResourceIdentifier serviceResourceId = null, DataReplicationHealthStatus? health = null, IEnumerable healthErrors = null, DataReplicationFabricCustomProperties customProperties = null) + { + healthErrors ??= new List(); + + return new DataReplicationFabricProperties( + provisioningState, + serviceEndpoint, + serviceResourceId, + health, + healthErrors?.ToList(), + customProperties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the Appliance name. + /// AzStackHCI cluster properties. + /// Gets or sets the fabric resource Id. + /// Gets or sets the fabric container Id. + /// Gets or sets the Migration solution ARM Id. + /// Gets or sets the migration hub Uri. + /// A new instance for mocking. + public static AzStackHciFabricCustomProperties AzStackHciFabricCustomProperties(ResourceIdentifier azStackHciSiteId = null, IEnumerable applianceName = null, AzStackHciClusterProperties cluster = null, ResourceIdentifier fabricResourceId = null, ResourceIdentifier fabricContainerId = null, ResourceIdentifier migrationSolutionId = null, Uri migrationHubUri = null) + { + applianceName ??= new List(); + + return new AzStackHciFabricCustomProperties( + "AzStackHCI", + serializedAdditionalRawData: null, + azStackHciSiteId, + applianceName?.ToList(), + cluster, + fabricResourceId, + fabricContainerId, + migrationSolutionId, + migrationHubUri); + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the fabric resource Id. + /// Gets or sets the fabric container Id. + /// Gets or sets the migration solution ARM Id. + /// Gets or sets the migration hub Uri. + /// A new instance for mocking. + public static HyperVMigrateFabricCustomProperties HyperVMigrateFabricCustomProperties(ResourceIdentifier hyperVSiteId = null, ResourceIdentifier fabricResourceId = null, ResourceIdentifier fabricContainerId = null, ResourceIdentifier migrationSolutionId = null, Uri migrationHubUri = null) + { + return new HyperVMigrateFabricCustomProperties( + "HyperVMigrate", + serializedAdditionalRawData: null, + hyperVSiteId, + fabricResourceId, + fabricContainerId, + migrationSolutionId, + migrationHubUri); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the resource tags. + /// Fabric model properties. + /// A new instance for mocking. + public static DataReplicationFabricPatch DataReplicationFabricPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, DataReplicationFabricProperties properties = null) + { + tags ??= new Dictionary(); + + return new DataReplicationFabricPatch( + id, + name, + resourceType, + systemData, + tags, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationFabricAgentData DataReplicationFabricAgentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationFabricAgentProperties properties = null) + { + return new DataReplicationFabricAgentData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the fabric agent correlation Id. + /// Gets or sets the machine Id where fabric agent is running. + /// Gets or sets the machine name where fabric agent is running. + /// Identity model. + /// Identity model. + /// Gets or sets a value indicating whether the fabric agent is responsive. + /// Gets or sets the time when last heartbeat was sent by the fabric agent. + /// Gets or sets the fabric agent version. + /// Gets or sets the provisioning state of the fabric agent. + /// Gets or sets the list of health errors. + /// + /// Fabric agent model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// A new instance for mocking. + public static DataReplicationFabricAgentProperties DataReplicationFabricAgentProperties(string correlationId = null, string machineId = null, string machineName = null, DataReplicationIdentity authenticationIdentity = null, DataReplicationIdentity resourceAccessIdentity = null, bool? isResponsive = null, DateTimeOffset? lastHeartbeatOn = null, string versionNumber = null, DataReplicationProvisioningState? provisioningState = null, IEnumerable healthErrors = null, DataReplicationFabricAgentCustomProperties customProperties = null) + { + healthErrors ??= new List(); + + return new DataReplicationFabricAgentProperties( + correlationId, + machineId, + machineName, + authenticationIdentity, + resourceAccessIdentity, + isResponsive, + lastHeartbeatOn, + versionNumber, + provisioningState, + healthErrors?.ToList(), + customProperties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationJobData DataReplicationJobData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationJobProperties properties = null) + { + return new DataReplicationJobData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the friendly display name. + /// Gets or sets the job state. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// Gets or sets the affected object Id. + /// Gets or sets the affected object name. + /// Gets or sets the affected object internal Id. + /// Gets or sets the affected object internal name. + /// Gets or sets the object type. + /// Gets or sets the replication provider. + /// Gets or sets the source fabric provider. + /// Gets or sets the target fabric provider. + /// Gets or sets the list of allowed actions on the job. + /// Gets or sets the job activity id. + /// Gets or sets the list of tasks. + /// Gets or sets the list of errors. + /// + /// Job model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Gets or sets the provisioning state of the job. + /// A new instance for mocking. + public static DataReplicationJobProperties DataReplicationJobProperties(string displayName = null, DataReplicationJobState? state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, string objectId = null, string objectName = null, string objectInternalId = null, string objectInternalName = null, DataReplicationJobObjectType? objectType = null, string replicationProviderId = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, IEnumerable allowedActions = null, string activityId = null, IEnumerable tasks = null, IEnumerable errors = null, DataReplicationJobCustomProperties customProperties = null, DataReplicationProvisioningState? provisioningState = null) + { + allowedActions ??= new List(); + tasks ??= new List(); + errors ??= new List(); + + return new DataReplicationJobProperties( + displayName, + state, + startOn, + endOn, + objectId, + objectName, + objectInternalId, + objectInternalName, + objectType, + replicationProviderId, + sourceFabricProviderId, + targetFabricProviderId, + allowedActions?.ToList(), + activityId, + tasks?.ToList(), + errors?.ToList(), + customProperties, + provisioningState, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the task name. + /// Gets or sets the task state. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// Task model custom properties. + /// Gets or sets the list of children job models. + /// A new instance for mocking. + public static DataReplicationTask DataReplicationTask(string taskName = null, DataReplicationTaskState? state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, string customInstanceType = null, IEnumerable childrenJobs = null) + { + childrenJobs ??= new List(); + + return new DataReplicationTask( + taskName, + state, + startOn, + endOn, + customInstanceType != null ? new DataReplicationTaskCustomProperties(customInstanceType, serializedAdditionalRawData: null) : null, + childrenJobs?.ToList(), + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the error code. + /// Gets or sets the error type. + /// Gets or sets the error severity. + /// Gets or sets the creation time of error. + /// Gets or sets the error message. + /// Gets or sets the possible causes of error. + /// Gets or sets the recommended action to resolve error. + /// A new instance for mocking. + public static DataReplicationErrorInfo DataReplicationErrorInfo(string code = null, string type = null, string severity = null, DateTimeOffset? createdOn = null, string message = null, string causes = null, string recommendation = null) + { + return new DataReplicationErrorInfo( + code, + type, + severity, + createdOn, + message, + causes, + recommendation, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationJobCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// A new instance for mocking. + public static DataReplicationJobCustomProperties DataReplicationJobCustomProperties(string instanceType = null, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null) + { + return new UnknownDataReplicationJobCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// + /// + /// A new instance for mocking. + public static JobModelCustomPropertiesAffectedObjectDetails JobModelCustomPropertiesAffectedObjectDetails(string description = null, JobModelCustomPropertiesAffectedObjectDetailsType? type = null) + { + return new JobModelCustomPropertiesAffectedObjectDetails(description, type, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets any custom properties of the affected object. + /// Gets or sets the failed over protected item details. + /// A new instance for mocking. + public static FailoverJobCustomProperties FailoverJobCustomProperties(JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, IEnumerable protectedItemDetails = null) + { + protectedItemDetails ??= new List(); + + return new FailoverJobCustomProperties("FailoverJobDetails", affectedObjectDetails, serializedAdditionalRawData: null, protectedItemDetails?.ToList()); + } + + /// Initializes a new instance of . + /// Gets or sets the protected item name. + /// Gets or sets the VM name. + /// Gets or sets the test VM name. + /// Gets or sets the recovery point Id. + /// Gets or sets the recovery point time. + /// Gets or sets the network name. + /// Gets or sets the network subnet. + /// A new instance for mocking. + public static FailoverProtectedItemProperties FailoverProtectedItemProperties(string protectedItemName = null, string vmName = null, string testVmName = null, string recoveryPointId = null, DateTimeOffset? recoveryPointOn = null, string networkName = null, string subnet = null) + { + return new FailoverProtectedItemProperties( + protectedItemName, + vmName, + testVmName, + recoveryPointId, + recoveryPointOn, + networkName, + subnet, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets any custom properties of the affected object. + /// Gets or sets the test failover cleanup comments. + /// A new instance for mocking. + public static TestFailoverCleanupJobCustomProperties TestFailoverCleanupJobCustomProperties(JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, string comments = null) + { + return new TestFailoverCleanupJobCustomProperties("TestFailoverCleanupJobDetails", affectedObjectDetails, serializedAdditionalRawData: null, comments); + } + + /// Initializes a new instance of . + /// Gets or sets any custom properties of the affected object. + /// Gets or sets the test VM details. + /// A new instance for mocking. + public static TestFailoverJobCustomProperties TestFailoverJobCustomProperties(JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = null, IEnumerable protectedItemDetails = null) + { + protectedItemDetails ??= new List(); + + return new TestFailoverJobCustomProperties("TestFailoverJobDetails", affectedObjectDetails, serializedAdditionalRawData: null, protectedItemDetails?.ToList()); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationPolicyData DataReplicationPolicyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationPolicyProperties properties = null) + { + return new DataReplicationPolicyData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the policy. + /// + /// Policy model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// A new instance for mocking. + public static DataReplicationPolicyProperties DataReplicationPolicyProperties(DataReplicationProvisioningState? provisioningState = null, DataReplicationPolicyCustomProperties customProperties = null) + { + return new DataReplicationPolicyProperties(provisioningState, customProperties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationPrivateEndpointConnectionData DataReplicationPrivateEndpointConnectionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationPrivateEndpointConnectionProperties properties = null) + { + return new DataReplicationPrivateEndpointConnectionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets provisioning state of the private endpoint connection. + /// Represent private Endpoint network resource that is linked to the Private Endpoint connection. + /// Represents Private link service connection state. + /// A new instance for mocking. + public static DataReplicationPrivateEndpointConnectionProperties DataReplicationPrivateEndpointConnectionProperties(DataReplicationProvisioningState? provisioningState = null, ResourceIdentifier privateEndpointId = null, DataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState = null) + { + return new DataReplicationPrivateEndpointConnectionProperties(provisioningState, privateEndpointId != null ? ResourceManagerModelFactory.WritableSubResource(privateEndpointId) : null, privateLinkServiceConnectionState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Gets or sets ETag. + /// A new instance for mocking. + public static DataReplicationPrivateEndpointConnectionProxyData DataReplicationPrivateEndpointConnectionProxyData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationPrivateEndpointConnectionProxyProperties properties = null, ETag? etag = null) + { + return new DataReplicationPrivateEndpointConnectionProxyData( + id, + name, + resourceType, + systemData, + properties, + etag, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the private endpoint connection proxy. + /// Represent remote private endpoint information for the private endpoint connection proxy. + /// A new instance for mocking. + public static DataReplicationPrivateEndpointConnectionProxyProperties DataReplicationPrivateEndpointConnectionProxyProperties(DataReplicationProvisioningState? provisioningState = null, RemotePrivateEndpoint remotePrivateEndpoint = null) + { + return new DataReplicationPrivateEndpointConnectionProxyProperties(provisioningState, remotePrivateEndpoint, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationPrivateLinkResourceData DataReplicationPrivateLinkResourceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationPrivateLinkResourceProperties properties = null) + { + return new DataReplicationPrivateLinkResourceData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the group id. + /// Gets or sets the required member. This translates to how many Private IPs should be created for each privately linkable resource. + /// Gets or sets the private DNS zone names. + /// Gets or sets the provisioning state of the private link resource. + /// A new instance for mocking. + public static DataReplicationPrivateLinkResourceProperties DataReplicationPrivateLinkResourceProperties(string groupId = null, IEnumerable requiredMembers = null, IEnumerable requiredZoneNames = null, DataReplicationProvisioningState? provisioningState = null) + { + requiredMembers ??= new List(); + requiredZoneNames ??= new List(); + + return new DataReplicationPrivateLinkResourceProperties(groupId, requiredMembers?.ToList(), requiredZoneNames?.ToList(), provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationProtectedItemData DataReplicationProtectedItemData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationProtectedItemProperties properties = null) + { + return new DataReplicationProtectedItemData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the policy name. + /// Gets or sets the replication extension name. + /// Gets or sets the protected item correlation Id. + /// Gets or sets the provisioning state of the fabric agent. + /// Gets or sets the protection state. + /// Gets or sets the protection state description. + /// Gets or sets the test failover state. + /// Gets or sets the Test failover state description. + /// Gets or sets the resynchronization state. + /// Gets or sets the fabric object Id. + /// Gets or sets the fabric object name. + /// Gets or sets the source fabric provider Id. + /// Gets or sets the target fabric provider Id. + /// Gets or sets the fabric Id. + /// Gets or sets the target fabric Id. + /// Gets or sets the fabric agent Id. + /// Gets or sets the target fabric agent Id. + /// Gets or sets a value indicating whether resynchronization is required or not. + /// Gets or sets the Last successful planned failover time. + /// Gets or sets the Last successful unplanned failover time. + /// Gets or sets the Last successful test failover time. + /// Gets or sets the current scenario. + /// Gets or sets the allowed scenarios on the protected item. + /// Gets or sets the last failed enabled protection job. + /// Gets or sets the last failed planned failover job. + /// Gets or sets the last test failover job. + /// Gets or sets protected item replication health. + /// Gets or sets the list of health errors. + /// + /// Protected item model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// A new instance for mocking. + public static DataReplicationProtectedItemProperties DataReplicationProtectedItemProperties(string policyName = null, string replicationExtensionName = null, string correlationId = null, DataReplicationProvisioningState? provisioningState = null, DataReplicationProtectionState? protectionState = null, string protectionStateDescription = null, DataReplicationTestFailoverState? testFailoverState = null, string testFailoverStateDescription = null, DataReplicationResynchronizationState? resynchronizationState = null, string fabricObjectId = null, string fabricObjectName = null, string sourceFabricProviderId = null, string targetFabricProviderId = null, string fabricId = null, string targetFabricId = null, string fabricAgentId = null, string targetFabricAgentId = null, bool? isResyncRequired = null, DateTimeOffset? lastSuccessfulPlannedFailoverOn = null, DateTimeOffset? lastSuccessfulUnplannedFailoverOn = null, DateTimeOffset? lastSuccessfulTestFailoverOn = null, ProtectedItemJobProperties currentJob = null, IEnumerable allowedJobs = null, ProtectedItemJobProperties lastFailedEnableProtectionJob = null, ProtectedItemJobProperties lastFailedPlannedFailoverJob = null, ProtectedItemJobProperties lastTestFailoverJob = null, DataReplicationHealthStatus? replicationHealth = null, IEnumerable healthErrors = null, DataReplicationProtectedItemCustomProperties customProperties = null) + { + allowedJobs ??= new List(); + healthErrors ??= new List(); + + return new DataReplicationProtectedItemProperties( + policyName, + replicationExtensionName, + correlationId, + provisioningState, + protectionState, + protectionStateDescription, + testFailoverState, + testFailoverStateDescription, + resynchronizationState, + fabricObjectId, + fabricObjectName, + sourceFabricProviderId, + targetFabricProviderId, + fabricId, + targetFabricId, + fabricAgentId, + targetFabricAgentId, + isResyncRequired, + lastSuccessfulPlannedFailoverOn, + lastSuccessfulUnplannedFailoverOn, + lastSuccessfulTestFailoverOn, + currentJob, + allowedJobs?.ToList(), + lastFailedEnableProtectionJob, + lastFailedPlannedFailoverJob, + lastTestFailoverJob, + replicationHealth, + healthErrors?.ToList(), + customProperties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets protection scenario name. + /// Gets or sets job Id. + /// Gets or sets job name. + /// Gets or sets the job friendly display name. + /// Gets or sets job state. + /// Gets or sets start time of the job. + /// Gets or sets end time of the job. + /// A new instance for mocking. + public static ProtectedItemJobProperties ProtectedItemJobProperties(string scenarioName = null, string id = null, string name = null, string displayName = null, string state = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null) + { + return new ProtectedItemJobProperties( + scenarioName, + id, + name, + displayName, + state, + startOn, + endOn, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the location of the protected item. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the Target AzStackHCI cluster name. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the source VM display name. + /// Gets or sets the source VM CPU cores. + /// Gets or sets the source VM ram memory size in megabytes. + /// Gets or sets the target VM display name. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the hypervisor generation of the virtual machine. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the Run As account Id. + /// Gets or sets the source fabric agent name. + /// Gets or sets the target fabric agent name. + /// Gets or sets the source appliance name. + /// Gets or sets the target appliance name. + /// Gets or sets the type of the OS. + /// Gets or sets the name of the OS. + /// Gets or sets the firmware type. + /// Gets or sets the target location. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the recovery point Id to which the VM was failed over. + /// Gets or sets the last recovery point received time. + /// Gets or sets the last recovery point Id. + /// Gets or sets the initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the list of protected disks. + /// Gets or sets the VM NIC details. + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + /// Gets or sets the latest timestamp that replication status is updated. + /// A new instance for mocking. + public static HyperVToAzStackHciProtectedItemCustomProperties HyperVToAzStackHciProtectedItemCustomProperties(ProtectedItemActiveLocation? activeLocation = null, ResourceIdentifier targetHciClusterId = null, ResourceIdentifier targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, ResourceIdentifier fabricDiscoveryMachineId = null, IEnumerable disksToInclude = null, IEnumerable nicsToInclude = null, string sourceVmName = null, int? sourceCpuCores = null, double? sourceMemoryInMegaBytes = null, string targetVmName = null, ResourceIdentifier targetResourceGroupId = null, ResourceIdentifier storageContainerId = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = null, bool? isDynamicRam = null, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = null, string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string osType = null, string osName = null, string firmwareType = null, string targetLocation = null, string customLocationRegion = null, string failoverRecoveryPointId = null, DateTimeOffset? lastRecoveryPointReceivedOn = null, string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = null, int? resyncProgressPercentage = null, IEnumerable protectedDisks = null, IEnumerable protectedNics = null, string targetVmBiosId = null, DateTimeOffset? lastReplicationUpdateOn = null) + { + disksToInclude ??= new List(); + nicsToInclude ??= new List(); + protectedDisks ??= new List(); + protectedNics ??= new List(); + + return new HyperVToAzStackHciProtectedItemCustomProperties( + "HyperVToAzStackHCI", + serializedAdditionalRawData: null, + activeLocation, + targetHciClusterId, + targetArcClusterCustomLocationId, + targetAzStackHciClusterName, + fabricDiscoveryMachineId, + disksToInclude?.ToList(), + nicsToInclude?.ToList(), + sourceVmName, + sourceCpuCores, + sourceMemoryInMegaBytes, + targetVmName, + targetResourceGroupId, + storageContainerId, + hyperVGeneration, + targetNetworkId, + testNetworkId, + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + runAsAccountId, + sourceFabricAgentName, + targetFabricAgentName, + sourceApplianceName, + targetApplianceName, + osType, + osName, + firmwareType, + targetLocation, + customLocationRegion, + failoverRecoveryPointId, + lastRecoveryPointReceivedOn, + lastRecoveryPointId, + initialReplicationProgressPercentage, + resyncProgressPercentage, + protectedDisks?.ToList(), + protectedNics?.ToList(), + targetVmBiosId, + lastReplicationUpdateOn); + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// Gets or sets a value indicating whether static ip migration is enabled. + /// Gets or sets a value indicating whether mac address migration is enabled. + /// A new instance for mocking. + public static HyperVToAzStackHciNicInput HyperVToAzStackHciNicInput(string nicId = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, VmNicSelection selectionTypeForFailover = default, bool? isStaticIPMigrationEnabled = null, bool? isMacMigrationEnabled = null) + { + return new HyperVToAzStackHciNicInput( + nicId, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + isStaticIPMigrationEnabled, + isMacMigrationEnabled, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the storage container. + /// Gets or sets the local path of the storage container. + /// Gets or sets the source disk Id. + /// Gets or sets the source disk Name. + /// Gets or sets the seed disk name. + /// Gets or sets the test failover clone disk. + /// Gets or sets the failover clone disk. + /// Gets or sets a value indicating whether the disk is the OS disk. + /// Gets or sets the disk capacity in bytes. + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + /// Gets or sets the disk type. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// A new instance for mocking. + public static HyperVToAzStackHciProtectedDiskProperties HyperVToAzStackHciProtectedDiskProperties(ResourceIdentifier storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = null, long? capacityInBytes = null, bool? isDynamic = null, string diskType = null, long? diskBlockSize = null, long? diskLogicalSectorSize = null, long? diskPhysicalSectorSize = null) + { + return new HyperVToAzStackHciProtectedDiskProperties( + storageContainerId, + storageContainerLocalPath, + sourceDiskId, + sourceDiskName, + seedDiskName, + testMigrateDiskName, + migrateDiskName, + isOSDisk, + capacityInBytes, + isDynamic, + diskType, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC mac address. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// A new instance for mocking. + public static HyperVToAzStackHciProtectedNicProperties HyperVToAzStackHciProtectedNicProperties(string nicId = null, string macAddress = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, VmNicSelection? selectionTypeForFailover = null) + { + return new HyperVToAzStackHciProtectedNicProperties( + nicId, + macAddress, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the location of the protected item. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the Target AzStackHCI cluster name. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target location. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the list of protected disks. + /// Gets or sets the VM NIC details. + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + /// Gets or sets the target VM display name. + /// Gets or sets the hypervisor generation of the virtual machine possible values are 1,2. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the type of the OS. + /// Gets or sets the name of the OS. + /// Gets or sets the firmware type. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the source VM display name. + /// Gets or sets the source VM CPU cores. + /// Gets or sets the source VM ram memory size in megabytes. + /// Gets or sets the run as account Id. + /// Gets or sets the source fabric agent name. + /// Gets or sets the target fabric agent name. + /// Gets or sets the source appliance name. + /// Gets or sets the target appliance name. + /// Gets or sets the recovery point Id to which the VM was failed over. + /// Gets or sets the last recovery point received time. + /// Gets or sets the last recovery point Id. + /// Gets or sets the initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the migration progress percentage. + /// Gets or sets the resume progress percentage. + /// Gets or sets the resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the resync retry count. + /// Gets or sets a value indicating whether resync is required. + /// Gets or sets the resync state. + /// Gets or sets a value indicating whether auto resync is to be done. + /// Gets or sets the resume retry count. + /// Gets or sets the latest timestamp that replication status is updated. + /// A new instance for mocking. + public static VMwareToAzStackHciProtectedItemCustomProperties VMwareToAzStackHciProtectedItemCustomProperties(ProtectedItemActiveLocation? activeLocation = null, ResourceIdentifier targetHciClusterId = null, ResourceIdentifier targetArcClusterCustomLocationId = null, string targetAzStackHciClusterName = null, ResourceIdentifier storageContainerId = null, ResourceIdentifier targetResourceGroupId = null, string targetLocation = null, string customLocationRegion = null, IEnumerable disksToInclude = null, IEnumerable nicsToInclude = null, IEnumerable protectedDisks = null, IEnumerable protectedNics = null, string targetVmBiosId = null, string targetVmName = null, string hyperVGeneration = null, string targetNetworkId = null, string testNetworkId = null, int? targetCpuCores = null, bool? isDynamicRam = null, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = null, int? targetMemoryInMegaBytes = null, string osType = null, string osName = null, string firmwareType = null, ResourceIdentifier fabricDiscoveryMachineId = null, string sourceVmName = null, int? sourceCpuCores = null, double? sourceMemoryInMegaBytes = null, string runAsAccountId = null, string sourceFabricAgentName = null, string targetFabricAgentName = null, string sourceApplianceName = null, string targetApplianceName = null, string failoverRecoveryPointId = null, DateTimeOffset? lastRecoveryPointReceivedOn = null, string lastRecoveryPointId = null, int? initialReplicationProgressPercentage = null, int? migrationProgressPercentage = null, int? resumeProgressPercentage = null, int? resyncProgressPercentage = null, long? resyncRetryCount = null, bool? resyncRequired = null, VMwareToAzureMigrateResyncState? resyncState = null, bool? performAutoResync = null, long? resumeRetryCount = null, DateTimeOffset? lastReplicationUpdateOn = null) + { + disksToInclude ??= new List(); + nicsToInclude ??= new List(); + protectedDisks ??= new List(); + protectedNics ??= new List(); + + return new VMwareToAzStackHciProtectedItemCustomProperties( + "VMwareToAzStackHCI", + serializedAdditionalRawData: null, + activeLocation, + targetHciClusterId, + targetArcClusterCustomLocationId, + targetAzStackHciClusterName, + storageContainerId, + targetResourceGroupId, + targetLocation, + customLocationRegion, + disksToInclude?.ToList(), + nicsToInclude?.ToList(), + protectedDisks?.ToList(), + protectedNics?.ToList(), + targetVmBiosId, + targetVmName, + hyperVGeneration, + targetNetworkId, + testNetworkId, + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + osType, + osName, + firmwareType, + fabricDiscoveryMachineId, + sourceVmName, + sourceCpuCores, + sourceMemoryInMegaBytes, + runAsAccountId, + sourceFabricAgentName, + targetFabricAgentName, + sourceApplianceName, + targetApplianceName, + failoverRecoveryPointId, + lastRecoveryPointReceivedOn, + lastRecoveryPointId, + initialReplicationProgressPercentage, + migrationProgressPercentage, + resumeProgressPercentage, + resyncProgressPercentage, + resyncRetryCount, + resyncRequired, + resyncState, + performAutoResync, + resumeRetryCount, + lastReplicationUpdateOn); + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC label. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// Gets or sets a value indicating whether static ip migration is enabled. + /// Gets or sets a value indicating whether mac address migration is enabled. + /// A new instance for mocking. + public static VMwareToAzStackHciNicInput VMwareToAzStackHciNicInput(string nicId = null, string label = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, VmNicSelection selectionTypeForFailover = default, bool? isStaticIPMigrationEnabled = null, bool? isMacMigrationEnabled = null) + { + return new VMwareToAzStackHciNicInput( + nicId, + label, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + isStaticIPMigrationEnabled, + isMacMigrationEnabled, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the storage container. + /// Gets or sets the local path of the storage container. + /// Gets or sets the source disk Id. + /// Gets or sets the source disk Name. + /// Gets or sets the seed disk name. + /// Gets or sets the test failover clone disk. + /// Gets or sets the failover clone disk. + /// Gets or sets a value indicating whether the disk is the OS disk. + /// Gets or sets the disk capacity in bytes. + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + /// Gets or sets the disk type. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// A new instance for mocking. + public static VMwareToAzStackHciProtectedDiskProperties VMwareToAzStackHciProtectedDiskProperties(ResourceIdentifier storageContainerId = null, string storageContainerLocalPath = null, string sourceDiskId = null, string sourceDiskName = null, string seedDiskName = null, string testMigrateDiskName = null, string migrateDiskName = null, bool? isOSDisk = null, long? capacityInBytes = null, bool? isDynamic = null, string diskType = null, long? diskBlockSize = null, long? diskLogicalSectorSize = null, long? diskPhysicalSectorSize = null) + { + return new VMwareToAzStackHciProtectedDiskProperties( + storageContainerId, + storageContainerLocalPath, + sourceDiskId, + sourceDiskName, + seedDiskName, + testMigrateDiskName, + migrateDiskName, + isOSDisk, + capacityInBytes, + isDynamic, + diskType, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC mac address. + /// Gets or sets the NIC label. + /// Gets or sets a value indicating whether this is the primary NIC. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// A new instance for mocking. + public static VMwareToAzStackHciProtectedNicProperties VMwareToAzStackHciProtectedNicProperties(string nicId = null, string macAddress = null, string label = null, bool? isPrimaryNic = null, string networkName = null, string targetNetworkId = null, string testNetworkId = null, VmNicSelection? selectionTypeForFailover = null) + { + return new VMwareToAzStackHciProtectedNicProperties( + nicId, + macAddress, + label, + isPrimaryNic, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Protected item model properties. + /// A new instance for mocking. + public static DataReplicationProtectedItemPatch DataReplicationProtectedItemPatch(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationProtectedItemCustomPropertiesUpdate customProperties = null) + { + return new DataReplicationProtectedItemPatch( + id, + name, + resourceType, + systemData, + customProperties != null ? new DataReplicationProtectedItemPropertiesUpdate(customProperties, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationRecoveryPointData DataReplicationRecoveryPointData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationRecoveryPointProperties properties = null) + { + return new DataReplicationRecoveryPointData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the recovery point time. + /// Gets or sets the recovery point type. + /// + /// Recovery point model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Gets or sets the provisioning state of the recovery point item. + /// A new instance for mocking. + public static DataReplicationRecoveryPointProperties DataReplicationRecoveryPointProperties(DateTimeOffset recoveryPointOn = default, DataReplicationRecoveryPointType recoveryPointType = default, DataReplicationRecoveryPointCustomProperties customProperties = null, DataReplicationProvisioningState? provisioningState = null) + { + return new DataReplicationRecoveryPointProperties(recoveryPointOn, recoveryPointType, customProperties, provisioningState, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the list of the disk Ids. + /// A new instance for mocking. + public static HyperVToAzStackHciRecoveryPointCustomProperties HyperVToAzStackHciRecoveryPointCustomProperties(IEnumerable diskIds = null) + { + diskIds ??= new List(); + + return new HyperVToAzStackHciRecoveryPointCustomProperties("HyperVToAzStackHCI", serializedAdditionalRawData: null, diskIds?.ToList()); + } + + /// Initializes a new instance of . + /// Gets or sets the list of the disk Ids. + /// A new instance for mocking. + public static VMwareToAzStackHciRecoveryPointCustomProperties VMwareToAzStackHciRecoveryPointCustomProperties(IEnumerable diskIds = null) + { + diskIds ??= new List(); + + return new VMwareToAzStackHciRecoveryPointCustomProperties("VMwareToAzStackHCIRecoveryPointModelCustomProperties", serializedAdditionalRawData: null, diskIds?.ToList()); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// A new instance for mocking. + public static DataReplicationExtensionData DataReplicationExtensionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, DataReplicationExtensionProperties properties = null) + { + return new DataReplicationExtensionData( + id, + name, + resourceType, + systemData, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the replication extension. + /// + /// Replication extension model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// A new instance for mocking. + public static DataReplicationExtensionProperties DataReplicationExtensionProperties(DataReplicationProvisioningState? provisioningState = null, DataReplicationExtensionCustomProperties customProperties = null) + { + return new DataReplicationExtensionProperties(provisioningState, customProperties, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the source HyperV fabric. + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the storage account Id. + /// Gets or sets the Sas Secret of storage account. + /// Gets or sets the Uri of ASR. + /// Gets or sets the Uri of Rcm. + /// Gets or sets the Uri of Gateway. + /// Gets or sets the gateway service Id of source. + /// Gets or sets the gateway service Id of target. + /// Gets or sets the source storage container name. + /// Gets or sets the target storage container name. + /// Gets or sets the resource location. + /// Gets or sets the subscription. + /// Gets or sets the resource group. + /// A new instance for mocking. + public static HyperVToAzStackHciReplicationExtensionCustomProperties HyperVToAzStackHciReplicationExtensionCustomProperties(ResourceIdentifier hyperVFabricArmId = null, ResourceIdentifier hyperVSiteId = null, ResourceIdentifier azStackHciFabricArmId = null, ResourceIdentifier azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, Uri asrServiceUri = null, Uri rcmServiceUri = null, Uri gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) + { + return new HyperVToAzStackHciReplicationExtensionCustomProperties( + "HyperVToAzStackHCI", + serializedAdditionalRawData: null, + hyperVFabricArmId, + hyperVSiteId, + azStackHciFabricArmId, + azStackHciSiteId, + storageAccountId, + storageAccountSasSecretName, + asrServiceUri, + rcmServiceUri, + gatewayServiceUri, + sourceGatewayServiceId, + targetGatewayServiceId, + sourceStorageContainerName, + targetStorageContainerName, + resourceLocation, + subscriptionId, + resourceGroup); + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the source VMware fabric. + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the storage account Id. + /// Gets or sets the Sas Secret of storage account. + /// Gets or sets the Uri of ASR. + /// Gets or sets the Uri of Rcm. + /// Gets or sets the Uri of Gateway. + /// Gets or sets the gateway service Id of source. + /// Gets or sets the gateway service Id of target. + /// Gets or sets the source storage container name. + /// Gets or sets the target storage container name. + /// Gets or sets the resource location. + /// Gets or sets the subscription. + /// Gets or sets the resource group. + /// A new instance for mocking. + public static VMwareToAzStackHciReplicationExtensionCustomProperties VMwareToAzStackHciReplicationExtensionCustomProperties(ResourceIdentifier vmwareFabricArmId = null, ResourceIdentifier vmwareSiteId = null, ResourceIdentifier azStackHciFabricArmId = null, ResourceIdentifier azStackHciSiteId = null, string storageAccountId = null, string storageAccountSasSecretName = null, Uri asrServiceUri = null, Uri rcmServiceUri = null, Uri gatewayServiceUri = null, string sourceGatewayServiceId = null, string targetGatewayServiceId = null, string sourceStorageContainerName = null, string targetStorageContainerName = null, string resourceLocation = null, string subscriptionId = null, string resourceGroup = null) + { + return new VMwareToAzStackHciReplicationExtensionCustomProperties( + "VMwareToAzStackHCI", + serializedAdditionalRawData: null, + vmwareFabricArmId, + vmwareSiteId, + azStackHciFabricArmId, + azStackHciSiteId, + storageAccountId, + storageAccountSasSecretName, + asrServiceUri, + rcmServiceUri, + gatewayServiceUri, + sourceGatewayServiceId, + targetGatewayServiceId, + sourceStorageContainerName, + targetStorageContainerName, + resourceLocation, + subscriptionId, + resourceGroup); + } + + /// Initializes a new instance of . + /// Gets or sets a value indicating whether resource name is available or not. + /// Gets or sets the reason for resource name unavailability. + /// Gets or sets the message for resource name unavailability. + /// A new instance for mocking. + public static DataReplicationNameAvailabilityResult DataReplicationNameAvailabilityResult(bool? isNameAvailable = null, string reason = null, string message = null) + { + return new DataReplicationNameAvailabilityResult(isNameAvailable, reason, message, serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationCollection.cs new file mode 100644 index 000000000000..0ddf694241ee --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataReplicationEmailConfigurations method from an instance of . + /// + public partial class DataReplicationEmailConfigurationCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics; + private readonly EmailConfigurationRestOperations _dataReplicationEmailConfigurationEmailConfigurationRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationEmailConfigurationCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataReplicationEmailConfigurationCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationEmailConfigurationResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationEmailConfigurationResource.ResourceType, out string dataReplicationEmailConfigurationEmailConfigurationApiVersion); + _dataReplicationEmailConfigurationEmailConfigurationRestClient = new EmailConfigurationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationEmailConfigurationEmailConfigurationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The email configuration name. + /// EmailConfiguration model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string emailConfigurationName, DataReplicationEmailConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data, cancellationToken).ConfigureAwait(false); + var uri = _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The email configuration name. + /// EmailConfiguration model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string emailConfigurationName, DataReplicationEmailConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationEmailConfigurationEmailConfigurationRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data, cancellationToken); + var uri = _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationEmailConfigurationEmailConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationEmailConfigurationEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of alert configuration settings for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings + /// + /// + /// Operation Id + /// EmailConfigurationModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationEmailConfigurationResource(Client, DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(e)), _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics, Pipeline, "DataReplicationEmailConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of alert configuration settings for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings + /// + /// + /// Operation Id + /// EmailConfigurationModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationEmailConfigurationResource(Client, DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(e)), _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics, Pipeline, "DataReplicationEmailConfigurationCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationEmailConfigurationEmailConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationEmailConfigurationEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationEmailConfigurationEmailConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationEmailConfigurationEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, emailConfigurationName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.Serialization.cs new file mode 100644 index 000000000000..1fea10fc7ff4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationEmailConfigurationData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationEmailConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationEmailConfigurationData(document.RootElement, options); + } + + internal static DataReplicationEmailConfigurationData DeserializeDataReplicationEmailConfigurationData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationEmailConfigurationProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationEmailConfigurationProperties.DeserializeDataReplicationEmailConfigurationProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationEmailConfigurationData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationEmailConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationEmailConfigurationData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.cs new file mode 100644 index 000000000000..c1304e975d21 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationEmailConfiguration data model. + /// Email configuration model. + /// + public partial class DataReplicationEmailConfigurationData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationEmailConfigurationData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationEmailConfigurationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationEmailConfigurationProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationEmailConfigurationProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.Serialization.cs new file mode 100644 index 000000000000..d8e187153d99 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationEmailConfigurationResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationEmailConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataReplicationEmailConfigurationData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.cs new file mode 100644 index 000000000000..f41692182ae8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEmailConfigurationResource.cs @@ -0,0 +1,267 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationEmailConfiguration along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataReplicationEmailConfigurationResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationEmailConfiguration method. + /// + public partial class DataReplicationEmailConfigurationResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The emailConfigurationName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics; + private readonly EmailConfigurationRestOperations _dataReplicationEmailConfigurationEmailConfigurationRestClient; + private readonly DataReplicationEmailConfigurationData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/alertSettings"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationEmailConfigurationResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationEmailConfigurationResource(ArmClient client, DataReplicationEmailConfigurationData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataReplicationEmailConfigurationResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationEmailConfigurationEmailConfigurationApiVersion); + _dataReplicationEmailConfigurationEmailConfigurationRestClient = new EmailConfigurationRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationEmailConfigurationEmailConfigurationApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationEmailConfigurationData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationEmailConfigurationEmailConfigurationRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationEmailConfigurationEmailConfigurationRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// EmailConfiguration model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationEmailConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates an alert configuration setting for the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// EmailConfiguration model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationEmailConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationEmailConfigurationEmailConfigurationClientDiagnostics.CreateScope("DataReplicationEmailConfigurationResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationEmailConfigurationEmailConfigurationRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _dataReplicationEmailConfigurationEmailConfigurationRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationEmailConfigurationResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventCollection.cs new file mode 100644 index 000000000000..8251eebbed31 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventCollection.cs @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataReplicationEvents method from an instance of . + /// + public partial class DataReplicationEventCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationEventEventClientDiagnostics; + private readonly EventRestOperations _dataReplicationEventEventRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationEventCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataReplicationEventCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationEventEventClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationEventResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationEventResource.ResourceType, out string dataReplicationEventEventApiVersion); + _dataReplicationEventEventRestClient = new EventRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationEventEventApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationEventEventRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEventResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationEventEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEventResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of events in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events + /// + /// + /// Operation Id + /// EventModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationEventEventRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationEventEventRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationEventResource(Client, DataReplicationEventData.DeserializeDataReplicationEventData(e)), _dataReplicationEventEventClientDiagnostics, Pipeline, "DataReplicationEventCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of events in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events + /// + /// + /// Operation Id + /// EventModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationEventEventRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationEventEventRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationEventResource(Client, DataReplicationEventData.DeserializeDataReplicationEventData(e)), _dataReplicationEventEventClientDiagnostics, Pipeline, "DataReplicationEventCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationEventEventRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationEventEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationEventEventRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEventResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var scope = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationEventEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, eventName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEventResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.Serialization.cs new file mode 100644 index 000000000000..ed72d1b35393 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationEventData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationEventData(document.RootElement, options); + } + + internal static DataReplicationEventData DeserializeDataReplicationEventData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationEventProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationEventProperties.DeserializeDataReplicationEventProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationEventData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationEventData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationEventData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationEventData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.cs new file mode 100644 index 000000000000..0c6f9016a4d8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationEvent data model. + /// Event model. + /// + public partial class DataReplicationEventData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationEventData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationEventData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationEventProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationEventProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.Serialization.cs new file mode 100644 index 000000000000..9bf0385d2adf --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationEventResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationEventData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataReplicationEventData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.cs new file mode 100644 index 000000000000..b6e992c7f5da --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationEventResource.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationEvent along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataReplicationEventResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationEvent method. + /// + public partial class DataReplicationEventResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The eventName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string eventName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationEventEventClientDiagnostics; + private readonly EventRestOperations _dataReplicationEventEventRestClient; + private readonly DataReplicationEventData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/events"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationEventResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationEventResource(ArmClient client, DataReplicationEventData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataReplicationEventResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationEventEventClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationEventEventApiVersion); + _dataReplicationEventEventRestClient = new EventRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationEventEventApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationEventData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationEventEventRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEventResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationEventEventClientDiagnostics.CreateScope("DataReplicationEventResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationEventEventRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationEventResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionCollection.cs new file mode 100644 index 000000000000..de79586a9ba3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataReplicationExtensions method from an instance of . + /// + public partial class DataReplicationExtensionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationExtensionReplicationExtensionClientDiagnostics; + private readonly ReplicationExtensionRestOperations _dataReplicationExtensionReplicationExtensionRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationExtensionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataReplicationExtensionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationExtensionReplicationExtensionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationExtensionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationExtensionResource.ResourceType, out string dataReplicationExtensionReplicationExtensionApiVersion); + _dataReplicationExtensionReplicationExtensionRestClient = new ReplicationExtensionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationExtensionReplicationExtensionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The replication extension name. + /// Replication extension model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string replicationExtensionName, DataReplicationExtensionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationExtensionOperationSource(Client), _dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, _dataReplicationExtensionReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The replication extension name. + /// Replication extension model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string replicationExtensionName, DataReplicationExtensionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationExtensionOperationSource(Client), _dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, _dataReplicationExtensionReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationExtensionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationExtensionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of replication extensions in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions + /// + /// + /// Operation Id + /// ReplicationExtensionModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationExtensionReplicationExtensionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationExtensionReplicationExtensionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationExtensionResource(Client, DataReplicationExtensionData.DeserializeDataReplicationExtensionData(e)), _dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, "DataReplicationExtensionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of replication extensions in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions + /// + /// + /// Operation Id + /// ReplicationExtensionModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationExtensionReplicationExtensionRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationExtensionReplicationExtensionRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationExtensionResource(Client, DataReplicationExtensionData.DeserializeDataReplicationExtensionData(e)), _dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, "DataReplicationExtensionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationExtensionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, replicationExtensionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationExtensionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.Serialization.cs new file mode 100644 index 000000000000..8a2800af8fd1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationExtensionData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationExtensionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationExtensionData(document.RootElement, options); + } + + internal static DataReplicationExtensionData DeserializeDataReplicationExtensionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationExtensionProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationExtensionProperties.DeserializeDataReplicationExtensionProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationExtensionData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationExtensionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationExtensionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.cs new file mode 100644 index 000000000000..9545a0ca87b9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationExtension data model. + /// Replication extension model. + /// + public partial class DataReplicationExtensionData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationExtensionData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationExtensionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationExtensionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationExtensionProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.Serialization.cs new file mode 100644 index 000000000000..24f19c3a833a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationExtensionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationExtensionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataReplicationExtensionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.cs new file mode 100644 index 000000000000..3f20dcf023be --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationExtensionResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationExtension along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataReplicationExtensionResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationExtension method. + /// + public partial class DataReplicationExtensionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The replicationExtensionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationExtensionReplicationExtensionClientDiagnostics; + private readonly ReplicationExtensionRestOperations _dataReplicationExtensionReplicationExtensionRestClient; + private readonly DataReplicationExtensionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/replicationExtensions"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationExtensionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationExtensionResource(ArmClient client, DataReplicationExtensionData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataReplicationExtensionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationExtensionReplicationExtensionClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationExtensionReplicationExtensionApiVersion); + _dataReplicationExtensionReplicationExtensionRestClient = new ReplicationExtensionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationExtensionReplicationExtensionApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationExtensionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationExtensionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationExtensionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, _dataReplicationExtensionReplicationExtensionRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, _dataReplicationExtensionReplicationExtensionRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Replication extension model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationExtensionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationExtensionReplicationExtensionRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationExtensionOperationSource(Client), _dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, _dataReplicationExtensionReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the replication extension in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Replication extension model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationExtensionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationExtensionReplicationExtensionClientDiagnostics.CreateScope("DataReplicationExtensionResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationExtensionReplicationExtensionRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationExtensionOperationSource(Client), _dataReplicationExtensionReplicationExtensionClientDiagnostics, Pipeline, _dataReplicationExtensionReplicationExtensionRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentCollection.cs new file mode 100644 index 000000000000..03d6314fd129 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataReplicationFabricAgents method from an instance of . + /// + public partial class DataReplicationFabricAgentCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationFabricAgentFabricAgentClientDiagnostics; + private readonly FabricAgentRestOperations _dataReplicationFabricAgentFabricAgentRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationFabricAgentCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataReplicationFabricAgentCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationFabricAgentFabricAgentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationFabricAgentResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationFabricAgentResource.ResourceType, out string dataReplicationFabricAgentFabricAgentApiVersion); + _dataReplicationFabricAgentFabricAgentRestClient = new FabricAgentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationFabricAgentFabricAgentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationFabricResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationFabricResource.ResourceType), nameof(id)); + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The fabric agent name. + /// Fabric agent model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fabricAgentName, DataReplicationFabricAgentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricAgentOperationSource(Client), _dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, _dataReplicationFabricAgentFabricAgentRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The fabric agent name. + /// Fabric agent model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fabricAgentName, DataReplicationFabricAgentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricAgentOperationSource(Client), _dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, _dataReplicationFabricAgentFabricAgentRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricAgentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricAgentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of fabric agents in the given fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents + /// + /// + /// Operation Id + /// FabricAgentModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationFabricAgentFabricAgentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationFabricAgentFabricAgentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricAgentResource(Client, DataReplicationFabricAgentData.DeserializeDataReplicationFabricAgentData(e)), _dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, "DataReplicationFabricAgentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of fabric agents in the given fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents + /// + /// + /// Operation Id + /// FabricAgentModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationFabricAgentFabricAgentRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationFabricAgentFabricAgentRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricAgentResource(Client, DataReplicationFabricAgentData.DeserializeDataReplicationFabricAgentData(e)), _dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, "DataReplicationFabricAgentCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricAgentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, fabricAgentName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricAgentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.Serialization.cs new file mode 100644 index 000000000000..e6ca06e88a9b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationFabricAgentData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationFabricAgentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricAgentData(document.RootElement, options); + } + + internal static DataReplicationFabricAgentData DeserializeDataReplicationFabricAgentData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationFabricAgentProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationFabricAgentProperties.DeserializeDataReplicationFabricAgentProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationFabricAgentData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricAgentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricAgentData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.cs new file mode 100644 index 000000000000..f8d327a26466 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationFabricAgent data model. + /// Fabric agent model. + /// + public partial class DataReplicationFabricAgentData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationFabricAgentData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricAgentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationFabricAgentProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationFabricAgentProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.Serialization.cs new file mode 100644 index 000000000000..3b2f408ad25e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationFabricAgentResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationFabricAgentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataReplicationFabricAgentData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.cs new file mode 100644 index 000000000000..4f3e4be113ea --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricAgentResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationFabricAgent along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataReplicationFabricAgentResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationFabricAgent method. + /// + public partial class DataReplicationFabricAgentResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fabricName. + /// The fabricAgentName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationFabricAgentFabricAgentClientDiagnostics; + private readonly FabricAgentRestOperations _dataReplicationFabricAgentFabricAgentRestClient; + private readonly DataReplicationFabricAgentData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationFabrics/fabricAgents"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationFabricAgentResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationFabricAgentResource(ArmClient client, DataReplicationFabricAgentData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataReplicationFabricAgentResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationFabricAgentFabricAgentClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationFabricAgentFabricAgentApiVersion); + _dataReplicationFabricAgentFabricAgentRestClient = new FabricAgentRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationFabricAgentFabricAgentApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationFabricAgentData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricAgentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricAgentResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, _dataReplicationFabricAgentFabricAgentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, _dataReplicationFabricAgentFabricAgentRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Fabric agent model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationFabricAgentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationFabricAgentFabricAgentRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricAgentOperationSource(Client), _dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, _dataReplicationFabricAgentFabricAgentRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Fabric agent model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationFabricAgentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationFabricAgentFabricAgentClientDiagnostics.CreateScope("DataReplicationFabricAgentResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationFabricAgentFabricAgentRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricAgentOperationSource(Client), _dataReplicationFabricAgentFabricAgentClientDiagnostics, Pipeline, _dataReplicationFabricAgentFabricAgentRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricCollection.cs new file mode 100644 index 000000000000..1a7c875c1bf4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricCollection.cs @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataReplicationFabrics method from an instance of . + /// + public partial class DataReplicationFabricCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationFabricFabricClientDiagnostics; + private readonly FabricRestOperations _dataReplicationFabricFabricRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationFabricCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataReplicationFabricCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationFabricFabricClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationFabricResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationFabricResource.ResourceType, out string dataReplicationFabricFabricApiVersion); + _dataReplicationFabricFabricRestClient = new FabricRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationFabricFabricApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Creates the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The fabric name. + /// Fabric properties. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string fabricName, DataReplicationFabricData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricOperationSource(Client), _dataReplicationFabricFabricClientDiagnostics, Pipeline, _dataReplicationFabricFabricRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The fabric name. + /// Fabric properties. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string fabricName, DataReplicationFabricData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricOperationSource(Client), _dataReplicationFabricFabricClientDiagnostics, Pipeline, _dataReplicationFabricFabricRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, fabricName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of fabrics in the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationFabricFabricRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationFabricFabricRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricResource(Client, DataReplicationFabricData.DeserializeDataReplicationFabricData(e)), _dataReplicationFabricFabricClientDiagnostics, Pipeline, "DataReplicationFabricCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationFabricFabricRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationFabricFabricRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricResource(Client, DataReplicationFabricData.DeserializeDataReplicationFabricData(e)), _dataReplicationFabricFabricClientDiagnostics, Pipeline, "DataReplicationFabricCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, fabricName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.Serialization.cs new file mode 100644 index 000000000000..4d8cc742286c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationFabricData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationFabricData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricData(document.RootElement, options); + } + + internal static DataReplicationFabricData DeserializeDataReplicationFabricData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationFabricProperties properties = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationFabricProperties.DeserializeDataReplicationFabricProperties(property.Value, options); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationFabricData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.cs new file mode 100644 index 000000000000..7dd748dd5e0e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricData.cs @@ -0,0 +1,83 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationFabric data model. + /// Fabric model. + /// + public partial class DataReplicationFabricData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public DataReplicationFabricData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DataReplicationFabricProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationFabricData() + { + } + + /// The resource-specific properties for this resource. + public DataReplicationFabricProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.Serialization.cs new file mode 100644 index 000000000000..ac1bd6f4517e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationFabricResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationFabricData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataReplicationFabricData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.cs new file mode 100644 index 000000000000..9f7c3ca2318e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationFabricResource.cs @@ -0,0 +1,776 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationFabric along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataReplicationFabricResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationFabric method. + /// + public partial class DataReplicationFabricResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The fabricName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string fabricName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationFabricFabricClientDiagnostics; + private readonly FabricRestOperations _dataReplicationFabricFabricRestClient; + private readonly DataReplicationFabricData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationFabrics"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationFabricResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationFabricResource(ArmClient client, DataReplicationFabricData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataReplicationFabricResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationFabricFabricClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationFabricFabricApiVersion); + _dataReplicationFabricFabricRestClient = new FabricRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationFabricFabricApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationFabricData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of DataReplicationFabricAgentResources in the DataReplicationFabric. + /// An object representing collection of DataReplicationFabricAgentResources and their operations over a DataReplicationFabricAgentResource. + public virtual DataReplicationFabricAgentCollection GetDataReplicationFabricAgents() + { + return GetCachedClient(client => new DataReplicationFabricAgentCollection(client, Id)); + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationFabricAgentAsync(string fabricAgentName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationFabricAgents().GetAsync(fabricAgentName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the fabric agent. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName}/fabricAgents/{fabricAgentName} + /// + /// + /// Operation Id + /// FabricAgentModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric agent name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationFabricAgent(string fabricAgentName, CancellationToken cancellationToken = default) + { + return GetDataReplicationFabricAgents().Get(fabricAgentName, cancellationToken); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationFabricResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationFabricFabricClientDiagnostics, Pipeline, _dataReplicationFabricFabricRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationFabricFabricClientDiagnostics, Pipeline, _dataReplicationFabricFabricRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Fabric properties. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationFabricPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationFabricFabricRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricOperationSource(Client), _dataReplicationFabricFabricClientDiagnostics, Pipeline, _dataReplicationFabricFabricRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Fabric properties. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationFabricPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationFabricFabricRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationFabricOperationSource(Client), _dataReplicationFabricFabricClientDiagnostics, Pipeline, _dataReplicationFabricFabricRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _dataReplicationFabricFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationFabricResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DataReplicationFabricPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DataReplicationFabricResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DataReplicationFabricPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _dataReplicationFabricFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationFabricResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DataReplicationFabricPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DataReplicationFabricResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DataReplicationFabricPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _dataReplicationFabricFabricRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationFabricResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DataReplicationFabricPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dataReplicationFabricFabricClientDiagnostics.CreateScope("DataReplicationFabricResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _dataReplicationFabricFabricRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DataReplicationFabricResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DataReplicationFabricPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobCollection.cs new file mode 100644 index 000000000000..9882bcf22856 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobCollection.cs @@ -0,0 +1,401 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataReplicationJobs method from an instance of . + /// + public partial class DataReplicationJobCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationJobJobClientDiagnostics; + private readonly JobRestOperations _dataReplicationJobJobRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationJobCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataReplicationJobCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationJobJobClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationJobResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationJobResource.ResourceType, out string dataReplicationJobJobApiVersion); + _dataReplicationJobJobRestClient = new JobRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationJobJobApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationJobJobRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationJobResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationJobJobRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationJobResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of jobs in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs + /// + /// + /// Operation Id + /// JobModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationJobJobRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationJobJobRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationJobResource(Client, DataReplicationJobData.DeserializeDataReplicationJobData(e)), _dataReplicationJobJobClientDiagnostics, Pipeline, "DataReplicationJobCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of jobs in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs + /// + /// + /// Operation Id + /// JobModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationJobJobRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationJobJobRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationJobResource(Client, DataReplicationJobData.DeserializeDataReplicationJobData(e)), _dataReplicationJobJobClientDiagnostics, Pipeline, "DataReplicationJobCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationJobJobRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationJobJobRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationJobJobRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationJobResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var scope = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationJobJobRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, jobName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationJobResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.Serialization.cs new file mode 100644 index 000000000000..1f5f0e05956e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationJobData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationJobData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationJobData(document.RootElement, options); + } + + internal static DataReplicationJobData DeserializeDataReplicationJobData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationJobProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationJobProperties.DeserializeDataReplicationJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationJobData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationJobData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationJobData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationJobData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationJobData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.cs new file mode 100644 index 000000000000..64ac143311e3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationJob data model. + /// Job model. + /// + public partial class DataReplicationJobData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationJobData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationJobData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationJobProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationJobProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.Serialization.cs new file mode 100644 index 000000000000..f8451d930cd1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationJobResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationJobData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataReplicationJobData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.cs new file mode 100644 index 000000000000..e8ff5fbc24d2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationJobResource.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationJob along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataReplicationJobResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationJob method. + /// + public partial class DataReplicationJobResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The jobName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string jobName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationJobJobClientDiagnostics; + private readonly JobRestOperations _dataReplicationJobJobRestClient; + private readonly DataReplicationJobData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/jobs"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationJobResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationJobResource(ArmClient client, DataReplicationJobData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataReplicationJobResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationJobJobClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationJobJobApiVersion); + _dataReplicationJobJobRestClient = new JobRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationJobJobApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationJobData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationJobJobRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationJobResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationJobJobClientDiagnostics.CreateScope("DataReplicationJobResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationJobJobRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationJobResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyCollection.cs new file mode 100644 index 000000000000..9bf439154997 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyCollection.cs @@ -0,0 +1,493 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataReplicationPolicies method from an instance of . + /// + public partial class DataReplicationPolicyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationPolicyPolicyClientDiagnostics; + private readonly PolicyRestOperations _dataReplicationPolicyPolicyRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPolicyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataReplicationPolicyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPolicyPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationPolicyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationPolicyResource.ResourceType, out string dataReplicationPolicyPolicyApiVersion); + _dataReplicationPolicyPolicyRestClient = new PolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPolicyPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The policy name. + /// Policy model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string policyName, DataReplicationPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationPolicyOperationSource(Client), _dataReplicationPolicyPolicyClientDiagnostics, Pipeline, _dataReplicationPolicyPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The policy name. + /// Policy model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string policyName, DataReplicationPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationPolicyOperationSource(Client), _dataReplicationPolicyPolicyClientDiagnostics, Pipeline, _dataReplicationPolicyPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of policies in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies + /// + /// + /// Operation Id + /// PolicyModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPolicyPolicyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPolicyPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPolicyResource(Client, DataReplicationPolicyData.DeserializeDataReplicationPolicyData(e)), _dataReplicationPolicyPolicyClientDiagnostics, Pipeline, "DataReplicationPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of policies in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies + /// + /// + /// Operation Id + /// PolicyModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPolicyPolicyRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPolicyPolicyRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPolicyResource(Client, DataReplicationPolicyData.DeserializeDataReplicationPolicyData(e)), _dataReplicationPolicyPolicyClientDiagnostics, Pipeline, "DataReplicationPolicyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, policyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.Serialization.cs new file mode 100644 index 000000000000..fbad606ae91b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPolicyData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationPolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPolicyData(document.RootElement, options); + } + + internal static DataReplicationPolicyData DeserializeDataReplicationPolicyData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationPolicyProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationPolicyProperties.DeserializeDataReplicationPolicyProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPolicyData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPolicyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPolicyData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.cs new file mode 100644 index 000000000000..acce053623d2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationPolicy data model. + /// Policy model. + /// + public partial class DataReplicationPolicyData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPolicyData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPolicyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationPolicyProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationPolicyProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.Serialization.cs new file mode 100644 index 000000000000..303d1f05d783 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPolicyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationPolicyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataReplicationPolicyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.cs new file mode 100644 index 000000000000..1e5f0980a46c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPolicyResource.cs @@ -0,0 +1,347 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationPolicy along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataReplicationPolicyResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationPolicy method. + /// + public partial class DataReplicationPolicyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The policyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationPolicyPolicyClientDiagnostics; + private readonly PolicyRestOperations _dataReplicationPolicyPolicyRestClient; + private readonly DataReplicationPolicyData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/replicationPolicies"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPolicyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationPolicyResource(ArmClient client, DataReplicationPolicyData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataReplicationPolicyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPolicyPolicyClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationPolicyPolicyApiVersion); + _dataReplicationPolicyPolicyRestClient = new PolicyRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPolicyPolicyApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationPolicyData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPolicyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationPolicyPolicyClientDiagnostics, Pipeline, _dataReplicationPolicyPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationPolicyPolicyClientDiagnostics, Pipeline, _dataReplicationPolicyPolicyRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Policy model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationPolicyPolicyRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationPolicyOperationSource(Client), _dataReplicationPolicyPolicyClientDiagnostics, Pipeline, _dataReplicationPolicyPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Policy model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPolicyPolicyClientDiagnostics.CreateScope("DataReplicationPolicyResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationPolicyPolicyRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationPolicyOperationSource(Client), _dataReplicationPolicyPolicyClientDiagnostics, Pipeline, _dataReplicationPolicyPolicyRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionCollection.cs new file mode 100644 index 000000000000..300722d92cd0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataReplicationPrivateEndpointConnections method from an instance of . + /// + public partial class DataReplicationPrivateEndpointConnectionCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnectionsRestOperations _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPrivateEndpointConnectionCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataReplicationPrivateEndpointConnectionCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationPrivateEndpointConnectionResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationPrivateEndpointConnectionResource.ResourceType, out string dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The private endpoint connection name. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string privateEndpointConnectionName, DataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken).ConfigureAwait(false); + var uri = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The private endpoint connection name. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string privateEndpointConnectionName, DataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data, cancellationToken); + var uri = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the all private endpoint connections configured on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnection_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPrivateEndpointConnectionResource(Client, DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(e)), _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "DataReplicationPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the all private endpoint connections configured on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections + /// + /// + /// Operation Id + /// PrivateEndpointConnection_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPrivateEndpointConnectionResource(Client, DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(e)), _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, "DataReplicationPrivateEndpointConnectionCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.Serialization.cs new file mode 100644 index 000000000000..bac50524e70a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPrivateEndpointConnectionData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateEndpointConnectionData(document.RootElement, options); + } + + internal static DataReplicationPrivateEndpointConnectionData DeserializeDataReplicationPrivateEndpointConnectionData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationPrivateEndpointConnectionProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationPrivateEndpointConnectionProperties.DeserializeDataReplicationPrivateEndpointConnectionProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateEndpointConnectionData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateEndpointConnectionData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.cs new file mode 100644 index 000000000000..11a877d0e212 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationPrivateEndpointConnection data model. + /// Represents private endpoint connection. + /// + public partial class DataReplicationPrivateEndpointConnectionData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateEndpointConnectionData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateEndpointConnectionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationPrivateEndpointConnectionProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationPrivateEndpointConnectionProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyCollection.cs new file mode 100644 index 000000000000..e50b05a62f8c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyCollection.cs @@ -0,0 +1,497 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataReplicationPrivateEndpointConnectionProxies method from an instance of . + /// + public partial class DataReplicationPrivateEndpointConnectionProxyCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics; + private readonly PrivateEndpointConnectionProxiesRestOperations _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPrivateEndpointConnectionProxyCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataReplicationPrivateEndpointConnectionProxyCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationPrivateEndpointConnectionProxyResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationPrivateEndpointConnectionProxyResource.ResourceType, out string dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesApiVersion); + _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient = new PrivateEndpointConnectionProxiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The private endpoint connection proxy name. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, data, cancellationToken).ConfigureAwait(false); + var uri = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The private endpoint connection proxy name. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, data, cancellationToken); + var uri = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the all private endpoint connections proxies. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPrivateEndpointConnectionProxyResource(Client, DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(e)), _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics, Pipeline, "DataReplicationPrivateEndpointConnectionProxyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the all private endpoint connections proxies. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPrivateEndpointConnectionProxyResource(Client, DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(e)), _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics, Pipeline, "DataReplicationPrivateEndpointConnectionProxyCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateEndpointConnectionProxyName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.Serialization.cs new file mode 100644 index 000000000000..ee92fa905311 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.Serialization.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPrivateEndpointConnectionProxyData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(ETag)) + { + writer.WritePropertyName("etag"u8); + writer.WriteStringValue(ETag.Value.ToString()); + } + } + + DataReplicationPrivateEndpointConnectionProxyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement, options); + } + + internal static DataReplicationPrivateEndpointConnectionProxyData DeserializeDataReplicationPrivateEndpointConnectionProxyData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationPrivateEndpointConnectionProxyProperties properties = default; + ETag? etag = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationPrivateEndpointConnectionProxyProperties.DeserializeDataReplicationPrivateEndpointConnectionProxyProperties(property.Value, options); + continue; + } + if (property.NameEquals("etag"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + etag = new ETag(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateEndpointConnectionProxyData( + id, + name, + type, + systemData, + properties, + etag, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateEndpointConnectionProxyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.cs new file mode 100644 index 000000000000..082924082ed2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyData.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationPrivateEndpointConnectionProxy data model. + /// Represents private endpoint connection proxy request. + /// + public partial class DataReplicationPrivateEndpointConnectionProxyData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateEndpointConnectionProxyData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Gets or sets ETag. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateEndpointConnectionProxyData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationPrivateEndpointConnectionProxyProperties properties, ETag? etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + ETag = etag; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationPrivateEndpointConnectionProxyProperties Properties { get; set; } + /// Gets or sets ETag. + public ETag? ETag { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.Serialization.cs new file mode 100644 index 000000000000..8e4cf3e5abb2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPrivateEndpointConnectionProxyResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationPrivateEndpointConnectionProxyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataReplicationPrivateEndpointConnectionProxyData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.cs new file mode 100644 index 000000000000..4bcac0c15bab --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionProxyResource.cs @@ -0,0 +1,435 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationPrivateEndpointConnectionProxy along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataReplicationPrivateEndpointConnectionProxyResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationPrivateEndpointConnectionProxy method. + /// + public partial class DataReplicationPrivateEndpointConnectionProxyResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The privateEndpointConnectionProxyName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics; + private readonly PrivateEndpointConnectionProxiesRestOperations _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient; + private readonly DataReplicationPrivateEndpointConnectionProxyData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/privateEndpointConnectionProxies"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPrivateEndpointConnectionProxyResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationPrivateEndpointConnectionProxyResource(ArmClient client, DataReplicationPrivateEndpointConnectionProxyData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataReplicationPrivateEndpointConnectionProxyResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesApiVersion); + _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient = new PrivateEndpointConnectionProxiesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationPrivateEndpointConnectionProxyData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the operation to track the deletion of private endpoint connection proxy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics, Pipeline, _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns the operation to track the deletion of private endpoint connection proxy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics, Pipeline, _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.CreateCreateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns remote private endpoint connection information after validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName}/validate + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxies_Validate + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy input. + /// The cancellation token to use. + /// is null. + public virtual async Task> ValidateAsync(DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Validate"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.ValidateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Returns remote private endpoint connection information after validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName}/validate + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxies_Validate + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy input. + /// The cancellation token to use. + /// is null. + public virtual Response Validate(DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionProxyResource.Validate"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionProxyPrivateEndpointConnectionProxiesRestClient.Validate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionProxyResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.Serialization.cs new file mode 100644 index 000000000000..434b482455cc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPrivateEndpointConnectionResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataReplicationPrivateEndpointConnectionData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.cs new file mode 100644 index 000000000000..cb86be109a33 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateEndpointConnectionResource.cs @@ -0,0 +1,351 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationPrivateEndpointConnection along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataReplicationPrivateEndpointConnectionResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationPrivateEndpointConnection method. + /// + public partial class DataReplicationPrivateEndpointConnectionResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The privateEndpointConnectionName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics; + private readonly PrivateEndpointConnectionsRestOperations _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient; + private readonly DataReplicationPrivateEndpointConnectionData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/privateEndpointConnections"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPrivateEndpointConnectionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationPrivateEndpointConnectionResource(ArmClient client, DataReplicationPrivateEndpointConnectionData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataReplicationPrivateEndpointConnectionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); + _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient = new PrivateEndpointConnectionsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationPrivateEndpointConnectionData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the private endpoint connection. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics, Pipeline, _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var uri = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsClientDiagnostics.CreateScope("DataReplicationPrivateEndpointConnectionResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var uri = _dataReplicationPrivateEndpointConnectionPrivateEndpointConnectionsRestClient.CreateUpdateRequestUri(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data); + var rehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(RequestMethod.Put, uri.ToUri(), uri.ToString(), "None", null, OperationFinalStateVia.OriginalUri.ToString()); + var operation = new RecoveryServicesDataReplicationArmOperation(Response.FromValue(new DataReplicationPrivateEndpointConnectionResource(Client, response), response.GetRawResponse()), rehydrationToken); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.Serialization.cs new file mode 100644 index 000000000000..c632b70466d2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPrivateLinkResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationPrivateLinkResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataReplicationPrivateLinkResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.cs new file mode 100644 index 000000000000..82229fe52243 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResource.cs @@ -0,0 +1,171 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationPrivateLinkResource along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataReplicationPrivateLinkResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationPrivateLinkResource method. + /// + public partial class DataReplicationPrivateLinkResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The privateLinkResourceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics; + private readonly PrivateLinkResourcesRestOperations _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient; + private readonly DataReplicationPrivateLinkResourceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/privateLinkResources"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPrivateLinkResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationPrivateLinkResource(ArmClient client, DataReplicationPrivateLinkResourceData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataReplicationPrivateLinkResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationPrivateLinkResourcePrivateLinkResourcesApiVersion); + _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPrivateLinkResourcePrivateLinkResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationPrivateLinkResourceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceCollection.cs new file mode 100644 index 000000000000..ec9128bba49f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataReplicationPrivateLinkResources method from an instance of . + /// + public partial class DataReplicationPrivateLinkResourceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics; + private readonly PrivateLinkResourcesRestOperations _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationPrivateLinkResourceCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataReplicationPrivateLinkResourceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationPrivateLinkResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationPrivateLinkResource.ResourceType, out string dataReplicationPrivateLinkResourcePrivateLinkResourcesApiVersion); + _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient = new PrivateLinkResourcesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationPrivateLinkResourcePrivateLinkResourcesApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResourceCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResourceCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of private link resources. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResource_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPrivateLinkResource(Client, DataReplicationPrivateLinkResourceData.DeserializeDataReplicationPrivateLinkResourceData(e)), _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics, Pipeline, "DataReplicationPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of private link resources. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources + /// + /// + /// Operation Id + /// PrivateLinkResource_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationPrivateLinkResource(Client, DataReplicationPrivateLinkResourceData.DeserializeDataReplicationPrivateLinkResourceData(e)), _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics, Pipeline, "DataReplicationPrivateLinkResourceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResourceCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResourceCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var scope = _dataReplicationPrivateLinkResourcePrivateLinkResourcesClientDiagnostics.CreateScope("DataReplicationPrivateLinkResourceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationPrivateLinkResourcePrivateLinkResourcesRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, privateLinkResourceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationPrivateLinkResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.Serialization.cs new file mode 100644 index 000000000000..24f8a1e404f7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationPrivateLinkResourceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationPrivateLinkResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateLinkResourceData(document.RootElement, options); + } + + internal static DataReplicationPrivateLinkResourceData DeserializeDataReplicationPrivateLinkResourceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationPrivateLinkResourceProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationPrivateLinkResourceProperties.DeserializeDataReplicationPrivateLinkResourceProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateLinkResourceData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateLinkResourceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateLinkResourceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.cs new file mode 100644 index 000000000000..242cd05cb8ec --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationPrivateLinkResourceData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationPrivateLinkResource data model. + /// Represents private link resource. + /// + public partial class DataReplicationPrivateLinkResourceData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationPrivateLinkResourceData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateLinkResourceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationPrivateLinkResourceProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationPrivateLinkResourceProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemCollection.cs new file mode 100644 index 000000000000..e26b49bca18d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemCollection.cs @@ -0,0 +1,499 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataReplicationProtectedItems method from an instance of . + /// + public partial class DataReplicationProtectedItemCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationProtectedItemProtectedItemClientDiagnostics; + private readonly ProtectedItemRestOperations _dataReplicationProtectedItemProtectedItemRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationProtectedItemCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataReplicationProtectedItemCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationProtectedItemProtectedItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationProtectedItemResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationProtectedItemResource.ResourceType, out string dataReplicationProtectedItemProtectedItemApiVersion); + _dataReplicationProtectedItemProtectedItemRestClient = new ProtectedItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationProtectedItemProtectedItemApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationVaultResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationVaultResource.ResourceType), nameof(id)); + } + + /// + /// Creates the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The protected item name. + /// Protected item model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string protectedItemName, DataReplicationProtectedItemData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationProtectedItemOperationSource(Client), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The protected item name. + /// Protected item model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string protectedItemName, DataReplicationProtectedItemData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationProtectedItemOperationSource(Client), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationProtectedItemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationProtectedItemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of protected items in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems + /// + /// + /// Operation Id + /// ProtectedItemModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationProtectedItemProtectedItemRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationProtectedItemProtectedItemRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationProtectedItemResource(Client, DataReplicationProtectedItemData.DeserializeDataReplicationProtectedItemData(e)), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, "DataReplicationProtectedItemCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of protected items in the given vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems + /// + /// + /// Operation Id + /// ProtectedItemModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationProtectedItemProtectedItemRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationProtectedItemProtectedItemRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name, odataOptions, continuationToken, pageSizeHint); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationProtectedItemResource(Client, DataReplicationProtectedItemData.DeserializeDataReplicationProtectedItemData(e)), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, "DataReplicationProtectedItemCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationProtectedItemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, protectedItemName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationProtectedItemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.Serialization.cs new file mode 100644 index 000000000000..3e5ebe75e4a2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationProtectedItemData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationProtectedItemData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemData(document.RootElement, options); + } + + internal static DataReplicationProtectedItemData DeserializeDataReplicationProtectedItemData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProtectedItemProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationProtectedItemProperties.DeserializeDataReplicationProtectedItemProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationProtectedItemData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.cs new file mode 100644 index 000000000000..98d07e1183ab --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationProtectedItem data model. + /// Protected item model. + /// + public partial class DataReplicationProtectedItemData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationProtectedItemData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationProtectedItemData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationProtectedItemProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationProtectedItemProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.Serialization.cs new file mode 100644 index 000000000000..7d35a8aeef20 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationProtectedItemResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationProtectedItemData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataReplicationProtectedItemData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.cs new file mode 100644 index 000000000000..d610ccf560fc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationProtectedItemResource.cs @@ -0,0 +1,511 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationProtectedItem along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataReplicationProtectedItemResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationProtectedItem method. + /// + public partial class DataReplicationProtectedItemResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The protectedItemName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationProtectedItemProtectedItemClientDiagnostics; + private readonly ProtectedItemRestOperations _dataReplicationProtectedItemProtectedItemRestClient; + private readonly DataReplicationProtectedItemData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/protectedItems"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationProtectedItemResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationProtectedItemResource(ArmClient client, DataReplicationProtectedItemData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataReplicationProtectedItemResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationProtectedItemProtectedItemClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationProtectedItemProtectedItemApiVersion); + _dataReplicationProtectedItemProtectedItemRestClient = new ProtectedItemRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationProtectedItemProtectedItemApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationProtectedItemData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of DataReplicationRecoveryPointResources in the DataReplicationProtectedItem. + /// An object representing collection of DataReplicationRecoveryPointResources and their operations over a DataReplicationRecoveryPointResource. + public virtual DataReplicationRecoveryPointCollection GetDataReplicationRecoveryPoints() + { + return GetCachedClient(client => new DataReplicationRecoveryPointCollection(client, Id)); + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationRecoveryPointAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationRecoveryPoints().GetAsync(recoveryPointName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationRecoveryPoint(string recoveryPointName, CancellationToken cancellationToken = default) + { + return GetDataReplicationRecoveryPoints().Get(recoveryPointName, cancellationToken); + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationProtectedItemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationProtectedItemResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// A flag indicating whether to do force delete or not. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// A flag indicating whether to do force delete or not. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, forceDelete).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Protected item model. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationProtectedItemPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationProtectedItemOperationSource(Client), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Protected item model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationProtectedItemPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationProtectedItemOperationSource(Client), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs the planned failover on the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/plannedFailover + /// + /// + /// Operation Id + /// ProtectedItem_PlannedFailover + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Planned failover model. + /// The cancellation token to use. + /// is null. + public virtual async Task> PlannedFailoverAsync(WaitUntil waitUntil, PlannedFailover body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.PlannedFailover"); + scope.Start(); + try + { + var response = await _dataReplicationProtectedItemProtectedItemRestClient.PlannedFailoverAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new PlannedFailoverOperationSource(), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.CreatePlannedFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs the planned failover on the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/plannedFailover + /// + /// + /// Operation Id + /// ProtectedItem_PlannedFailover + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Planned failover model. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation PlannedFailover(WaitUntil waitUntil, PlannedFailover body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(body, nameof(body)); + + using var scope = _dataReplicationProtectedItemProtectedItemClientDiagnostics.CreateScope("DataReplicationProtectedItemResource.PlannedFailover"); + scope.Start(); + try + { + var response = _dataReplicationProtectedItemProtectedItemRestClient.PlannedFailover(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new PlannedFailoverOperationSource(), _dataReplicationProtectedItemProtectedItemClientDiagnostics, Pipeline, _dataReplicationProtectedItemProtectedItemRestClient.CreatePlannedFailoverRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, body).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointCollection.cs new file mode 100644 index 000000000000..5eebe045bdf2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointCollection.cs @@ -0,0 +1,395 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataReplicationRecoveryPoints method from an instance of . + /// + public partial class DataReplicationRecoveryPointCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationRecoveryPointRecoveryPointClientDiagnostics; + private readonly RecoveryPointRestOperations _dataReplicationRecoveryPointRecoveryPointRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationRecoveryPointCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataReplicationRecoveryPointCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationRecoveryPointRecoveryPointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationRecoveryPointResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationRecoveryPointResource.ResourceType, out string dataReplicationRecoveryPointRecoveryPointApiVersion); + _dataReplicationRecoveryPointRecoveryPointRestClient = new RecoveryPointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationRecoveryPointRecoveryPointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != DataReplicationProtectedItemResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, DataReplicationProtectedItemResource.ResourceType), nameof(id)); + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationRecoveryPointRecoveryPointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationRecoveryPointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationRecoveryPointRecoveryPointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationRecoveryPointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of recovery points of the given protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints + /// + /// + /// Operation Id + /// RecoveryPointModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationRecoveryPointRecoveryPointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationRecoveryPointRecoveryPointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationRecoveryPointResource(Client, DataReplicationRecoveryPointData.DeserializeDataReplicationRecoveryPointData(e)), _dataReplicationRecoveryPointRecoveryPointClientDiagnostics, Pipeline, "DataReplicationRecoveryPointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of recovery points of the given protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints + /// + /// + /// Operation Id + /// RecoveryPointModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationRecoveryPointRecoveryPointRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationRecoveryPointRecoveryPointRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationRecoveryPointResource(Client, DataReplicationRecoveryPointData.DeserializeDataReplicationRecoveryPointData(e)), _dataReplicationRecoveryPointRecoveryPointClientDiagnostics, Pipeline, "DataReplicationRecoveryPointCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationRecoveryPointRecoveryPointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationRecoveryPointRecoveryPointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationRecoveryPointRecoveryPointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationRecoveryPointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The recovery point name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationRecoveryPointRecoveryPointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, recoveryPointName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationRecoveryPointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.Serialization.cs new file mode 100644 index 000000000000..d6aadbc98f08 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationRecoveryPointData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationRecoveryPointData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationRecoveryPointData(document.RootElement, options); + } + + internal static DataReplicationRecoveryPointData DeserializeDataReplicationRecoveryPointData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationRecoveryPointProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationRecoveryPointProperties.DeserializeDataReplicationRecoveryPointProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationRecoveryPointData( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationRecoveryPointData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationRecoveryPointData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.cs new file mode 100644 index 000000000000..b9c9609366a2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointData.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationRecoveryPoint data model. + /// Recovery point model. + /// + public partial class DataReplicationRecoveryPointData : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationRecoveryPointData() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The resource-specific properties for this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationRecoveryPointData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationRecoveryPointProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The resource-specific properties for this resource. + public DataReplicationRecoveryPointProperties Properties { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.Serialization.cs new file mode 100644 index 000000000000..0ef4b3ded586 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationRecoveryPointResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationRecoveryPointData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataReplicationRecoveryPointData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.cs new file mode 100644 index 000000000000..370e6ddb742b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationRecoveryPointResource.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationRecoveryPoint along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataReplicationRecoveryPointResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationRecoveryPoint method. + /// + public partial class DataReplicationRecoveryPointResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + /// The protectedItemName. + /// The recoveryPointName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationRecoveryPointRecoveryPointClientDiagnostics; + private readonly RecoveryPointRestOperations _dataReplicationRecoveryPointRecoveryPointRestClient; + private readonly DataReplicationRecoveryPointData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults/protectedItems/recoveryPoints"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationRecoveryPointResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationRecoveryPointResource(ArmClient client, DataReplicationRecoveryPointData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataReplicationRecoveryPointResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationRecoveryPointRecoveryPointClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationRecoveryPointRecoveryPointApiVersion); + _dataReplicationRecoveryPointRecoveryPointRestClient = new RecoveryPointRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationRecoveryPointRecoveryPointApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationRecoveryPointData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationRecoveryPointRecoveryPointRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationRecoveryPointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the recovery point of a protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName}/recoveryPoints/{recoveryPointName} + /// + /// + /// Operation Id + /// RecoveryPointModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationRecoveryPointRecoveryPointClientDiagnostics.CreateScope("DataReplicationRecoveryPointResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationRecoveryPointRecoveryPointRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationRecoveryPointResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultCollection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultCollection.cs new file mode 100644 index 000000000000..2e720e1628e3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultCollection.cs @@ -0,0 +1,496 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetDataReplicationVaults method from an instance of . + /// + public partial class DataReplicationVaultCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _dataReplicationVaultVaultClientDiagnostics; + private readonly VaultRestOperations _dataReplicationVaultVaultRestClient; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationVaultCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal DataReplicationVaultCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationVaultVaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationVaultResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(DataReplicationVaultResource.ResourceType, out string dataReplicationVaultVaultApiVersion); + _dataReplicationVaultVaultRestClient = new VaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationVaultVaultApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Creates the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The vault name. + /// Vault properties. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string vaultName, DataReplicationVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationVaultOperationSource(Client), _dataReplicationVaultVaultClientDiagnostics, Pipeline, _dataReplicationVaultVaultRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The vault name. + /// Vault properties. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string vaultName, DataReplicationVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationVaultOperationSource(Client), _dataReplicationVaultVaultClientDiagnostics, Pipeline, _dataReplicationVaultVaultRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, vaultName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.Get"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.Get"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of vaults in the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationVaultVaultRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationVaultVaultRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationVaultResource(Client, DataReplicationVaultData.DeserializeDataReplicationVaultData(e)), _dataReplicationVaultVaultClientDiagnostics, Pipeline, "DataReplicationVaultCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription and resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Continuation token from the previous call. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(string continuationToken = null, CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _dataReplicationVaultVaultRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _dataReplicationVaultVaultRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, continuationToken); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationVaultResource(Client, DataReplicationVaultData.DeserializeDataReplicationVaultData(e)), _dataReplicationVaultVaultClientDiagnostics, Pipeline, "DataReplicationVaultCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.Exists"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.Exists"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultCollection.GetIfExists"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, vaultName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new DataReplicationVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.Serialization.cs new file mode 100644 index 000000000000..fc5a0723c613 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationVaultData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationVaultData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + JsonSerializer.Serialize(writer, Identity, serializeOptions); + } + } + + DataReplicationVaultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationVaultData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationVaultData(document.RootElement, options); + } + + internal static DataReplicationVaultData DeserializeDataReplicationVaultData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationVaultProperties properties = default; + ManagedServiceIdentity identity = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationVaultProperties.DeserializeDataReplicationVaultProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; + identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions); + continue; + } + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationVaultData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + identity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationVaultData)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationVaultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationVaultData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationVaultData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.cs new file mode 100644 index 000000000000..8cee6912a302 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultData.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A class representing the DataReplicationVault data model. + /// Vault model. + /// + public partial class DataReplicationVaultData : TrackedResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The location. + public DataReplicationVaultData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationVaultData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, DataReplicationVaultProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationVaultData() + { + } + + /// The resource-specific properties for this resource. + public DataReplicationVaultProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.Serialization.cs new file mode 100644 index 000000000000..e49fea5e754f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.Serialization.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + public partial class DataReplicationVaultResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + DataReplicationVaultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + DataReplicationVaultData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.cs new file mode 100644 index 000000000000..2a5e07342d49 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/DataReplicationVaultResource.cs @@ -0,0 +1,1328 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// + /// A Class representing a DataReplicationVault along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetDataReplicationVaultResource method. + /// Otherwise you can get one from its parent resource using the GetDataReplicationVault method. + /// + public partial class DataReplicationVaultResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The vaultName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string vaultName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _dataReplicationVaultVaultClientDiagnostics; + private readonly VaultRestOperations _dataReplicationVaultVaultRestClient; + private readonly DataReplicationVaultData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DataReplication/replicationVaults"; + + /// Initializes a new instance of the class for mocking. + protected DataReplicationVaultResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal DataReplicationVaultResource(ArmClient client, DataReplicationVaultData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal DataReplicationVaultResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _dataReplicationVaultVaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string dataReplicationVaultVaultApiVersion); + _dataReplicationVaultVaultRestClient = new VaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, dataReplicationVaultVaultApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual DataReplicationVaultData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of DataReplicationEmailConfigurationResources in the DataReplicationVault. + /// An object representing collection of DataReplicationEmailConfigurationResources and their operations over a DataReplicationEmailConfigurationResource. + public virtual DataReplicationEmailConfigurationCollection GetDataReplicationEmailConfigurations() + { + return GetCachedClient(client => new DataReplicationEmailConfigurationCollection(client, Id)); + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationEmailConfigurationAsync(string emailConfigurationName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationEmailConfigurations().GetAsync(emailConfigurationName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the alert configuration setting. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/alertSettings/{emailConfigurationName} + /// + /// + /// Operation Id + /// EmailConfigurationModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The email configuration name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationEmailConfiguration(string emailConfigurationName, CancellationToken cancellationToken = default) + { + return GetDataReplicationEmailConfigurations().Get(emailConfigurationName, cancellationToken); + } + + /// Gets a collection of DataReplicationEventResources in the DataReplicationVault. + /// An object representing collection of DataReplicationEventResources and their operations over a DataReplicationEventResource. + public virtual DataReplicationEventCollection GetDataReplicationEvents() + { + return GetCachedClient(client => new DataReplicationEventCollection(client, Id)); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationEventAsync(string eventName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationEvents().GetAsync(eventName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the event. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/events/{eventName} + /// + /// + /// Operation Id + /// EventModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The event name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationEvent(string eventName, CancellationToken cancellationToken = default) + { + return GetDataReplicationEvents().Get(eventName, cancellationToken); + } + + /// Gets a collection of DataReplicationJobResources in the DataReplicationVault. + /// An object representing collection of DataReplicationJobResources and their operations over a DataReplicationJobResource. + public virtual DataReplicationJobCollection GetDataReplicationJobs() + { + return GetCachedClient(client => new DataReplicationJobCollection(client, Id)); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationJobAsync(string jobName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationJobs().GetAsync(jobName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the job. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/jobs/{jobName} + /// + /// + /// Operation Id + /// JobModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The job name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationJob(string jobName, CancellationToken cancellationToken = default) + { + return GetDataReplicationJobs().Get(jobName, cancellationToken); + } + + /// Gets a collection of DataReplicationPolicyResources in the DataReplicationVault. + /// An object representing collection of DataReplicationPolicyResources and their operations over a DataReplicationPolicyResource. + public virtual DataReplicationPolicyCollection GetDataReplicationPolicies() + { + return GetCachedClient(client => new DataReplicationPolicyCollection(client, Id)); + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationPolicyAsync(string policyName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationPolicies().GetAsync(policyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the policy. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationPolicies/{policyName} + /// + /// + /// Operation Id + /// PolicyModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The policy name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationPolicy(string policyName, CancellationToken cancellationToken = default) + { + return GetDataReplicationPolicies().Get(policyName, cancellationToken); + } + + /// Gets a collection of DataReplicationPrivateEndpointConnectionResources in the DataReplicationVault. + /// An object representing collection of DataReplicationPrivateEndpointConnectionResources and their operations over a DataReplicationPrivateEndpointConnectionResource. + public virtual DataReplicationPrivateEndpointConnectionCollection GetDataReplicationPrivateEndpointConnections() + { + return GetCachedClient(client => new DataReplicationPrivateEndpointConnectionCollection(client, Id)); + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationPrivateEndpointConnectionAsync(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationPrivateEndpointConnections().GetAsync(privateEndpointConnectionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private endpoint connection details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnections/{privateEndpointConnectionName} + /// + /// + /// Operation Id + /// PrivateEndpointConnection_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationPrivateEndpointConnection(string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + return GetDataReplicationPrivateEndpointConnections().Get(privateEndpointConnectionName, cancellationToken); + } + + /// Gets a collection of DataReplicationPrivateEndpointConnectionProxyResources in the DataReplicationVault. + /// An object representing collection of DataReplicationPrivateEndpointConnectionProxyResources and their operations over a DataReplicationPrivateEndpointConnectionProxyResource. + public virtual DataReplicationPrivateEndpointConnectionProxyCollection GetDataReplicationPrivateEndpointConnectionProxies() + { + return GetCachedClient(client => new DataReplicationPrivateEndpointConnectionProxyCollection(client, Id)); + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationPrivateEndpointConnectionProxyAsync(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationPrivateEndpointConnectionProxies().GetAsync(privateEndpointConnectionProxyName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the private endpoint connection proxy details. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateEndpointConnectionProxies/{privateEndpointConnectionProxyName} + /// + /// + /// Operation Id + /// PrivateEndpointConnectionProxy_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationPrivateEndpointConnectionProxy(string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + return GetDataReplicationPrivateEndpointConnectionProxies().Get(privateEndpointConnectionProxyName, cancellationToken); + } + + /// Gets a collection of DataReplicationPrivateLinkResources in the DataReplicationVault. + /// An object representing collection of DataReplicationPrivateLinkResources and their operations over a DataReplicationPrivateLinkResource. + public virtual DataReplicationPrivateLinkResourceCollection GetDataReplicationPrivateLinkResources() + { + return GetCachedClient(client => new DataReplicationPrivateLinkResourceCollection(client, Id)); + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationPrivateLinkResourceAsync(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationPrivateLinkResources().GetAsync(privateLinkResourceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of site recovery private link resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/privateLinkResources/{privateLinkResourceName} + /// + /// + /// Operation Id + /// PrivateLinkResource_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The private link name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationPrivateLinkResource(string privateLinkResourceName, CancellationToken cancellationToken = default) + { + return GetDataReplicationPrivateLinkResources().Get(privateLinkResourceName, cancellationToken); + } + + /// Gets a collection of DataReplicationProtectedItemResources in the DataReplicationVault. + /// An object representing collection of DataReplicationProtectedItemResources and their operations over a DataReplicationProtectedItemResource. + public virtual DataReplicationProtectedItemCollection GetDataReplicationProtectedItems() + { + return GetCachedClient(client => new DataReplicationProtectedItemCollection(client, Id)); + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationProtectedItemAsync(string protectedItemName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationProtectedItems().GetAsync(protectedItemName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the protected item. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/protectedItems/{protectedItemName} + /// + /// + /// Operation Id + /// ProtectedItemModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The protected item name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationProtectedItem(string protectedItemName, CancellationToken cancellationToken = default) + { + return GetDataReplicationProtectedItems().Get(protectedItemName, cancellationToken); + } + + /// Gets a collection of DataReplicationExtensionResources in the DataReplicationVault. + /// An object representing collection of DataReplicationExtensionResources and their operations over a DataReplicationExtensionResource. + public virtual DataReplicationExtensionCollection GetDataReplicationExtensions() + { + return GetCachedClient(client => new DataReplicationExtensionCollection(client, Id)); + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationExtensionAsync(string replicationExtensionName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationExtensions().GetAsync(replicationExtensionName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the replication extension. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName}/replicationExtensions/{replicationExtensionName} + /// + /// + /// Operation Id + /// ReplicationExtensionModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The replication extension name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationExtension(string replicationExtensionName, CancellationToken cancellationToken = default) + { + return GetDataReplicationExtensions().Get(replicationExtensionName, cancellationToken); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.Get"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.Get"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new DataReplicationVaultResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.Delete"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationVaultVaultClientDiagnostics, Pipeline, _dataReplicationVaultVaultRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.Delete"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(_dataReplicationVaultVaultClientDiagnostics, Pipeline, _dataReplicationVaultVaultRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Vault properties. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, DataReplicationVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.Update"); + scope.Start(); + try + { + var response = await _dataReplicationVaultVaultRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationVaultOperationSource(Client), _dataReplicationVaultVaultClientDiagnostics, Pipeline, _dataReplicationVaultVaultRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs update on the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Vault properties. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, DataReplicationVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.Update"); + scope.Start(); + try + { + var response = _dataReplicationVaultVaultRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new RecoveryServicesDataReplicationArmOperation(new DataReplicationVaultOperationSource(Client), _dataReplicationVaultVaultClientDiagnostics, Pipeline, _dataReplicationVaultVaultRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _dataReplicationVaultVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DataReplicationVaultPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DataReplicationVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DataReplicationVaultPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _dataReplicationVaultVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DataReplicationVaultPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DataReplicationVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DataReplicationVaultPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _dataReplicationVaultVaultRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new DataReplicationVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new DataReplicationVaultPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _dataReplicationVaultVaultClientDiagnostics.CreateScope("DataReplicationVaultResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _dataReplicationVaultVaultRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new DataReplicationVaultResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new DataReplicationVaultPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationArmClient.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationArmClient.cs new file mode 100644 index 000000000000..c32531744ad8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationArmClient.cs @@ -0,0 +1,193 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableRecoveryServicesDataReplicationArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableRecoveryServicesDataReplicationArmClient() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableRecoveryServicesDataReplicationArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableRecoveryServicesDataReplicationArmClient(ArmClient client) : this(client, ResourceIdentifier.Root) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(ResourceIdentifier id) + { + DataReplicationEmailConfigurationResource.ValidateResourceId(id); + return new DataReplicationEmailConfigurationResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationVaultResource GetDataReplicationVaultResource(ResourceIdentifier id) + { + DataReplicationVaultResource.ValidateResourceId(id); + return new DataReplicationVaultResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationEventResource GetDataReplicationEventResource(ResourceIdentifier id) + { + DataReplicationEventResource.ValidateResourceId(id); + return new DataReplicationEventResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationFabricResource GetDataReplicationFabricResource(ResourceIdentifier id) + { + DataReplicationFabricResource.ValidateResourceId(id); + return new DataReplicationFabricResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationFabricAgentResource GetDataReplicationFabricAgentResource(ResourceIdentifier id) + { + DataReplicationFabricAgentResource.ValidateResourceId(id); + return new DataReplicationFabricAgentResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationJobResource GetDataReplicationJobResource(ResourceIdentifier id) + { + DataReplicationJobResource.ValidateResourceId(id); + return new DataReplicationJobResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationPolicyResource GetDataReplicationPolicyResource(ResourceIdentifier id) + { + DataReplicationPolicyResource.ValidateResourceId(id); + return new DataReplicationPolicyResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationPrivateEndpointConnectionResource GetDataReplicationPrivateEndpointConnectionResource(ResourceIdentifier id) + { + DataReplicationPrivateEndpointConnectionResource.ValidateResourceId(id); + return new DataReplicationPrivateEndpointConnectionResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationPrivateEndpointConnectionProxyResource GetDataReplicationPrivateEndpointConnectionProxyResource(ResourceIdentifier id) + { + DataReplicationPrivateEndpointConnectionProxyResource.ValidateResourceId(id); + return new DataReplicationPrivateEndpointConnectionProxyResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationPrivateLinkResource GetDataReplicationPrivateLinkResource(ResourceIdentifier id) + { + DataReplicationPrivateLinkResource.ValidateResourceId(id); + return new DataReplicationPrivateLinkResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(ResourceIdentifier id) + { + DataReplicationProtectedItemResource.ValidateResourceId(id); + return new DataReplicationProtectedItemResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(ResourceIdentifier id) + { + DataReplicationRecoveryPointResource.ValidateResourceId(id); + return new DataReplicationRecoveryPointResource(Client, id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual DataReplicationExtensionResource GetDataReplicationExtensionResource(ResourceIdentifier id) + { + DataReplicationExtensionResource.ValidateResourceId(id); + return new DataReplicationExtensionResource(Client, id); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationResourceGroupResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationResourceGroupResource.cs new file mode 100644 index 000000000000..b312d29bee88 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationResourceGroupResource.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableRecoveryServicesDataReplicationResourceGroupResource : ArmResource + { + private ClientDiagnostics _deploymentPreflightClientDiagnostics; + private DeploymentPreflightRestOperations _deploymentPreflightRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableRecoveryServicesDataReplicationResourceGroupResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableRecoveryServicesDataReplicationResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics DeploymentPreflightClientDiagnostics => _deploymentPreflightClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private DeploymentPreflightRestOperations DeploymentPreflightRestClient => _deploymentPreflightRestClient ??= new DeploymentPreflightRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of DataReplicationVaultResources in the ResourceGroupResource. + /// An object representing collection of DataReplicationVaultResources and their operations over a DataReplicationVaultResource. + public virtual DataReplicationVaultCollection GetDataReplicationVaults() + { + return GetCachedClient(client => new DataReplicationVaultCollection(client, Id)); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationVaultAsync(string vaultName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationVaults().GetAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The vault name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationVault(string vaultName, CancellationToken cancellationToken = default) + { + return GetDataReplicationVaults().Get(vaultName, cancellationToken); + } + + /// Gets a collection of DataReplicationFabricResources in the ResourceGroupResource. + /// An object representing collection of DataReplicationFabricResources and their operations over a DataReplicationFabricResource. + public virtual DataReplicationFabricCollection GetDataReplicationFabrics() + { + return GetCachedClient(client => new DataReplicationFabricCollection(client, Id)); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetDataReplicationFabricAsync(string fabricName, CancellationToken cancellationToken = default) + { + return await GetDataReplicationFabrics().GetAsync(fabricName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The fabric name. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetDataReplicationFabric(string fabricName, CancellationToken cancellationToken = default) + { + return GetDataReplicationFabrics().Get(fabricName, cancellationToken); + } + + /// + /// Performs resource deployment preflight validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> PostDeploymentPreflightAsync(string deploymentId, DeploymentPreflight body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var scope = DeploymentPreflightClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationResourceGroupResource.PostDeploymentPreflight"); + scope.Start(); + try + { + var response = await DeploymentPreflightRestClient.PostAsync(Id.SubscriptionId, Id.ResourceGroupName, deploymentId, body, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Performs resource deployment preflight validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response PostDeploymentPreflight(string deploymentId, DeploymentPreflight body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var scope = DeploymentPreflightClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationResourceGroupResource.PostDeploymentPreflight"); + scope.Start(); + try + { + var response = DeploymentPreflightRestClient.Post(Id.SubscriptionId, Id.ResourceGroupName, deploymentId, body, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationSubscriptionResource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationSubscriptionResource.cs new file mode 100644 index 000000000000..9d361158821e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/MockableRecoveryServicesDataReplicationSubscriptionResource.cs @@ -0,0 +1,245 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableRecoveryServicesDataReplicationSubscriptionResource : ArmResource + { + private ClientDiagnostics _dataReplicationVaultVaultClientDiagnostics; + private VaultRestOperations _dataReplicationVaultVaultRestClient; + private ClientDiagnostics _dataReplicationFabricFabricClientDiagnostics; + private FabricRestOperations _dataReplicationFabricFabricRestClient; + private ClientDiagnostics _checkNameAvailabilityClientDiagnostics; + private CheckNameAvailabilityRestOperations _checkNameAvailabilityRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableRecoveryServicesDataReplicationSubscriptionResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MockableRecoveryServicesDataReplicationSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics DataReplicationVaultVaultClientDiagnostics => _dataReplicationVaultVaultClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationVaultResource.ResourceType.Namespace, Diagnostics); + private VaultRestOperations DataReplicationVaultVaultRestClient => _dataReplicationVaultVaultRestClient ??= new VaultRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DataReplicationVaultResource.ResourceType)); + private ClientDiagnostics DataReplicationFabricFabricClientDiagnostics => _dataReplicationFabricFabricClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", DataReplicationFabricResource.ResourceType.Namespace, Diagnostics); + private FabricRestOperations DataReplicationFabricFabricRestClient => _dataReplicationFabricFabricRestClient ??= new FabricRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(DataReplicationFabricResource.ResourceType)); + private ClientDiagnostics CheckNameAvailabilityClientDiagnostics => _checkNameAvailabilityClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.RecoveryServicesDataReplication", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private CheckNameAvailabilityRestOperations CheckNameAvailabilityRestClient => _checkNameAvailabilityRestClient ??= new CheckNameAvailabilityRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDataReplicationVaultsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DataReplicationVaultVaultRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataReplicationVaultVaultRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationVaultResource(Client, DataReplicationVaultData.DeserializeDataReplicationVaultData(e)), DataReplicationVaultVaultClientDiagnostics, Pipeline, "MockableRecoveryServicesDataReplicationSubscriptionResource.GetDataReplicationVaults", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDataReplicationVaults(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DataReplicationVaultVaultRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataReplicationVaultVaultRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationVaultResource(Client, DataReplicationVaultData.DeserializeDataReplicationVaultData(e)), DataReplicationVaultVaultClientDiagnostics, Pipeline, "MockableRecoveryServicesDataReplicationSubscriptionResource.GetDataReplicationVaults", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetDataReplicationFabricsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DataReplicationFabricFabricRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataReplicationFabricFabricRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricResource(Client, DataReplicationFabricData.DeserializeDataReplicationFabricData(e)), DataReplicationFabricFabricClientDiagnostics, Pipeline, "MockableRecoveryServicesDataReplicationSubscriptionResource.GetDataReplicationFabrics", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetDataReplicationFabrics(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => DataReplicationFabricFabricRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => DataReplicationFabricFabricRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new DataReplicationFabricResource(Client, DataReplicationFabricData.DeserializeDataReplicationFabricData(e)), DataReplicationFabricFabricClientDiagnostics, Pipeline, "MockableRecoveryServicesDataReplicationSubscriptionResource.GetDataReplicationFabrics", "value", "nextLink", cancellationToken); + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + public virtual async Task> PostCheckNameAvailabilityAsync(AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + { + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationSubscriptionResource.PostCheckNameAvailability"); + scope.Start(); + try + { + var response = await CheckNameAvailabilityRestClient.PostAsync(Id.SubscriptionId, location, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + public virtual Response PostCheckNameAvailability(AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + { + using var scope = CheckNameAvailabilityClientDiagnostics.CreateScope("MockableRecoveryServicesDataReplicationSubscriptionResource.PostCheckNameAvailability"); + scope.Start(); + try + { + var response = CheckNameAvailabilityRestClient.Post(Id.SubscriptionId, location, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationExtensions.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationExtensions.cs new file mode 100644 index 000000000000..fbe3ad443a0f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Extensions/RecoveryServicesDataReplicationExtensions.cs @@ -0,0 +1,747 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.RecoveryServicesDataReplication.Mocking; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + /// A class to add extension methods to Azure.ResourceManager.RecoveryServicesDataReplication. + public static partial class RecoveryServicesDataReplicationExtensions + { + private static MockableRecoveryServicesDataReplicationArmClient GetMockableRecoveryServicesDataReplicationArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableRecoveryServicesDataReplicationArmClient(client0)); + } + + private static MockableRecoveryServicesDataReplicationResourceGroupResource GetMockableRecoveryServicesDataReplicationResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableRecoveryServicesDataReplicationResourceGroupResource(client, resource.Id)); + } + + private static MockableRecoveryServicesDataReplicationSubscriptionResource GetMockableRecoveryServicesDataReplicationSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableRecoveryServicesDataReplicationSubscriptionResource(client, resource.Id)); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationEmailConfigurationResource GetDataReplicationEmailConfigurationResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationEmailConfigurationResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationVaultResource GetDataReplicationVaultResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationVaultResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationEventResource GetDataReplicationEventResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationEventResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationFabricResource GetDataReplicationFabricResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationFabricResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationFabricAgentResource GetDataReplicationFabricAgentResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationFabricAgentResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationJobResource GetDataReplicationJobResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationJobResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationPolicyResource GetDataReplicationPolicyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationPolicyResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationPrivateEndpointConnectionResource GetDataReplicationPrivateEndpointConnectionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationPrivateEndpointConnectionResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationPrivateEndpointConnectionProxyResource GetDataReplicationPrivateEndpointConnectionProxyResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationPrivateEndpointConnectionProxyResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationPrivateLinkResource GetDataReplicationPrivateLinkResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationPrivateLinkResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationProtectedItemResource GetDataReplicationProtectedItemResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationProtectedItemResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationRecoveryPointResource GetDataReplicationRecoveryPointResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationRecoveryPointResource(id); + } + + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// is null. + /// Returns a object. + public static DataReplicationExtensionResource GetDataReplicationExtensionResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableRecoveryServicesDataReplicationArmClient(client).GetDataReplicationExtensionResource(id); + } + + /// + /// Gets a collection of DataReplicationVaultResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of DataReplicationVaultResources and their operations over a DataReplicationVaultResource. + public static DataReplicationVaultCollection GetDataReplicationVaults(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetDataReplicationVaults(); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The vault name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDataReplicationVaultAsync(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetDataReplicationVaultAsync(vaultName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the vault. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationVaults/{vaultName} + /// + /// + /// Operation Id + /// VaultModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The vault name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDataReplicationVault(this ResourceGroupResource resourceGroupResource, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetDataReplicationVault(vaultName, cancellationToken); + } + + /// + /// Gets a collection of DataReplicationFabricResources in the ResourceGroupResource. + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// is null. + /// An object representing collection of DataReplicationFabricResources and their operations over a DataReplicationFabricResource. + public static DataReplicationFabricCollection GetDataReplicationFabrics(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetDataReplicationFabrics(); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The fabric name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetDataReplicationFabricAsync(this ResourceGroupResource resourceGroupResource, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetDataReplicationFabricAsync(fabricName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the details of the fabric. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/replicationFabrics/{fabricName} + /// + /// + /// Operation Id + /// FabricModel_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The fabric name. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetDataReplicationFabric(this ResourceGroupResource resourceGroupResource, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).GetDataReplicationFabric(fabricName, cancellationToken); + } + + /// + /// Performs resource deployment preflight validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static async Task> PostDeploymentPreflightAsync(this ResourceGroupResource resourceGroupResource, string deploymentId, DeploymentPreflight body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).PostDeploymentPreflightAsync(deploymentId, body, cancellationToken).ConfigureAwait(false); + } + + /// + /// Performs resource deployment preflight validation. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataReplication/deployments/{deploymentId}/preflight + /// + /// + /// Operation Id + /// DeploymentPreflight_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static Response PostDeploymentPreflight(this ResourceGroupResource resourceGroupResource, string deploymentId, DeploymentPreflight body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableRecoveryServicesDataReplicationResourceGroupResource(resourceGroupResource).PostDeploymentPreflight(deploymentId, body, cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDataReplicationVaultsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).GetDataReplicationVaultsAsync(cancellationToken); + } + + /// + /// Gets the list of vaults in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationVaults + /// + /// + /// Operation Id + /// VaultModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetDataReplicationVaults(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).GetDataReplicationVaults(cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetDataReplicationFabricsAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).GetDataReplicationFabricsAsync(cancellationToken); + } + + /// + /// Gets the list of fabrics in the given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/replicationFabrics + /// + /// + /// Operation Id + /// FabricModel_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetDataReplicationFabrics(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).GetDataReplicationFabrics(cancellationToken); + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + /// is null. + public static async Task> PostCheckNameAvailabilityAsync(this SubscriptionResource subscriptionResource, AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).PostCheckNameAvailabilityAsync(location, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Checks the resource name availability. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DataReplication/locations/{location}/checkNameAvailability + /// + /// + /// Operation Id + /// CheckNameAvailability_Post + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + /// is null. + public static Response PostCheckNameAvailability(this SubscriptionResource subscriptionResource, AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableRecoveryServicesDataReplicationSubscriptionResource(subscriptionResource).PostCheckNameAvailability(location, content, cancellationToken); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Argument.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..9c62a091425c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Argument.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal static class Argument + { + public static void AssertNotNull(T value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNull(T? value, string name) + where T : struct + { + if (!value.HasValue) + { + throw new ArgumentNullException(name); + } + } + + public static void AssertNotNullOrEmpty(IEnumerable value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value is ICollection collectionOfT && collectionOfT.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + if (value is ICollection collection && collection.Count == 0) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + using IEnumerator e = value.GetEnumerator(); + if (!e.MoveNext()) + { + throw new ArgumentException("Value cannot be an empty collection.", name); + } + } + + public static void AssertNotNullOrEmpty(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (value.Length == 0) + { + throw new ArgumentException("Value cannot be an empty string.", name); + } + } + + public static void AssertNotNullOrWhiteSpace(string value, string name) + { + if (value is null) + { + throw new ArgumentNullException(name); + } + if (string.IsNullOrWhiteSpace(value)) + { + throw new ArgumentException("Value cannot be empty or contain only white-space characters.", name); + } + } + + public static void AssertNotDefault(ref T value, string name) + where T : struct, IEquatable + { + if (value.Equals(default)) + { + throw new ArgumentException("Value cannot be empty.", name); + } + } + + public static void AssertInRange(T value, T minimum, T maximum, string name) + where T : notnull, IComparable + { + if (minimum.CompareTo(value) > 0) + { + throw new ArgumentOutOfRangeException(name, "Value is less than the minimum allowed."); + } + if (maximum.CompareTo(value) < 0) + { + throw new ArgumentOutOfRangeException(name, "Value is greater than the maximum allowed."); + } + } + + public static void AssertEnumDefined(Type enumType, object value, string name) + { + if (!Enum.IsDefined(enumType, value)) + { + throw new ArgumentException($"Value not defined for {enumType.FullName}.", name); + } + } + + public static T CheckNotNull(T value, string name) + where T : class + { + AssertNotNull(value, name); + return value; + } + + public static string CheckNotNullOrEmpty(string value, string name) + { + AssertNotNullOrEmpty(value, name); + return value; + } + + public static void AssertNull(T value, string name, string message = null) + { + if (value != null) + { + throw new ArgumentException(message ?? "Value must be null.", name); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..c13f7c82b016 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingDictionary.cs @@ -0,0 +1,167 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class ChangeTrackingDictionary : IDictionary, IReadOnlyDictionary where TKey : notnull + { + private IDictionary _innerDictionary; + + public ChangeTrackingDictionary() + { + } + + public ChangeTrackingDictionary(IDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(dictionary); + } + + public ChangeTrackingDictionary(IReadOnlyDictionary dictionary) + { + if (dictionary == null) + { + return; + } + _innerDictionary = new Dictionary(); + foreach (var pair in dictionary) + { + _innerDictionary.Add(pair); + } + } + + public bool IsUndefined => _innerDictionary == null; + + public int Count => IsUndefined ? 0 : EnsureDictionary().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureDictionary().IsReadOnly; + + public ICollection Keys => IsUndefined ? Array.Empty() : EnsureDictionary().Keys; + + public ICollection Values => IsUndefined ? Array.Empty() : EnsureDictionary().Values; + + public TValue this[TKey key] + { + get + { + if (IsUndefined) + { + throw new KeyNotFoundException(nameof(key)); + } + return EnsureDictionary()[key]; + } + set + { + EnsureDictionary()[key] = value; + } + } + + IEnumerable IReadOnlyDictionary.Keys => Keys; + + IEnumerable IReadOnlyDictionary.Values => Values; + + public IEnumerator> GetEnumerator() + { + if (IsUndefined) + { + IEnumerator> enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureDictionary().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(KeyValuePair item) + { + EnsureDictionary().Add(item); + } + + public void Clear() + { + EnsureDictionary().Clear(); + } + + public bool Contains(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Contains(item); + } + + public void CopyTo(KeyValuePair[] array, int index) + { + if (IsUndefined) + { + return; + } + EnsureDictionary().CopyTo(array, index); + } + + public bool Remove(KeyValuePair item) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(item); + } + + public void Add(TKey key, TValue value) + { + EnsureDictionary().Add(key, value); + } + + public bool ContainsKey(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().ContainsKey(key); + } + + public bool Remove(TKey key) + { + if (IsUndefined) + { + return false; + } + return EnsureDictionary().Remove(key); + } + + public bool TryGetValue(TKey key, out TValue value) + { + if (IsUndefined) + { + value = default; + return false; + } + return EnsureDictionary().TryGetValue(key, out value); + } + + public IDictionary EnsureDictionary() + { + return _innerDictionary ??= new Dictionary(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingList.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..e0c7e0652299 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ChangeTrackingList.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class ChangeTrackingList : IList, IReadOnlyList + { + private IList _innerList; + + public ChangeTrackingList() + { + } + + public ChangeTrackingList(IList innerList) + { + if (innerList != null) + { + _innerList = innerList; + } + } + + public ChangeTrackingList(IReadOnlyList innerList) + { + if (innerList != null) + { + _innerList = innerList.ToList(); + } + } + + public bool IsUndefined => _innerList == null; + + public int Count => IsUndefined ? 0 : EnsureList().Count; + + public bool IsReadOnly => IsUndefined ? false : EnsureList().IsReadOnly; + + public T this[int index] + { + get + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + return EnsureList()[index]; + } + set + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList()[index] = value; + } + } + + public void Reset() + { + _innerList = null; + } + + public IEnumerator GetEnumerator() + { + if (IsUndefined) + { + IEnumerator enumerateEmpty() + { + yield break; + } + return enumerateEmpty(); + } + return EnsureList().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetEnumerator(); + } + + public void Add(T item) + { + EnsureList().Add(item); + } + + public void Clear() + { + EnsureList().Clear(); + } + + public bool Contains(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + if (IsUndefined) + { + return; + } + EnsureList().CopyTo(array, arrayIndex); + } + + public bool Remove(T item) + { + if (IsUndefined) + { + return false; + } + return EnsureList().Remove(item); + } + + public int IndexOf(T item) + { + if (IsUndefined) + { + return -1; + } + return EnsureList().IndexOf(item); + } + + public void Insert(int index, T item) + { + EnsureList().Insert(index, item); + } + + public void RemoveAt(int index) + { + if (IsUndefined) + { + throw new ArgumentOutOfRangeException(nameof(index)); + } + EnsureList().RemoveAt(index); + } + + public IList EnsureList() + { + return _innerList ??= new List(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..1593c362e28f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/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.RecoveryServicesDataReplication +{ + 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/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Optional.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..9843364940f5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Optional.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal static class Optional + { + public static bool IsCollectionDefined(IEnumerable collection) + { + return !(collection is ChangeTrackingList changeTrackingList && changeTrackingList.IsUndefined); + } + + public static bool IsCollectionDefined(IDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsCollectionDefined(IReadOnlyDictionary collection) + { + return !(collection is ChangeTrackingDictionary changeTrackingDictionary && changeTrackingDictionary.IsUndefined); + } + + public static bool IsDefined(T? value) + where T : struct + { + return value.HasValue; + } + + public static bool IsDefined(object value) + { + return value != null; + } + + public static bool IsDefined(JsonElement value) + { + return value.ValueKind != JsonValueKind.Undefined; + } + + public static bool IsDefined(string value) + { + return value != null; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..97644ff6907d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Internal/Utf8JsonRequestContent.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.IO; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class Utf8JsonRequestContent : RequestContent + { + private readonly MemoryStream _stream; + private readonly RequestContent _content; + + public Utf8JsonRequestContent() + { + _stream = new MemoryStream(); + _content = Create(_stream); + JsonWriter = new Utf8JsonWriter(_stream); + } + + public Utf8JsonWriter JsonWriter { get; } + + public override async Task WriteToAsync(Stream stream, CancellationToken cancellationToken = default) + { + await JsonWriter.FlushAsync().ConfigureAwait(false); + await _content.WriteToAsync(stream, cancellationToken).ConfigureAwait(false); + } + + public override void WriteTo(Stream stream, CancellationToken cancellationToken = default) + { + JsonWriter.Flush(); + _content.WriteTo(stream, cancellationToken); + } + + public override bool TryComputeLength(out long length) + { + length = JsonWriter.BytesCommitted + JsonWriter.BytesPending; + return true; + } + + public override void Dispose() + { + JsonWriter.Dispose(); + _content.Dispose(); + _stream.Dispose(); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationExtensionOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationExtensionOperationSource.cs new file mode 100644 index 000000000000..92c91d0d1130 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationExtensionOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class DataReplicationExtensionOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataReplicationExtensionOperationSource(ArmClient client) + { + _client = client; + } + + DataReplicationExtensionResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new DataReplicationExtensionResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new DataReplicationExtensionResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricAgentOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricAgentOperationSource.cs new file mode 100644 index 000000000000..d505949eb0b8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricAgentOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class DataReplicationFabricAgentOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataReplicationFabricAgentOperationSource(ArmClient client) + { + _client = client; + } + + DataReplicationFabricAgentResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new DataReplicationFabricAgentResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new DataReplicationFabricAgentResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricOperationSource.cs new file mode 100644 index 000000000000..4b6a206314d5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationFabricOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class DataReplicationFabricOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataReplicationFabricOperationSource(ArmClient client) + { + _client = client; + } + + DataReplicationFabricResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new DataReplicationFabricResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new DataReplicationFabricResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationPolicyOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationPolicyOperationSource.cs new file mode 100644 index 000000000000..d8fe678f5d16 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationPolicyOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class DataReplicationPolicyOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataReplicationPolicyOperationSource(ArmClient client) + { + _client = client; + } + + DataReplicationPolicyResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new DataReplicationPolicyResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new DataReplicationPolicyResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationProtectedItemOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationProtectedItemOperationSource.cs new file mode 100644 index 000000000000..1e51cea1512e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationProtectedItemOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class DataReplicationProtectedItemOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataReplicationProtectedItemOperationSource(ArmClient client) + { + _client = client; + } + + DataReplicationProtectedItemResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new DataReplicationProtectedItemResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new DataReplicationProtectedItemResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationVaultOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationVaultOperationSource.cs new file mode 100644 index 000000000000..a7a8a19d1c5c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/DataReplicationVaultOperationSource.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.ClientModel.Primitives; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class DataReplicationVaultOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal DataReplicationVaultOperationSource(ArmClient client) + { + _client = client; + } + + DataReplicationVaultResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new DataReplicationVaultResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new DataReplicationVaultResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PlannedFailoverOperationSource.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PlannedFailoverOperationSource.cs new file mode 100644 index 000000000000..54337341ad59 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/PlannedFailoverOperationSource.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal class PlannedFailoverOperationSource : IOperationSource + { + PlannedFailover IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return PlannedFailover.DeserializePlannedFailover(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return PlannedFailover.DeserializePlannedFailover(document.RootElement); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperation.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperation.cs new file mode 100644 index 000000000000..eb2854f60f25 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperation.cs @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ +#pragma warning disable SA1649 // File name should match first type name + internal class RecoveryServicesDataReplicationArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of RecoveryServicesDataReplicationArmOperation for mocking. + protected RecoveryServicesDataReplicationArmOperation() + { + } + + internal RecoveryServicesDataReplicationArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal RecoveryServicesDataReplicationArmOperation(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(nextLinkOperation, clientDiagnostics, response, "RecoveryServicesDataReplicationArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletionResponse(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(cancellationToken); + + /// + public override Response WaitForCompletionResponse(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponse(pollingInterval, cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(cancellationToken); + + /// + public override ValueTask WaitForCompletionResponseAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionResponseAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperationOfT.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperationOfT.cs new file mode 100644 index 000000000000..55ab427e9eb1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/LongRunningOperation/RecoveryServicesDataReplicationArmOperationOfT.cs @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ +#pragma warning disable SA1649 // File name should match first type name + internal class RecoveryServicesDataReplicationArmOperation : ArmOperation +#pragma warning restore SA1649 // File name should match first type name + { + private readonly OperationInternal _operation; + private readonly RehydrationToken? _completeRehydrationToken; + private readonly NextLinkOperationImplementation _nextLinkOperation; + private readonly string _operationId; + + /// Initializes a new instance of RecoveryServicesDataReplicationArmOperation for mocking. + protected RecoveryServicesDataReplicationArmOperation() + { + } + + internal RecoveryServicesDataReplicationArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal RecoveryServicesDataReplicationArmOperation(IOperationSource source, ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, Request request, Response response, OperationFinalStateVia finalStateVia, bool skipApiVersionOverride = false, string apiVersionOverrideValue = null) + { + var nextLinkOperation = NextLinkOperationImplementation.Create(pipeline, request.Method, request.Uri.ToUri(), response, finalStateVia, skipApiVersionOverride, apiVersionOverrideValue); + if (nextLinkOperation is NextLinkOperationImplementation nextLinkOperationValue) + { + _nextLinkOperation = nextLinkOperationValue; + _operationId = _nextLinkOperation.OperationId; + } + else + { + _completeRehydrationToken = NextLinkOperationImplementation.GetRehydrationToken(request.Method, request.Uri.ToUri(), response, finalStateVia); + _operationId = GetOperationId(_completeRehydrationToken); + } + _operation = new OperationInternal(NextLinkOperationImplementation.Create(source, nextLinkOperation), clientDiagnostics, response, "RecoveryServicesDataReplicationArmOperation", fallbackStrategy: new SequentialDelayStrategy()); + } + + private string GetOperationId(RehydrationToken? rehydrationToken) + { + if (rehydrationToken is null) + { + return null; + } + var lroDetails = ModelReaderWriter.Write(rehydrationToken, ModelReaderWriterOptions.Json).ToObjectFromJson>(); + return lroDetails["id"]; + } + /// + public override string Id => _operationId ?? NextLinkOperationImplementation.NotSet; + + /// + public override RehydrationToken? GetRehydrationToken() => _nextLinkOperation?.GetRehydrationToken() ?? _completeRehydrationToken; + + /// + public override T Value => _operation.Value; + + /// + public override bool HasValue => _operation.HasValue; + + /// + public override bool HasCompleted => _operation.HasCompleted; + + /// + public override Response GetRawResponse() => _operation.RawResponse; + + /// + public override Response UpdateStatus(CancellationToken cancellationToken = default) => _operation.UpdateStatus(cancellationToken); + + /// + public override ValueTask UpdateStatusAsync(CancellationToken cancellationToken = default) => _operation.UpdateStatusAsync(cancellationToken); + + /// + public override Response WaitForCompletion(CancellationToken cancellationToken = default) => _operation.WaitForCompletion(cancellationToken); + + /// + public override Response WaitForCompletion(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletion(pollingInterval, cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(cancellationToken); + + /// + public override ValueTask> WaitForCompletionAsync(TimeSpan pollingInterval, CancellationToken cancellationToken = default) => _operation.WaitForCompletionAsync(pollingInterval, cancellationToken); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciClusterProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciClusterProperties.Serialization.cs new file mode 100644 index 000000000000..9ca52752a567 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciClusterProperties.Serialization.cs @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class AzStackHciClusterProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzStackHciClusterProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("clusterName"u8); + writer.WriteStringValue(ClusterName); + writer.WritePropertyName("resourceName"u8); + writer.WriteStringValue(ResourceName); + writer.WritePropertyName("storageAccountName"u8); + writer.WriteStringValue(StorageAccountName); + writer.WritePropertyName("storageContainers"u8); + writer.WriteStartArray(); + foreach (var item in StorageContainers) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + AzStackHciClusterProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzStackHciClusterProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzStackHciClusterProperties(document.RootElement, options); + } + + internal static AzStackHciClusterProperties DeserializeAzStackHciClusterProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string clusterName = default; + string resourceName = default; + string storageAccountName = default; + IList storageContainers = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clusterName"u8)) + { + clusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceName"u8)) + { + resourceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountName"u8)) + { + storageAccountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainers"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(StorageContainerProperties.DeserializeStorageContainerProperties(item, options)); + } + storageContainers = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzStackHciClusterProperties(clusterName, resourceName, storageAccountName, storageContainers, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzStackHciClusterProperties)} does not support writing '{options.Format}' format."); + } + } + + AzStackHciClusterProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzStackHciClusterProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzStackHciClusterProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciClusterProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciClusterProperties.cs new file mode 100644 index 000000000000..5f62eabc122e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciClusterProperties.cs @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// AzStackHCI cluster properties. + public partial class AzStackHciClusterProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the AzStackHCICluster FQDN name. + /// Gets or sets the AzStackHCICluster resource name. + /// Gets or sets the Storage account name. + /// Gets or sets the list of AzStackHCICluster Storage Container. + /// , , or is null. + public AzStackHciClusterProperties(string clusterName, string resourceName, string storageAccountName, IEnumerable storageContainers) + { + Argument.AssertNotNull(clusterName, nameof(clusterName)); + Argument.AssertNotNull(resourceName, nameof(resourceName)); + Argument.AssertNotNull(storageAccountName, nameof(storageAccountName)); + Argument.AssertNotNull(storageContainers, nameof(storageContainers)); + + ClusterName = clusterName; + ResourceName = resourceName; + StorageAccountName = storageAccountName; + StorageContainers = storageContainers.ToList(); + } + + /// Initializes a new instance of . + /// Gets or sets the AzStackHCICluster FQDN name. + /// Gets or sets the AzStackHCICluster resource name. + /// Gets or sets the Storage account name. + /// Gets or sets the list of AzStackHCICluster Storage Container. + /// Keeps track of any properties unknown to the library. + internal AzStackHciClusterProperties(string clusterName, string resourceName, string storageAccountName, IList storageContainers, IDictionary serializedAdditionalRawData) + { + ClusterName = clusterName; + ResourceName = resourceName; + StorageAccountName = storageAccountName; + StorageContainers = storageContainers; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal AzStackHciClusterProperties() + { + } + + /// Gets or sets the AzStackHCICluster FQDN name. + public string ClusterName { get; set; } + /// Gets or sets the AzStackHCICluster resource name. + public string ResourceName { get; set; } + /// Gets or sets the Storage account name. + public string StorageAccountName { get; set; } + /// Gets or sets the list of AzStackHCICluster Storage Container. + public IList StorageContainers { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.Serialization.cs new file mode 100644 index 000000000000..61bfc7e9e974 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.Serialization.cs @@ -0,0 +1,213 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class AzStackHciFabricCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzStackHciFabricCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("azStackHciSiteId"u8); + writer.WriteStringValue(AzStackHciSiteId); + if (options.Format != "W" && Optional.IsCollectionDefined(ApplianceName)) + { + writer.WritePropertyName("applianceName"u8); + writer.WriteStartArray(); + foreach (var item in ApplianceName) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("cluster"u8); + writer.WriteObjectValue(Cluster, options); + if (options.Format != "W" && Optional.IsDefined(FabricResourceId)) + { + writer.WritePropertyName("fabricResourceId"u8); + writer.WriteStringValue(FabricResourceId); + } + if (options.Format != "W" && Optional.IsDefined(FabricContainerId)) + { + writer.WritePropertyName("fabricContainerId"u8); + writer.WriteStringValue(FabricContainerId); + } + writer.WritePropertyName("migrationSolutionId"u8); + writer.WriteStringValue(MigrationSolutionId); + if (options.Format != "W" && Optional.IsDefined(MigrationHubUri)) + { + writer.WritePropertyName("migrationHubUri"u8); + writer.WriteStringValue(MigrationHubUri.AbsoluteUri); + } + } + + AzStackHciFabricCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AzStackHciFabricCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAzStackHciFabricCustomProperties(document.RootElement, options); + } + + internal static AzStackHciFabricCustomProperties DeserializeAzStackHciFabricCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier azStackHciSiteId = default; + IReadOnlyList applianceName = default; + AzStackHciClusterProperties cluster = default; + ResourceIdentifier fabricResourceId = default; + ResourceIdentifier fabricContainerId = default; + ResourceIdentifier migrationSolutionId = default; + Uri migrationHubUri = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("azStackHciSiteId"u8)) + { + azStackHciSiteId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("applianceName"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + applianceName = array; + continue; + } + if (property.NameEquals("cluster"u8)) + { + cluster = AzStackHciClusterProperties.DeserializeAzStackHciClusterProperties(property.Value, options); + continue; + } + if (property.NameEquals("fabricResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fabricResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("fabricContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fabricContainerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationSolutionId"u8)) + { + migrationSolutionId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationHubUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationHubUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AzStackHciFabricCustomProperties( + instanceType, + serializedAdditionalRawData, + azStackHciSiteId, + applianceName ?? new ChangeTrackingList(), + cluster, + fabricResourceId, + fabricContainerId, + migrationSolutionId, + migrationHubUri); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(AzStackHciFabricCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + AzStackHciFabricCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAzStackHciFabricCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AzStackHciFabricCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.cs new file mode 100644 index 000000000000..f095e0960f8b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/AzStackHciFabricCustomProperties.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// AzStackHCI fabric model custom properties. + public partial class AzStackHciFabricCustomProperties : DataReplicationFabricCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the AzStackHCI site. + /// AzStackHCI cluster properties. + /// Gets or sets the Migration solution ARM Id. + /// , or is null. + public AzStackHciFabricCustomProperties(ResourceIdentifier azStackHciSiteId, AzStackHciClusterProperties cluster, ResourceIdentifier migrationSolutionId) + { + Argument.AssertNotNull(azStackHciSiteId, nameof(azStackHciSiteId)); + Argument.AssertNotNull(cluster, nameof(cluster)); + Argument.AssertNotNull(migrationSolutionId, nameof(migrationSolutionId)); + + AzStackHciSiteId = azStackHciSiteId; + ApplianceName = new ChangeTrackingList(); + Cluster = cluster; + MigrationSolutionId = migrationSolutionId; + InstanceType = "AzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the Appliance name. + /// AzStackHCI cluster properties. + /// Gets or sets the fabric resource Id. + /// Gets or sets the fabric container Id. + /// Gets or sets the Migration solution ARM Id. + /// Gets or sets the migration hub Uri. + internal AzStackHciFabricCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier azStackHciSiteId, IReadOnlyList applianceName, AzStackHciClusterProperties cluster, ResourceIdentifier fabricResourceId, ResourceIdentifier fabricContainerId, ResourceIdentifier migrationSolutionId, Uri migrationHubUri) : base(instanceType, serializedAdditionalRawData) + { + AzStackHciSiteId = azStackHciSiteId; + ApplianceName = applianceName; + Cluster = cluster; + FabricResourceId = fabricResourceId; + FabricContainerId = fabricContainerId; + MigrationSolutionId = migrationSolutionId; + MigrationHubUri = migrationHubUri; + InstanceType = instanceType ?? "AzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal AzStackHciFabricCustomProperties() + { + } + + /// Gets or sets the ARM Id of the AzStackHCI site. + public ResourceIdentifier AzStackHciSiteId { get; set; } + /// Gets or sets the Appliance name. + public IReadOnlyList ApplianceName { get; } + /// AzStackHCI cluster properties. + public AzStackHciClusterProperties Cluster { get; set; } + /// Gets or sets the fabric resource Id. + public ResourceIdentifier FabricResourceId { get; } + /// Gets or sets the fabric container Id. + public ResourceIdentifier FabricContainerId { get; } + /// Gets or sets the Migration solution ARM Id. + public ResourceIdentifier MigrationSolutionId { get; set; } + /// Gets or sets the migration hub Uri. + public Uri MigrationHubUri { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.Serialization.cs new file mode 100644 index 000000000000..9b68238af649 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationDiskControllerInputs : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationDiskControllerInputs)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("controllerName"u8); + writer.WriteStringValue(ControllerName); + writer.WritePropertyName("controllerId"u8); + writer.WriteNumberValue(ControllerId); + writer.WritePropertyName("controllerLocation"u8); + writer.WriteNumberValue(ControllerLocation); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationDiskControllerInputs IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationDiskControllerInputs)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationDiskControllerInputs(document.RootElement, options); + } + + internal static DataReplicationDiskControllerInputs DeserializeDataReplicationDiskControllerInputs(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string controllerName = default; + int controllerId = default; + int controllerLocation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("controllerName"u8)) + { + controllerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("controllerId"u8)) + { + controllerId = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("controllerLocation"u8)) + { + controllerLocation = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationDiskControllerInputs(controllerName, controllerId, controllerLocation, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationDiskControllerInputs)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationDiskControllerInputs IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationDiskControllerInputs(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationDiskControllerInputs)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.cs new file mode 100644 index 000000000000..ea674a43355a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationDiskControllerInputs.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Disk controller. + public partial class DataReplicationDiskControllerInputs + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the controller name (IDE,SCSI). + /// Gets or sets the controller ID. + /// Gets or sets the controller Location. + /// is null. + public DataReplicationDiskControllerInputs(string controllerName, int controllerId, int controllerLocation) + { + Argument.AssertNotNull(controllerName, nameof(controllerName)); + + ControllerName = controllerName; + ControllerId = controllerId; + ControllerLocation = controllerLocation; + } + + /// Initializes a new instance of . + /// Gets or sets the controller name (IDE,SCSI). + /// Gets or sets the controller ID. + /// Gets or sets the controller Location. + /// Keeps track of any properties unknown to the library. + internal DataReplicationDiskControllerInputs(string controllerName, int controllerId, int controllerLocation, IDictionary serializedAdditionalRawData) + { + ControllerName = controllerName; + ControllerId = controllerId; + ControllerLocation = controllerLocation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationDiskControllerInputs() + { + } + + /// Gets or sets the controller name (IDE,SCSI). + public string ControllerName { get; set; } + /// Gets or sets the controller ID. + public int ControllerId { get; set; } + /// Gets or sets the controller Location. + public int ControllerLocation { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.Serialization.cs new file mode 100644 index 000000000000..117008070855 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.Serialization.cs @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationEmailConfigurationProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("sendToOwners"u8); + writer.WriteBooleanValue(SendToOwners); + if (Optional.IsCollectionDefined(CustomEmailAddresses)) + { + writer.WritePropertyName("customEmailAddresses"u8); + writer.WriteStartArray(); + foreach (var item in CustomEmailAddresses) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Locale)) + { + writer.WritePropertyName("locale"u8); + writer.WriteStringValue(Locale); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationEmailConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationEmailConfigurationProperties(document.RootElement, options); + } + + internal static DataReplicationEmailConfigurationProperties DeserializeDataReplicationEmailConfigurationProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool sendToOwners = default; + IList customEmailAddresses = default; + string locale = default; + DataReplicationProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sendToOwners"u8)) + { + sendToOwners = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("customEmailAddresses"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + customEmailAddresses = array; + continue; + } + if (property.NameEquals("locale"u8)) + { + locale = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationEmailConfigurationProperties(sendToOwners, customEmailAddresses ?? new ChangeTrackingList(), locale, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationEmailConfigurationProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationEmailConfigurationProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationEmailConfigurationProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.cs new file mode 100644 index 000000000000..9a926bc395d1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEmailConfigurationProperties.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Email configuration model properties. + public partial class DataReplicationEmailConfigurationProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets a value indicating whether to send email to subscription administrator. + public DataReplicationEmailConfigurationProperties(bool sendToOwners) + { + SendToOwners = sendToOwners; + CustomEmailAddresses = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets a value indicating whether to send email to subscription administrator. + /// Gets or sets the custom email address for sending emails. + /// Gets or sets the locale for the email notification. + /// Gets or sets the provisioning state of the email configuration. + /// Keeps track of any properties unknown to the library. + internal DataReplicationEmailConfigurationProperties(bool sendToOwners, IList customEmailAddresses, string locale, DataReplicationProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + SendToOwners = sendToOwners; + CustomEmailAddresses = customEmailAddresses; + Locale = locale; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationEmailConfigurationProperties() + { + } + + /// Gets or sets a value indicating whether to send email to subscription administrator. + public bool SendToOwners { get; set; } + /// Gets or sets the custom email address for sending emails. + public IList CustomEmailAddresses { get; } + /// Gets or sets the locale for the email notification. + public string Locale { get; set; } + /// Gets or sets the provisioning state of the email configuration. + public DataReplicationProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.Serialization.cs new file mode 100644 index 000000000000..dafdda384838 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationErrorInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationErrorInfo)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W" && Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("creationTime"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsDefined(Causes)) + { + writer.WritePropertyName("causes"u8); + writer.WriteStringValue(Causes); + } + if (options.Format != "W" && Optional.IsDefined(Recommendation)) + { + writer.WritePropertyName("recommendation"u8); + writer.WriteStringValue(Recommendation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationErrorInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationErrorInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationErrorInfo(document.RootElement, options); + } + + internal static DataReplicationErrorInfo DeserializeDataReplicationErrorInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string type = default; + string severity = default; + DateTimeOffset? creationTime = default; + string message = default; + string causes = default; + string recommendation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = property.Value.GetString(); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("causes"u8)) + { + causes = property.Value.GetString(); + continue; + } + if (property.NameEquals("recommendation"u8)) + { + recommendation = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationErrorInfo( + code, + type, + severity, + creationTime, + message, + causes, + recommendation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationErrorInfo)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationErrorInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationErrorInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationErrorInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.cs new file mode 100644 index 000000000000..613811120831 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationErrorInfo.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Error model. + public partial class DataReplicationErrorInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationErrorInfo() + { + } + + /// Initializes a new instance of . + /// Gets or sets the error code. + /// Gets or sets the error type. + /// Gets or sets the error severity. + /// Gets or sets the creation time of error. + /// Gets or sets the error message. + /// Gets or sets the possible causes of error. + /// Gets or sets the recommended action to resolve error. + /// Keeps track of any properties unknown to the library. + internal DataReplicationErrorInfo(string code, string type, string severity, DateTimeOffset? createdOn, string message, string causes, string recommendation, IDictionary serializedAdditionalRawData) + { + Code = code; + Type = type; + Severity = severity; + CreatedOn = createdOn; + Message = message; + Causes = causes; + Recommendation = recommendation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the error code. + public string Code { get; } + /// Gets or sets the error type. + public string Type { get; } + /// Gets or sets the error severity. + public string Severity { get; } + /// Gets or sets the creation time of error. + public DateTimeOffset? CreatedOn { get; } + /// Gets or sets the error message. + public string Message { get; } + /// Gets or sets the possible causes of error. + public string Causes { get; } + /// Gets or sets the recommended action to resolve error. + public string Recommendation { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.Serialization.cs new file mode 100644 index 000000000000..1bf715f1793b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationEventCustomProperties))] + public partial class DataReplicationEventCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationEventCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationEventCustomProperties(document.RootElement, options); + } + + internal static DataReplicationEventCustomProperties DeserializeDataReplicationEventCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciEventCustomProperties.DeserializeHyperVToAzStackHciEventCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHciEventCustomProperties.DeserializeVMwareToAzStackHciEventCustomProperties(element, options); + } + } + return UnknownDataReplicationEventCustomProperties.DeserializeUnknownDataReplicationEventCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationEventCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationEventCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.cs new file mode 100644 index 000000000000..126a7bb82a8d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Event model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class DataReplicationEventCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationEventCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationEventCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationEventCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationEventCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.Serialization.cs new file mode 100644 index 000000000000..6cad94847586 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.Serialization.cs @@ -0,0 +1,274 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationEventProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ResourceType)) + { + writer.WritePropertyName("resourceType"u8); + writer.WriteStringValue(ResourceType.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResourceName)) + { + writer.WritePropertyName("resourceName"u8); + writer.WriteStringValue(ResourceName); + } + if (options.Format != "W" && Optional.IsDefined(EventType)) + { + writer.WritePropertyName("eventType"u8); + writer.WriteStringValue(EventType); + } + if (options.Format != "W" && Optional.IsDefined(EventName)) + { + writer.WritePropertyName("eventName"u8); + writer.WriteStringValue(EventName); + } + if (options.Format != "W" && Optional.IsDefined(OccurredOn)) + { + writer.WritePropertyName("timeOfOccurrence"u8); + writer.WriteStringValue(OccurredOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationEventProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationEventProperties(document.RootElement, options); + } + + internal static DataReplicationEventProperties DeserializeDataReplicationEventProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceType? resourceType = default; + string resourceName = default; + string eventType = default; + string eventName = default; + DateTimeOffset? timeOfOccurrence = default; + string severity = default; + string description = default; + string correlationId = default; + IReadOnlyList healthErrors = default; + DataReplicationEventCustomProperties customProperties = default; + DataReplicationProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resourceType = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("resourceName"u8)) + { + resourceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("eventType"u8)) + { + eventType = property.Value.GetString(); + continue; + } + if (property.NameEquals("eventName"u8)) + { + eventName = property.Value.GetString(); + continue; + } + if (property.NameEquals("timeOfOccurrence"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + timeOfOccurrence = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("healthErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationHealthErrorInfo.DeserializeDataReplicationHealthErrorInfo(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationEventCustomProperties.DeserializeDataReplicationEventCustomProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationEventProperties( + resourceType, + resourceName, + eventType, + eventName, + timeOfOccurrence, + severity, + description, + correlationId, + healthErrors ?? new ChangeTrackingList(), + customProperties, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationEventProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationEventProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationEventProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationEventProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.cs new file mode 100644 index 000000000000..3a3d603768bd --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationEventProperties.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Event model properties. + public partial class DataReplicationEventProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Event model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// is null. + internal DataReplicationEventProperties(DataReplicationEventCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the resource type. + /// Gets or sets the resource name. + /// Gets or sets the event type. + /// Gets or sets the event name. + /// Gets or sets the time at which the event occurred at source. + /// Gets or sets the event severity. + /// Gets or sets the event description. + /// Gets or sets the event correlation Id. + /// Gets or sets the errors associated with this event. + /// + /// Event model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Gets or sets the provisioning state of the event. + /// Keeps track of any properties unknown to the library. + internal DataReplicationEventProperties(ResourceType? resourceType, string resourceName, string eventType, string eventName, DateTimeOffset? occurredOn, string severity, string description, string correlationId, IReadOnlyList healthErrors, DataReplicationEventCustomProperties customProperties, DataReplicationProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + ResourceType = resourceType; + ResourceName = resourceName; + EventType = eventType; + EventName = eventName; + OccurredOn = occurredOn; + Severity = severity; + Description = description; + CorrelationId = correlationId; + HealthErrors = healthErrors; + CustomProperties = customProperties; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationEventProperties() + { + } + + /// Gets or sets the resource type. + public ResourceType? ResourceType { get; } + /// Gets or sets the resource name. + public string ResourceName { get; } + /// Gets or sets the event type. + public string EventType { get; } + /// Gets or sets the event name. + public string EventName { get; } + /// Gets or sets the time at which the event occurred at source. + public DateTimeOffset? OccurredOn { get; } + /// Gets or sets the event severity. + public string Severity { get; } + /// Gets or sets the event description. + public string Description { get; } + /// Gets or sets the event correlation Id. + public string CorrelationId { get; } + /// Gets or sets the errors associated with this event. + public IReadOnlyList HealthErrors { get; } + /// + /// Event model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public DataReplicationEventCustomProperties CustomProperties { get; } + /// Gets or sets the provisioning state of the event. + public DataReplicationProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.Serialization.cs new file mode 100644 index 000000000000..0eef400700f5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationExtensionCustomProperties))] + public partial class DataReplicationExtensionCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationExtensionCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationExtensionCustomProperties(document.RootElement, options); + } + + internal static DataReplicationExtensionCustomProperties DeserializeDataReplicationExtensionCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciReplicationExtensionCustomProperties.DeserializeHyperVToAzStackHciReplicationExtensionCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHciReplicationExtensionCustomProperties.DeserializeVMwareToAzStackHciReplicationExtensionCustomProperties(element, options); + } + } + return UnknownDataReplicationExtensionCustomProperties.DeserializeUnknownDataReplicationExtensionCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationExtensionCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationExtensionCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.cs new file mode 100644 index 000000000000..bced10ed844b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Replication extension model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class DataReplicationExtensionCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationExtensionCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationExtensionCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationExtensionCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationExtensionCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.Serialization.cs new file mode 100644 index 000000000000..285124b1c2a7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationExtensionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationExtensionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationExtensionProperties(document.RootElement, options); + } + + internal static DataReplicationExtensionProperties DeserializeDataReplicationExtensionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProvisioningState? provisioningState = default; + DataReplicationExtensionCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationExtensionCustomProperties.DeserializeDataReplicationExtensionCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationExtensionProperties(provisioningState, customProperties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationExtensionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationExtensionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.cs new file mode 100644 index 000000000000..3d6dc50fae7c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationExtensionProperties.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Replication extension model properties. + public partial class DataReplicationExtensionProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Replication extension model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// is null. + public DataReplicationExtensionProperties(DataReplicationExtensionCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the replication extension. + /// + /// Replication extension model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Keeps track of any properties unknown to the library. + internal DataReplicationExtensionProperties(DataReplicationProvisioningState? provisioningState, DataReplicationExtensionCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationExtensionProperties() + { + } + + /// Gets or sets the provisioning state of the replication extension. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// + /// Replication extension model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public DataReplicationExtensionCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.Serialization.cs new file mode 100644 index 000000000000..ae6557701915 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationFabricAgentCustomProperties))] + public partial class DataReplicationFabricAgentCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationFabricAgentCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricAgentCustomProperties(document.RootElement, options); + } + + internal static DataReplicationFabricAgentCustomProperties DeserializeDataReplicationFabricAgentCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "VMware": return VMwareFabricAgentCustomProperties.DeserializeVMwareFabricAgentCustomProperties(element, options); + } + } + return UnknownDataReplicationFabricAgentCustomProperties.DeserializeUnknownDataReplicationFabricAgentCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricAgentCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricAgentCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.cs new file mode 100644 index 000000000000..d95e02cfee41 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Fabric agent model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public abstract partial class DataReplicationFabricAgentCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationFabricAgentCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricAgentCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricAgentCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationFabricAgentCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.Serialization.cs new file mode 100644 index 000000000000..68c332224b99 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.Serialization.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationFabricAgentProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + writer.WritePropertyName("machineId"u8); + writer.WriteStringValue(MachineId); + writer.WritePropertyName("machineName"u8); + writer.WriteStringValue(MachineName); + writer.WritePropertyName("authenticationIdentity"u8); + writer.WriteObjectValue(AuthenticationIdentity, options); + writer.WritePropertyName("resourceAccessIdentity"u8); + writer.WriteObjectValue(ResourceAccessIdentity, options); + if (options.Format != "W" && Optional.IsDefined(IsResponsive)) + { + writer.WritePropertyName("isResponsive"u8); + writer.WriteBooleanValue(IsResponsive.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastHeartbeatOn)) + { + writer.WritePropertyName("lastHeartbeat"u8); + writer.WriteStringValue(LastHeartbeatOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(VersionNumber)) + { + writer.WritePropertyName("versionNumber"u8); + writer.WriteStringValue(VersionNumber); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationFabricAgentProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricAgentProperties(document.RootElement, options); + } + + internal static DataReplicationFabricAgentProperties DeserializeDataReplicationFabricAgentProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string correlationId = default; + string machineId = default; + string machineName = default; + DataReplicationIdentity authenticationIdentity = default; + DataReplicationIdentity resourceAccessIdentity = default; + bool? isResponsive = default; + DateTimeOffset? lastHeartbeat = default; + string versionNumber = default; + DataReplicationProvisioningState? provisioningState = default; + IReadOnlyList healthErrors = default; + DataReplicationFabricAgentCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("machineId"u8)) + { + machineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("machineName"u8)) + { + machineName = property.Value.GetString(); + continue; + } + if (property.NameEquals("authenticationIdentity"u8)) + { + authenticationIdentity = DataReplicationIdentity.DeserializeDataReplicationIdentity(property.Value, options); + continue; + } + if (property.NameEquals("resourceAccessIdentity"u8)) + { + resourceAccessIdentity = DataReplicationIdentity.DeserializeDataReplicationIdentity(property.Value, options); + continue; + } + if (property.NameEquals("isResponsive"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isResponsive = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lastHeartbeat"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastHeartbeat = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("versionNumber"u8)) + { + versionNumber = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("healthErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationHealthErrorInfo.DeserializeDataReplicationHealthErrorInfo(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationFabricAgentCustomProperties.DeserializeDataReplicationFabricAgentCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationFabricAgentProperties( + correlationId, + machineId, + machineName, + authenticationIdentity, + resourceAccessIdentity, + isResponsive, + lastHeartbeat, + versionNumber, + provisioningState, + healthErrors ?? new ChangeTrackingList(), + customProperties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricAgentProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricAgentProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.cs new file mode 100644 index 000000000000..ca2228a4d0da --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricAgentProperties.cs @@ -0,0 +1,140 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Fabric agent model properties. + public partial class DataReplicationFabricAgentProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the machine Id where fabric agent is running. + /// Gets or sets the machine name where fabric agent is running. + /// Identity model. + /// Identity model. + /// + /// Fabric agent model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// , , , or is null. + public DataReplicationFabricAgentProperties(string machineId, string machineName, DataReplicationIdentity authenticationIdentity, DataReplicationIdentity resourceAccessIdentity, DataReplicationFabricAgentCustomProperties customProperties) + { + Argument.AssertNotNull(machineId, nameof(machineId)); + Argument.AssertNotNull(machineName, nameof(machineName)); + Argument.AssertNotNull(authenticationIdentity, nameof(authenticationIdentity)); + Argument.AssertNotNull(resourceAccessIdentity, nameof(resourceAccessIdentity)); + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + MachineId = machineId; + MachineName = machineName; + AuthenticationIdentity = authenticationIdentity; + ResourceAccessIdentity = resourceAccessIdentity; + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the fabric agent correlation Id. + /// Gets or sets the machine Id where fabric agent is running. + /// Gets or sets the machine name where fabric agent is running. + /// Identity model. + /// Identity model. + /// Gets or sets a value indicating whether the fabric agent is responsive. + /// Gets or sets the time when last heartbeat was sent by the fabric agent. + /// Gets or sets the fabric agent version. + /// Gets or sets the provisioning state of the fabric agent. + /// Gets or sets the list of health errors. + /// + /// Fabric agent model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricAgentProperties(string correlationId, string machineId, string machineName, DataReplicationIdentity authenticationIdentity, DataReplicationIdentity resourceAccessIdentity, bool? isResponsive, DateTimeOffset? lastHeartbeatOn, string versionNumber, DataReplicationProvisioningState? provisioningState, IReadOnlyList healthErrors, DataReplicationFabricAgentCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + CorrelationId = correlationId; + MachineId = machineId; + MachineName = machineName; + AuthenticationIdentity = authenticationIdentity; + ResourceAccessIdentity = resourceAccessIdentity; + IsResponsive = isResponsive; + LastHeartbeatOn = lastHeartbeatOn; + VersionNumber = versionNumber; + ProvisioningState = provisioningState; + HealthErrors = healthErrors; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationFabricAgentProperties() + { + } + + /// Gets or sets the fabric agent correlation Id. + public string CorrelationId { get; } + /// Gets or sets the machine Id where fabric agent is running. + public string MachineId { get; set; } + /// Gets or sets the machine name where fabric agent is running. + public string MachineName { get; set; } + /// Identity model. + public DataReplicationIdentity AuthenticationIdentity { get; set; } + /// Identity model. + public DataReplicationIdentity ResourceAccessIdentity { get; set; } + /// Gets or sets a value indicating whether the fabric agent is responsive. + public bool? IsResponsive { get; } + /// Gets or sets the time when last heartbeat was sent by the fabric agent. + public DateTimeOffset? LastHeartbeatOn { get; } + /// Gets or sets the fabric agent version. + public string VersionNumber { get; } + /// Gets or sets the provisioning state of the fabric agent. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// Gets or sets the list of health errors. + public IReadOnlyList HealthErrors { get; } + /// + /// Fabric agent model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public DataReplicationFabricAgentCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.Serialization.cs new file mode 100644 index 000000000000..30c1305539e7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationFabricCustomProperties))] + public partial class DataReplicationFabricCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationFabricCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricCustomProperties(document.RootElement, options); + } + + internal static DataReplicationFabricCustomProperties DeserializeDataReplicationFabricCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "AzStackHCI": return AzStackHciFabricCustomProperties.DeserializeAzStackHciFabricCustomProperties(element, options); + case "HyperVMigrate": return HyperVMigrateFabricCustomProperties.DeserializeHyperVMigrateFabricCustomProperties(element, options); + case "VMwareMigrate": return VMwareMigrateFabricCustomProperties.DeserializeVMwareMigrateFabricCustomProperties(element, options); + } + } + return UnknownDataReplicationFabricCustomProperties.DeserializeUnknownDataReplicationFabricCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.cs new file mode 100644 index 000000000000..f948ab6a88c9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Fabric model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public abstract partial class DataReplicationFabricCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationFabricCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationFabricCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.Serialization.cs new file mode 100644 index 000000000000..49c9b5d2e441 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.Serialization.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationFabricPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricPatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationFabricPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricPatch(document.RootElement, options); + } + + internal static DataReplicationFabricPatch DeserializeDataReplicationFabricPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + DataReplicationFabricProperties properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationFabricProperties.DeserializeDataReplicationFabricProperties(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationFabricPatch( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricPatch)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.cs new file mode 100644 index 000000000000..c5a4dd1bb692 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricPatch.cs @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Fabric model update. + public partial class DataReplicationFabricPatch : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationFabricPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the resource tags. + /// Fabric model properties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, DataReplicationFabricProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Tags = tags; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the resource tags. + public IDictionary Tags { get; } + /// Fabric model properties. + public DataReplicationFabricProperties Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.Serialization.cs new file mode 100644 index 000000000000..860d670040dc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationFabricProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ServiceEndpoint)) + { + writer.WritePropertyName("serviceEndpoint"u8); + writer.WriteStringValue(ServiceEndpoint); + } + if (options.Format != "W" && Optional.IsDefined(ServiceResourceId)) + { + writer.WritePropertyName("serviceResourceId"u8); + writer.WriteStringValue(ServiceResourceId); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationFabricProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricProperties(document.RootElement, options); + } + + internal static DataReplicationFabricProperties DeserializeDataReplicationFabricProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProvisioningState? provisioningState = default; + string serviceEndpoint = default; + ResourceIdentifier serviceResourceId = default; + DataReplicationHealthStatus? health = default; + IReadOnlyList healthErrors = default; + DataReplicationFabricCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceEndpoint"u8)) + { + serviceEndpoint = property.Value.GetString(); + continue; + } + if (property.NameEquals("serviceResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new DataReplicationHealthStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("healthErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationHealthErrorInfo.DeserializeDataReplicationHealthErrorInfo(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationFabricCustomProperties.DeserializeDataReplicationFabricCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationFabricProperties( + provisioningState, + serviceEndpoint, + serviceResourceId, + health, + healthErrors ?? new ChangeTrackingList(), + customProperties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.cs new file mode 100644 index 000000000000..316e0a251f95 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationFabricProperties.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Fabric model properties. + public partial class DataReplicationFabricProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Fabric model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// is null. + public DataReplicationFabricProperties(DataReplicationFabricCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the fabric. + /// Gets or sets the service endpoint. + /// Gets or sets the service resource Id. + /// Gets or sets the fabric health. + /// Gets or sets the list of health errors. + /// + /// Fabric model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Keeps track of any properties unknown to the library. + internal DataReplicationFabricProperties(DataReplicationProvisioningState? provisioningState, string serviceEndpoint, ResourceIdentifier serviceResourceId, DataReplicationHealthStatus? health, IReadOnlyList healthErrors, DataReplicationFabricCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + ServiceEndpoint = serviceEndpoint; + ServiceResourceId = serviceResourceId; + Health = health; + HealthErrors = healthErrors; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationFabricProperties() + { + } + + /// Gets or sets the provisioning state of the fabric. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// Gets or sets the service endpoint. + public string ServiceEndpoint { get; } + /// Gets or sets the service resource Id. + public ResourceIdentifier ServiceResourceId { get; } + /// Gets or sets the fabric health. + public DataReplicationHealthStatus? Health { get; } + /// Gets or sets the list of health errors. + public IReadOnlyList HealthErrors { get; } + /// + /// Fabric model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public DataReplicationFabricCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.Serialization.cs new file mode 100644 index 000000000000..5f27929dde0e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.Serialization.cs @@ -0,0 +1,327 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationHealthErrorInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationHealthErrorInfo)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AffectedResourceType)) + { + writer.WritePropertyName("affectedResourceType"u8); + writer.WriteStringValue(AffectedResourceType.Value); + } + if (Optional.IsCollectionDefined(AffectedResourceCorrelationIds)) + { + writer.WritePropertyName("affectedResourceCorrelationIds"u8); + writer.WriteStartArray(); + foreach (var item in AffectedResourceCorrelationIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ChildErrors)) + { + writer.WritePropertyName("childErrors"u8); + writer.WriteStartArray(); + foreach (var item in ChildErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W" && Optional.IsDefined(HealthCategory)) + { + writer.WritePropertyName("healthCategory"u8); + writer.WriteStringValue(HealthCategory); + } + if (options.Format != "W" && Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("creationTime"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(IsCustomerResolvable)) + { + writer.WritePropertyName("isCustomerResolvable"u8); + writer.WriteBooleanValue(IsCustomerResolvable.Value); + } + if (options.Format != "W" && Optional.IsDefined(Summary)) + { + writer.WritePropertyName("summary"u8); + writer.WriteStringValue(Summary); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsDefined(Causes)) + { + writer.WritePropertyName("causes"u8); + writer.WriteStringValue(Causes); + } + if (options.Format != "W" && Optional.IsDefined(Recommendation)) + { + writer.WritePropertyName("recommendation"u8); + writer.WriteStringValue(Recommendation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationHealthErrorInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationHealthErrorInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationHealthErrorInfo(document.RootElement, options); + } + + internal static DataReplicationHealthErrorInfo DeserializeDataReplicationHealthErrorInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceType? affectedResourceType = default; + IReadOnlyList affectedResourceCorrelationIds = default; + IReadOnlyList childErrors = default; + string code = default; + string healthCategory = default; + string category = default; + string severity = default; + string source = default; + DateTimeOffset? creationTime = default; + bool? isCustomerResolvable = default; + string summary = default; + string message = default; + string causes = default; + string recommendation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("affectedResourceType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedResourceType = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("affectedResourceCorrelationIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + affectedResourceCorrelationIds = array; + continue; + } + if (property.NameEquals("childErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationInnerHealthErrorInfo.DeserializeDataReplicationInnerHealthErrorInfo(item, options)); + } + childErrors = array; + continue; + } + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("healthCategory"u8)) + { + healthCategory = property.Value.GetString(); + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("isCustomerResolvable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isCustomerResolvable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("summary"u8)) + { + summary = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("causes"u8)) + { + causes = property.Value.GetString(); + continue; + } + if (property.NameEquals("recommendation"u8)) + { + recommendation = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationHealthErrorInfo( + affectedResourceType, + affectedResourceCorrelationIds ?? new ChangeTrackingList(), + childErrors ?? new ChangeTrackingList(), + code, + healthCategory, + category, + severity, + source, + creationTime, + isCustomerResolvable, + summary, + message, + causes, + recommendation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationHealthErrorInfo)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationHealthErrorInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationHealthErrorInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationHealthErrorInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.cs new file mode 100644 index 000000000000..6105c45194d0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthErrorInfo.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Health error model. + public partial class DataReplicationHealthErrorInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationHealthErrorInfo() + { + AffectedResourceCorrelationIds = new ChangeTrackingList(); + ChildErrors = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets the type of affected resource type. + /// Gets or sets the list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + /// Gets or sets a list of child health errors associated with this error. + /// Gets or sets the error code. + /// Gets or sets the health category. + /// Gets or sets the error category. + /// Gets or sets the error severity. + /// Gets or sets the error source. + /// Gets or sets the error creation time. + /// Gets or sets a value indicating whether the error is customer resolvable. + /// Gets or sets the error summary. + /// Gets or sets the error message. + /// Gets or sets possible causes of the error. + /// Gets or sets recommended action to resolve the error. + /// Keeps track of any properties unknown to the library. + internal DataReplicationHealthErrorInfo(ResourceType? affectedResourceType, IReadOnlyList affectedResourceCorrelationIds, IReadOnlyList childErrors, string code, string healthCategory, string category, string severity, string source, DateTimeOffset? createdOn, bool? isCustomerResolvable, string summary, string message, string causes, string recommendation, IDictionary serializedAdditionalRawData) + { + AffectedResourceType = affectedResourceType; + AffectedResourceCorrelationIds = affectedResourceCorrelationIds; + ChildErrors = childErrors; + Code = code; + HealthCategory = healthCategory; + Category = category; + Severity = severity; + Source = source; + CreatedOn = createdOn; + IsCustomerResolvable = isCustomerResolvable; + Summary = summary; + Message = message; + Causes = causes; + Recommendation = recommendation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the type of affected resource type. + public ResourceType? AffectedResourceType { get; } + /// Gets or sets the list of affected resource correlation Ids. This can be used to uniquely identify the count of items affected by a specific category and severity as well as count of item affected by an specific issue. + public IReadOnlyList AffectedResourceCorrelationIds { get; } + /// Gets or sets a list of child health errors associated with this error. + public IReadOnlyList ChildErrors { get; } + /// Gets or sets the error code. + public string Code { get; } + /// Gets or sets the health category. + public string HealthCategory { get; } + /// Gets or sets the error category. + public string Category { get; } + /// Gets or sets the error severity. + public string Severity { get; } + /// Gets or sets the error source. + public string Source { get; } + /// Gets or sets the error creation time. + public DateTimeOffset? CreatedOn { get; } + /// Gets or sets a value indicating whether the error is customer resolvable. + public bool? IsCustomerResolvable { get; } + /// Gets or sets the error summary. + public string Summary { get; } + /// Gets or sets the error message. + public string Message { get; } + /// Gets or sets possible causes of the error. + public string Causes { get; } + /// Gets or sets recommended action to resolve the error. + public string Recommendation { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthStatus.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthStatus.cs new file mode 100644 index 000000000000..716a87911b30 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationHealthStatus.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the fabric health. + public readonly partial struct DataReplicationHealthStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationHealthStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NormalValue = "Normal"; + private const string WarningValue = "Warning"; + private const string CriticalValue = "Critical"; + + /// Healthy Status. + public static DataReplicationHealthStatus Normal { get; } = new DataReplicationHealthStatus(NormalValue); + /// Warning Status. + public static DataReplicationHealthStatus Warning { get; } = new DataReplicationHealthStatus(WarningValue); + /// Critical Status. + public static DataReplicationHealthStatus Critical { get; } = new DataReplicationHealthStatus(CriticalValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationHealthStatus left, DataReplicationHealthStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationHealthStatus left, DataReplicationHealthStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationHealthStatus(string value) => new DataReplicationHealthStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationHealthStatus other && Equals(other); + /// + public bool Equals(DataReplicationHealthStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.Serialization.cs new file mode 100644 index 000000000000..52efea81eef7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationIdentity)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("tenantId"u8); + writer.WriteStringValue(TenantId); + writer.WritePropertyName("applicationId"u8); + writer.WriteStringValue(ApplicationId); + writer.WritePropertyName("objectId"u8); + writer.WriteStringValue(ObjectId); + writer.WritePropertyName("audience"u8); + writer.WriteStringValue(Audience); + writer.WritePropertyName("aadAuthority"u8); + writer.WriteStringValue(AadAuthority); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationIdentity(document.RootElement, options); + } + + internal static DataReplicationIdentity DeserializeDataReplicationIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Guid tenantId = default; + string applicationId = default; + string objectId = default; + string audience = default; + string aadAuthority = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tenantId"u8)) + { + tenantId = property.Value.GetGuid(); + continue; + } + if (property.NameEquals("applicationId"u8)) + { + applicationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectId"u8)) + { + objectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("audience"u8)) + { + audience = property.Value.GetString(); + continue; + } + if (property.NameEquals("aadAuthority"u8)) + { + aadAuthority = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationIdentity( + tenantId, + applicationId, + objectId, + audience, + aadAuthority, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationIdentity)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.cs new file mode 100644 index 000000000000..0b1a73510c21 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationIdentity.cs @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Identity model. + public partial class DataReplicationIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the tenant Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the client/application Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the object Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the audience of the SPN with which fabric agent communicates to service. + /// Gets or sets the authority of the SPN with which fabric agent communicates to service. + /// , , or is null. + public DataReplicationIdentity(Guid tenantId, string applicationId, string objectId, string audience, string aadAuthority) + { + Argument.AssertNotNull(applicationId, nameof(applicationId)); + Argument.AssertNotNull(objectId, nameof(objectId)); + Argument.AssertNotNull(audience, nameof(audience)); + Argument.AssertNotNull(aadAuthority, nameof(aadAuthority)); + + TenantId = tenantId; + ApplicationId = applicationId; + ObjectId = objectId; + Audience = audience; + AadAuthority = aadAuthority; + } + + /// Initializes a new instance of . + /// Gets or sets the tenant Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the client/application Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the object Id of the SPN with which fabric agent communicates to service. + /// Gets or sets the audience of the SPN with which fabric agent communicates to service. + /// Gets or sets the authority of the SPN with which fabric agent communicates to service. + /// Keeps track of any properties unknown to the library. + internal DataReplicationIdentity(Guid tenantId, string applicationId, string objectId, string audience, string aadAuthority, IDictionary serializedAdditionalRawData) + { + TenantId = tenantId; + ApplicationId = applicationId; + ObjectId = objectId; + Audience = audience; + AadAuthority = aadAuthority; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationIdentity() + { + } + + /// Gets or sets the tenant Id of the SPN with which fabric agent communicates to service. + public Guid TenantId { get; set; } + /// Gets or sets the client/application Id of the SPN with which fabric agent communicates to service. + public string ApplicationId { get; set; } + /// Gets or sets the object Id of the SPN with which fabric agent communicates to service. + public string ObjectId { get; set; } + /// Gets or sets the audience of the SPN with which fabric agent communicates to service. + public string Audience { get; set; } + /// Gets or sets the authority of the SPN with which fabric agent communicates to service. + public string AadAuthority { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.Serialization.cs new file mode 100644 index 000000000000..af4a164da9d6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.Serialization.cs @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationInnerHealthErrorInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationInnerHealthErrorInfo)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W" && Optional.IsDefined(HealthCategory)) + { + writer.WritePropertyName("healthCategory"u8); + writer.WriteStringValue(HealthCategory); + } + if (options.Format != "W" && Optional.IsDefined(Category)) + { + writer.WritePropertyName("category"u8); + writer.WriteStringValue(Category); + } + if (options.Format != "W" && Optional.IsDefined(Severity)) + { + writer.WritePropertyName("severity"u8); + writer.WriteStringValue(Severity); + } + if (options.Format != "W" && Optional.IsDefined(Source)) + { + writer.WritePropertyName("source"u8); + writer.WriteStringValue(Source); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("creationTime"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(IsCustomerResolvable)) + { + writer.WritePropertyName("isCustomerResolvable"u8); + writer.WriteBooleanValue(IsCustomerResolvable.Value); + } + if (options.Format != "W" && Optional.IsDefined(Summary)) + { + writer.WritePropertyName("summary"u8); + writer.WriteStringValue(Summary); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsDefined(Causes)) + { + writer.WritePropertyName("causes"u8); + writer.WriteStringValue(Causes); + } + if (options.Format != "W" && Optional.IsDefined(Recommendation)) + { + writer.WritePropertyName("recommendation"u8); + writer.WriteStringValue(Recommendation); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationInnerHealthErrorInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationInnerHealthErrorInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationInnerHealthErrorInfo(document.RootElement, options); + } + + internal static DataReplicationInnerHealthErrorInfo DeserializeDataReplicationInnerHealthErrorInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string healthCategory = default; + string category = default; + string severity = default; + string source = default; + DateTimeOffset? creationTime = default; + bool? isCustomerResolvable = default; + string summary = default; + string message = default; + string causes = default; + string recommendation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("healthCategory"u8)) + { + healthCategory = property.Value.GetString(); + continue; + } + if (property.NameEquals("category"u8)) + { + category = property.Value.GetString(); + continue; + } + if (property.NameEquals("severity"u8)) + { + severity = property.Value.GetString(); + continue; + } + if (property.NameEquals("source"u8)) + { + source = property.Value.GetString(); + continue; + } + if (property.NameEquals("creationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + creationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("isCustomerResolvable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isCustomerResolvable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("summary"u8)) + { + summary = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("causes"u8)) + { + causes = property.Value.GetString(); + continue; + } + if (property.NameEquals("recommendation"u8)) + { + recommendation = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationInnerHealthErrorInfo( + code, + healthCategory, + category, + severity, + source, + creationTime, + isCustomerResolvable, + summary, + message, + causes, + recommendation, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationInnerHealthErrorInfo)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationInnerHealthErrorInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationInnerHealthErrorInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationInnerHealthErrorInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.cs new file mode 100644 index 000000000000..2d9fcba3dcf6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationInnerHealthErrorInfo.cs @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Inner health error model. + public partial class DataReplicationInnerHealthErrorInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationInnerHealthErrorInfo() + { + } + + /// Initializes a new instance of . + /// Gets or sets the error code. + /// Gets or sets the health category. + /// Gets or sets the error category. + /// Gets or sets the error severity. + /// Gets or sets the error source. + /// Gets or sets the error creation time. + /// Gets or sets a value indicating whether the error is customer resolvable. + /// Gets or sets the error summary. + /// Gets or sets the error message. + /// Gets or sets possible causes of the error. + /// Gets or sets recommended action to resolve the error. + /// Keeps track of any properties unknown to the library. + internal DataReplicationInnerHealthErrorInfo(string code, string healthCategory, string category, string severity, string source, DateTimeOffset? createdOn, bool? isCustomerResolvable, string summary, string message, string causes, string recommendation, IDictionary serializedAdditionalRawData) + { + Code = code; + HealthCategory = healthCategory; + Category = category; + Severity = severity; + Source = source; + CreatedOn = createdOn; + IsCustomerResolvable = isCustomerResolvable; + Summary = summary; + Message = message; + Causes = causes; + Recommendation = recommendation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the error code. + public string Code { get; } + /// Gets or sets the health category. + public string HealthCategory { get; } + /// Gets or sets the error category. + public string Category { get; } + /// Gets or sets the error severity. + public string Severity { get; } + /// Gets or sets the error source. + public string Source { get; } + /// Gets or sets the error creation time. + public DateTimeOffset? CreatedOn { get; } + /// Gets or sets a value indicating whether the error is customer resolvable. + public bool? IsCustomerResolvable { get; } + /// Gets or sets the error summary. + public string Summary { get; } + /// Gets or sets the error message. + public string Message { get; } + /// Gets or sets possible causes of the error. + public string Causes { get; } + /// Gets or sets recommended action to resolve the error. + public string Recommendation { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.Serialization.cs new file mode 100644 index 000000000000..93f9ee1d7226 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.Serialization.cs @@ -0,0 +1,124 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationJobCustomProperties))] + public partial class DataReplicationJobCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && Optional.IsDefined(AffectedObjectDetails)) + { + writer.WritePropertyName("affectedObjectDetails"u8); + writer.WriteObjectValue(AffectedObjectDetails, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationJobCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationJobCustomProperties(document.RootElement, options); + } + + internal static DataReplicationJobCustomProperties DeserializeDataReplicationJobCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "FailoverJobDetails": return FailoverJobCustomProperties.DeserializeFailoverJobCustomProperties(element, options); + case "TestFailoverCleanupJobDetails": return TestFailoverCleanupJobCustomProperties.DeserializeTestFailoverCleanupJobCustomProperties(element, options); + case "TestFailoverJobDetails": return TestFailoverJobCustomProperties.DeserializeTestFailoverJobCustomProperties(element, options); + } + } + return UnknownDataReplicationJobCustomProperties.DeserializeUnknownDataReplicationJobCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationJobCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationJobCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.cs new file mode 100644 index 000000000000..1547285af3ef --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobCustomProperties.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Job model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public abstract partial class DataReplicationJobCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationJobCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationJobCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + internal DataReplicationJobCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + AffectedObjectDetails = affectedObjectDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationJobCustomProperties. + internal string InstanceType { get; set; } + /// Gets or sets any custom properties of the affected object. + public JobModelCustomPropertiesAffectedObjectDetails AffectedObjectDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobObjectType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobObjectType.cs new file mode 100644 index 000000000000..9d728afd64f0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobObjectType.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the object type. + public readonly partial struct DataReplicationJobObjectType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationJobObjectType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AvsDiskPoolValue = "AvsDiskPool"; + private const string FabricAgentValue = "FabricAgent"; + private const string FabricValue = "Fabric"; + private const string PolicyValue = "Policy"; + private const string ProtectedItemValue = "ProtectedItem"; + private const string RecoveryPlanValue = "RecoveryPlan"; + private const string ReplicationExtensionValue = "ReplicationExtension"; + private const string VaultValue = "Vault"; + + /// AVS disk pool. + public static DataReplicationJobObjectType AvsDiskPool { get; } = new DataReplicationJobObjectType(AvsDiskPoolValue); + /// Fabric agent level workflow. + public static DataReplicationJobObjectType FabricAgent { get; } = new DataReplicationJobObjectType(FabricAgentValue); + /// Fabric level job. + public static DataReplicationJobObjectType Fabric { get; } = new DataReplicationJobObjectType(FabricValue); + /// Policy level job. + public static DataReplicationJobObjectType Policy { get; } = new DataReplicationJobObjectType(PolicyValue); + /// Protected item level job. + public static DataReplicationJobObjectType ProtectedItem { get; } = new DataReplicationJobObjectType(ProtectedItemValue); + /// Recovery plan level job. + public static DataReplicationJobObjectType RecoveryPlan { get; } = new DataReplicationJobObjectType(RecoveryPlanValue); + /// Replication extension level job. + public static DataReplicationJobObjectType ReplicationExtension { get; } = new DataReplicationJobObjectType(ReplicationExtensionValue); + /// Vault level job. + public static DataReplicationJobObjectType Vault { get; } = new DataReplicationJobObjectType(VaultValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationJobObjectType left, DataReplicationJobObjectType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationJobObjectType left, DataReplicationJobObjectType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationJobObjectType(string value) => new DataReplicationJobObjectType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationJobObjectType other && Equals(other); + /// + public bool Equals(DataReplicationJobObjectType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.Serialization.cs new file mode 100644 index 000000000000..f2d76c55c6c1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.Serialization.cs @@ -0,0 +1,394 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(ObjectId)) + { + writer.WritePropertyName("objectId"u8); + writer.WriteStringValue(ObjectId); + } + if (options.Format != "W" && Optional.IsDefined(ObjectName)) + { + writer.WritePropertyName("objectName"u8); + writer.WriteStringValue(ObjectName); + } + if (options.Format != "W" && Optional.IsDefined(ObjectInternalId)) + { + writer.WritePropertyName("objectInternalId"u8); + writer.WriteStringValue(ObjectInternalId); + } + if (options.Format != "W" && Optional.IsDefined(ObjectInternalName)) + { + writer.WritePropertyName("objectInternalName"u8); + writer.WriteStringValue(ObjectInternalName); + } + if (options.Format != "W" && Optional.IsDefined(ObjectType)) + { + writer.WritePropertyName("objectType"u8); + writer.WriteStringValue(ObjectType.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ReplicationProviderId)) + { + writer.WritePropertyName("replicationProviderId"u8); + writer.WriteStringValue(ReplicationProviderId); + } + if (options.Format != "W" && Optional.IsDefined(SourceFabricProviderId)) + { + writer.WritePropertyName("sourceFabricProviderId"u8); + writer.WriteStringValue(SourceFabricProviderId); + } + if (options.Format != "W" && Optional.IsDefined(TargetFabricProviderId)) + { + writer.WritePropertyName("targetFabricProviderId"u8); + writer.WriteStringValue(TargetFabricProviderId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AllowedActions)) + { + writer.WritePropertyName("allowedActions"u8); + writer.WriteStartArray(); + foreach (var item in AllowedActions) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ActivityId)) + { + writer.WritePropertyName("activityId"u8); + writer.WriteStringValue(ActivityId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Tasks)) + { + writer.WritePropertyName("tasks"u8); + writer.WriteStartArray(); + foreach (var item in Tasks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteStartArray(); + foreach (var item in Errors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationJobProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationJobProperties(document.RootElement, options); + } + + internal static DataReplicationJobProperties DeserializeDataReplicationJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string displayName = default; + DataReplicationJobState? state = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + string objectId = default; + string objectName = default; + string objectInternalId = default; + string objectInternalName = default; + DataReplicationJobObjectType? objectType = default; + string replicationProviderId = default; + string sourceFabricProviderId = default; + string targetFabricProviderId = default; + IReadOnlyList allowedActions = default; + string activityId = default; + IReadOnlyList tasks = default; + IReadOnlyList errors = default; + DataReplicationJobCustomProperties customProperties = default; + DataReplicationProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new DataReplicationJobState(property.Value.GetString()); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("objectId"u8)) + { + objectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectName"u8)) + { + objectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectInternalId"u8)) + { + objectInternalId = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectInternalName"u8)) + { + objectInternalName = property.Value.GetString(); + continue; + } + if (property.NameEquals("objectType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + objectType = new DataReplicationJobObjectType(property.Value.GetString()); + continue; + } + if (property.NameEquals("replicationProviderId"u8)) + { + replicationProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceFabricProviderId"u8)) + { + sourceFabricProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricProviderId"u8)) + { + targetFabricProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("allowedActions"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedActions = array; + continue; + } + if (property.NameEquals("activityId"u8)) + { + activityId = property.Value.GetString(); + continue; + } + if (property.NameEquals("tasks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationTask.DeserializeDataReplicationTask(item, options)); + } + tasks = array; + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationErrorInfo.DeserializeDataReplicationErrorInfo(item, options)); + } + errors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationJobCustomProperties.DeserializeDataReplicationJobCustomProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationJobProperties( + displayName, + state, + startTime, + endTime, + objectId, + objectName, + objectInternalId, + objectInternalName, + objectType, + replicationProviderId, + sourceFabricProviderId, + targetFabricProviderId, + allowedActions ?? new ChangeTrackingList(), + activityId, + tasks ?? new ChangeTrackingList(), + errors ?? new ChangeTrackingList(), + customProperties, + provisioningState, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationJobProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationJobProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.cs new file mode 100644 index 000000000000..7f89805eccbb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobProperties.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Job model properties. + public partial class DataReplicationJobProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Job model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// is null. + internal DataReplicationJobProperties(DataReplicationJobCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + AllowedActions = new ChangeTrackingList(); + Tasks = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the friendly display name. + /// Gets or sets the job state. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// Gets or sets the affected object Id. + /// Gets or sets the affected object name. + /// Gets or sets the affected object internal Id. + /// Gets or sets the affected object internal name. + /// Gets or sets the object type. + /// Gets or sets the replication provider. + /// Gets or sets the source fabric provider. + /// Gets or sets the target fabric provider. + /// Gets or sets the list of allowed actions on the job. + /// Gets or sets the job activity id. + /// Gets or sets the list of tasks. + /// Gets or sets the list of errors. + /// + /// Job model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// Gets or sets the provisioning state of the job. + /// Keeps track of any properties unknown to the library. + internal DataReplicationJobProperties(string displayName, DataReplicationJobState? state, DateTimeOffset? startOn, DateTimeOffset? endOn, string objectId, string objectName, string objectInternalId, string objectInternalName, DataReplicationJobObjectType? objectType, string replicationProviderId, string sourceFabricProviderId, string targetFabricProviderId, IReadOnlyList allowedActions, string activityId, IReadOnlyList tasks, IReadOnlyList errors, DataReplicationJobCustomProperties customProperties, DataReplicationProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + DisplayName = displayName; + State = state; + StartOn = startOn; + EndOn = endOn; + ObjectId = objectId; + ObjectName = objectName; + ObjectInternalId = objectInternalId; + ObjectInternalName = objectInternalName; + ObjectType = objectType; + ReplicationProviderId = replicationProviderId; + SourceFabricProviderId = sourceFabricProviderId; + TargetFabricProviderId = targetFabricProviderId; + AllowedActions = allowedActions; + ActivityId = activityId; + Tasks = tasks; + Errors = errors; + CustomProperties = customProperties; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationJobProperties() + { + } + + /// Gets or sets the friendly display name. + public string DisplayName { get; } + /// Gets or sets the job state. + public DataReplicationJobState? State { get; } + /// Gets or sets the start time. + public DateTimeOffset? StartOn { get; } + /// Gets or sets the end time. + public DateTimeOffset? EndOn { get; } + /// Gets or sets the affected object Id. + public string ObjectId { get; } + /// Gets or sets the affected object name. + public string ObjectName { get; } + /// Gets or sets the affected object internal Id. + public string ObjectInternalId { get; } + /// Gets or sets the affected object internal name. + public string ObjectInternalName { get; } + /// Gets or sets the object type. + public DataReplicationJobObjectType? ObjectType { get; } + /// Gets or sets the replication provider. + public string ReplicationProviderId { get; } + /// Gets or sets the source fabric provider. + public string SourceFabricProviderId { get; } + /// Gets or sets the target fabric provider. + public string TargetFabricProviderId { get; } + /// Gets or sets the list of allowed actions on the job. + public IReadOnlyList AllowedActions { get; } + /// Gets or sets the job activity id. + public string ActivityId { get; } + /// Gets or sets the list of tasks. + public IReadOnlyList Tasks { get; } + /// Gets or sets the list of errors. + public IReadOnlyList Errors { get; } + /// + /// Job model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public DataReplicationJobCustomProperties CustomProperties { get; } + /// Gets or sets the provisioning state of the job. + public DataReplicationProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobState.cs new file mode 100644 index 000000000000..12b9e9111f4a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationJobState.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the job state. + public readonly partial struct DataReplicationJobState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationJobState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string StartedValue = "Started"; + private const string CancellingValue = "Cancelling"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CancelledValue = "Cancelled"; + private const string CompletedWithInformationValue = "CompletedWithInformation"; + private const string CompletedWithWarningsValue = "CompletedWithWarnings"; + private const string CompletedWithErrorsValue = "CompletedWithErrors"; + + /// Job has not been started. + public static DataReplicationJobState Pending { get; } = new DataReplicationJobState(PendingValue); + /// Job is in progress. + public static DataReplicationJobState Started { get; } = new DataReplicationJobState(StartedValue); + /// Job cancellation is in progress. + public static DataReplicationJobState Cancelling { get; } = new DataReplicationJobState(CancellingValue); + /// Job has completed successfully. + public static DataReplicationJobState Succeeded { get; } = new DataReplicationJobState(SucceededValue); + /// Job failed. + public static DataReplicationJobState Failed { get; } = new DataReplicationJobState(FailedValue); + /// Job has been cancelled. + public static DataReplicationJobState Cancelled { get; } = new DataReplicationJobState(CancelledValue); + /// Job has completed with information. + public static DataReplicationJobState CompletedWithInformation { get; } = new DataReplicationJobState(CompletedWithInformationValue); + /// Job has completed with warnings. + public static DataReplicationJobState CompletedWithWarnings { get; } = new DataReplicationJobState(CompletedWithWarningsValue); + /// Job has completed with errors. + public static DataReplicationJobState CompletedWithErrors { get; } = new DataReplicationJobState(CompletedWithErrorsValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationJobState left, DataReplicationJobState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationJobState left, DataReplicationJobState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationJobState(string value) => new DataReplicationJobState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationJobState other && Equals(other); + /// + public bool Equals(DataReplicationJobState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.Serialization.cs new file mode 100644 index 000000000000..81afc8ca04b0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationNameAvailabilityContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationNameAvailabilityContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationNameAvailabilityContent(document.RootElement, options); + } + + internal static DataReplicationNameAvailabilityContent DeserializeDataReplicationNameAvailabilityContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ResourceType? type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ResourceType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationNameAvailabilityContent(name, type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityContent)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationNameAvailabilityContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationNameAvailabilityContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.cs new file mode 100644 index 000000000000..987f7b7ff78e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityContent.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Check name availability model. + public partial class DataReplicationNameAvailabilityContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationNameAvailabilityContent() + { + } + + /// Initializes a new instance of . + /// Gets or sets the resource name. + /// Gets or sets the resource type. + /// Keeps track of any properties unknown to the library. + internal DataReplicationNameAvailabilityContent(string name, ResourceType? type, IDictionary serializedAdditionalRawData) + { + Name = name; + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the resource name. + public string Name { get; set; } + /// Gets or sets the resource type. + public ResourceType? Type { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.Serialization.cs new file mode 100644 index 000000000000..9c472c02a283 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationNameAvailabilityResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IsNameAvailable)) + { + writer.WritePropertyName("nameAvailable"u8); + writer.WriteBooleanValue(IsNameAvailable.Value); + } + if (Optional.IsDefined(Reason)) + { + writer.WritePropertyName("reason"u8); + writer.WriteStringValue(Reason); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationNameAvailabilityResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationNameAvailabilityResult(document.RootElement, options); + } + + internal static DataReplicationNameAvailabilityResult DeserializeDataReplicationNameAvailabilityResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? nameAvailable = default; + string reason = default; + string message = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nameAvailable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nameAvailable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("reason"u8)) + { + reason = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationNameAvailabilityResult(nameAvailable, reason, message, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityResult)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationNameAvailabilityResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationNameAvailabilityResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationNameAvailabilityResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.cs new file mode 100644 index 000000000000..450333f70f82 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationNameAvailabilityResult.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Check name availability response model. + public partial class DataReplicationNameAvailabilityResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationNameAvailabilityResult() + { + } + + /// Initializes a new instance of . + /// Gets or sets a value indicating whether resource name is available or not. + /// Gets or sets the reason for resource name unavailability. + /// Gets or sets the message for resource name unavailability. + /// Keeps track of any properties unknown to the library. + internal DataReplicationNameAvailabilityResult(bool? isNameAvailable, string reason, string message, IDictionary serializedAdditionalRawData) + { + IsNameAvailable = isNameAvailable; + Reason = reason; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets a value indicating whether resource name is available or not. + public bool? IsNameAvailable { get; } + /// Gets or sets the reason for resource name unavailability. + public string Reason { get; } + /// Gets or sets the message for resource name unavailability. + public string Message { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.Serialization.cs new file mode 100644 index 000000000000..2f64b399d319 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationPolicyCustomProperties))] + public partial class DataReplicationPolicyCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPolicyCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPolicyCustomProperties(document.RootElement, options); + } + + internal static DataReplicationPolicyCustomProperties DeserializeDataReplicationPolicyCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciPolicyCustomProperties.DeserializeHyperVToAzStackHciPolicyCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHciPolicyCustomProperties.DeserializeVMwareToAzStackHciPolicyCustomProperties(element, options); + } + } + return UnknownDataReplicationPolicyCustomProperties.DeserializeUnknownDataReplicationPolicyCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPolicyCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPolicyCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.cs new file mode 100644 index 000000000000..92a683cd1240 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Policy model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class DataReplicationPolicyCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationPolicyCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationPolicyCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPolicyCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationPolicyCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.Serialization.cs new file mode 100644 index 000000000000..84602e01dd86 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.Serialization.cs @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPolicyProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPolicyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPolicyProperties(document.RootElement, options); + } + + internal static DataReplicationPolicyProperties DeserializeDataReplicationPolicyProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProvisioningState? provisioningState = default; + DataReplicationPolicyCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationPolicyCustomProperties.DeserializeDataReplicationPolicyCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPolicyProperties(provisioningState, customProperties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPolicyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPolicyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.cs new file mode 100644 index 000000000000..8ae3477e3627 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPolicyProperties.cs @@ -0,0 +1,91 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Policy model properties. + public partial class DataReplicationPolicyProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Policy model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// is null. + public DataReplicationPolicyProperties(DataReplicationPolicyCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the policy. + /// + /// Policy model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Keeps track of any properties unknown to the library. + internal DataReplicationPolicyProperties(DataReplicationProvisioningState? provisioningState, DataReplicationPolicyCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationPolicyProperties() + { + } + + /// Gets or sets the provisioning state of the policy. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// + /// Policy model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public DataReplicationPolicyCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.Serialization.cs new file mode 100644 index 000000000000..2ca65084f3f0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.Serialization.cs @@ -0,0 +1,164 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPrivateEndpointConnectionProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(PrivateEndpoint)) + { + writer.WritePropertyName("privateEndpoint"u8); + JsonSerializer.Serialize(writer, PrivateEndpoint); + } + if (Optional.IsDefined(PrivateLinkServiceConnectionState)) + { + writer.WritePropertyName("privateLinkServiceConnectionState"u8); + writer.WriteObjectValue(PrivateLinkServiceConnectionState, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPrivateEndpointConnectionProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateEndpointConnectionProperties(document.RootElement, options); + } + + internal static DataReplicationPrivateEndpointConnectionProperties DeserializeDataReplicationPrivateEndpointConnectionProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProvisioningState? provisioningState = default; + WritableSubResource privateEndpoint = default; + DataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("privateEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateEndpoint = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("privateLinkServiceConnectionState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + privateLinkServiceConnectionState = DataReplicationPrivateLinkServiceConnectionState.DeserializeDataReplicationPrivateLinkServiceConnectionState(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateEndpointConnectionProperties(provisioningState, privateEndpoint, privateLinkServiceConnectionState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateEndpointConnectionProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateEndpointConnectionProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.cs new file mode 100644 index 000000000000..23a3d03b5407 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProperties.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents Private endpoint connection response properties. + public partial class DataReplicationPrivateEndpointConnectionProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateEndpointConnectionProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets provisioning state of the private endpoint connection. + /// Represent private Endpoint network resource that is linked to the Private Endpoint connection. + /// Represents Private link service connection state. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateEndpointConnectionProperties(DataReplicationProvisioningState? provisioningState, WritableSubResource privateEndpoint, DataReplicationPrivateLinkServiceConnectionState privateLinkServiceConnectionState, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + PrivateEndpoint = privateEndpoint; + PrivateLinkServiceConnectionState = privateLinkServiceConnectionState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets provisioning state of the private endpoint connection. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// Represent private Endpoint network resource that is linked to the Private Endpoint connection. + internal WritableSubResource PrivateEndpoint { get; set; } + /// Gets or sets Id. + public ResourceIdentifier PrivateEndpointId + { + get => PrivateEndpoint is null ? default : PrivateEndpoint.Id; + set + { + if (PrivateEndpoint is null) + PrivateEndpoint = new WritableSubResource(); + PrivateEndpoint.Id = value; + } + } + + /// Represents Private link service connection state. + public DataReplicationPrivateLinkServiceConnectionState PrivateLinkServiceConnectionState { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.Serialization.cs new file mode 100644 index 000000000000..5e82a340b6ee --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.Serialization.cs @@ -0,0 +1,148 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPrivateEndpointConnectionProxyProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (Optional.IsDefined(RemotePrivateEndpoint)) + { + writer.WritePropertyName("remotePrivateEndpoint"u8); + writer.WriteObjectValue(RemotePrivateEndpoint, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPrivateEndpointConnectionProxyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateEndpointConnectionProxyProperties(document.RootElement, options); + } + + internal static DataReplicationPrivateEndpointConnectionProxyProperties DeserializeDataReplicationPrivateEndpointConnectionProxyProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProvisioningState? provisioningState = default; + RemotePrivateEndpoint remotePrivateEndpoint = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("remotePrivateEndpoint"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remotePrivateEndpoint = RemotePrivateEndpoint.DeserializeRemotePrivateEndpoint(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateEndpointConnectionProxyProperties(provisioningState, remotePrivateEndpoint, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateEndpointConnectionProxyProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateEndpointConnectionProxyProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateEndpointConnectionProxyProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.cs new file mode 100644 index 000000000000..4eb79b1144da --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionProxyProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents private endpoint connection proxy request. + public partial class DataReplicationPrivateEndpointConnectionProxyProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateEndpointConnectionProxyProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the private endpoint connection proxy. + /// Represent remote private endpoint information for the private endpoint connection proxy. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateEndpointConnectionProxyProperties(DataReplicationProvisioningState? provisioningState, RemotePrivateEndpoint remotePrivateEndpoint, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + RemotePrivateEndpoint = remotePrivateEndpoint; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the provisioning state of the private endpoint connection proxy. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// Represent remote private endpoint information for the private endpoint connection proxy. + public RemotePrivateEndpoint RemotePrivateEndpoint { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionStatus.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionStatus.cs new file mode 100644 index 000000000000..358797b4baae --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateEndpointConnectionStatus.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the status. + public readonly partial struct DataReplicationPrivateEndpointConnectionStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationPrivateEndpointConnectionStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApprovedValue = "Approved"; + private const string DisconnectedValue = "Disconnected"; + private const string PendingValue = "Pending"; + private const string RejectedValue = "Rejected"; + + /// Approved Status. + public static DataReplicationPrivateEndpointConnectionStatus Approved { get; } = new DataReplicationPrivateEndpointConnectionStatus(ApprovedValue); + /// Disconnected Status. + public static DataReplicationPrivateEndpointConnectionStatus Disconnected { get; } = new DataReplicationPrivateEndpointConnectionStatus(DisconnectedValue); + /// Pending Status. + public static DataReplicationPrivateEndpointConnectionStatus Pending { get; } = new DataReplicationPrivateEndpointConnectionStatus(PendingValue); + /// Rejected Status. + public static DataReplicationPrivateEndpointConnectionStatus Rejected { get; } = new DataReplicationPrivateEndpointConnectionStatus(RejectedValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationPrivateEndpointConnectionStatus left, DataReplicationPrivateEndpointConnectionStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationPrivateEndpointConnectionStatus left, DataReplicationPrivateEndpointConnectionStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationPrivateEndpointConnectionStatus(string value) => new DataReplicationPrivateEndpointConnectionStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationPrivateEndpointConnectionStatus other && Equals(other); + /// + public bool Equals(DataReplicationPrivateEndpointConnectionStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.Serialization.cs new file mode 100644 index 000000000000..3209da971e17 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPrivateLinkResourceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"u8); + writer.WriteStringValue(GroupId); + } + if (Optional.IsCollectionDefined(RequiredMembers)) + { + writer.WritePropertyName("requiredMembers"u8); + writer.WriteStartArray(); + foreach (var item in RequiredMembers) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(RequiredZoneNames)) + { + writer.WritePropertyName("requiredZoneNames"u8); + writer.WriteStartArray(); + foreach (var item in RequiredZoneNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPrivateLinkResourceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateLinkResourceProperties(document.RootElement, options); + } + + internal static DataReplicationPrivateLinkResourceProperties DeserializeDataReplicationPrivateLinkResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string groupId = default; + IReadOnlyList requiredMembers = default; + IReadOnlyList requiredZoneNames = default; + DataReplicationProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("groupId"u8)) + { + groupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("requiredMembers"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredMembers = array; + continue; + } + if (property.NameEquals("requiredZoneNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + requiredZoneNames = array; + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateLinkResourceProperties(groupId, requiredMembers ?? new ChangeTrackingList(), requiredZoneNames ?? new ChangeTrackingList(), provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateLinkResourceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateLinkResourceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkResourceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.cs new file mode 100644 index 000000000000..6c9efbbf97ec --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkResourceProperties.cs @@ -0,0 +1,79 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents private link resource properties. + public partial class DataReplicationPrivateLinkResourceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationPrivateLinkResourceProperties() + { + RequiredMembers = new ChangeTrackingList(); + RequiredZoneNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets the group id. + /// Gets or sets the required member. This translates to how many Private IPs should be created for each privately linkable resource. + /// Gets or sets the private DNS zone names. + /// Gets or sets the provisioning state of the private link resource. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateLinkResourceProperties(string groupId, IReadOnlyList requiredMembers, IReadOnlyList requiredZoneNames, DataReplicationProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + GroupId = groupId; + RequiredMembers = requiredMembers; + RequiredZoneNames = requiredZoneNames; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the group id. + public string GroupId { get; } + /// Gets or sets the required member. This translates to how many Private IPs should be created for each privately linkable resource. + public IReadOnlyList RequiredMembers { get; } + /// Gets or sets the private DNS zone names. + public IReadOnlyList RequiredZoneNames { get; } + /// Gets or sets the provisioning state of the private link resource. + public DataReplicationProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.Serialization.cs new file mode 100644 index 000000000000..e972e4ddd4d3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPrivateLinkServiceConnection : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnection)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsCollectionDefined(GroupIds)) + { + writer.WritePropertyName("groupIds"u8); + writer.WriteStartArray(); + foreach (var item in GroupIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(RequestMessage)) + { + writer.WritePropertyName("requestMessage"u8); + writer.WriteStringValue(RequestMessage); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPrivateLinkServiceConnection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnection)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateLinkServiceConnection(document.RootElement, options); + } + + internal static DataReplicationPrivateLinkServiceConnection DeserializeDataReplicationPrivateLinkServiceConnection(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IList groupIds = default; + string requestMessage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("groupIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + groupIds = array; + continue; + } + if (property.NameEquals("requestMessage"u8)) + { + requestMessage = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateLinkServiceConnection(name, groupIds ?? new ChangeTrackingList(), requestMessage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnection)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateLinkServiceConnection IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateLinkServiceConnection(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnection)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.cs new file mode 100644 index 000000000000..060643fc168e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnection.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents of an NRP private link service connection. + public partial class DataReplicationPrivateLinkServiceConnection + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateLinkServiceConnection() + { + GroupIds = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets private link service connection name. + /// Gets or sets group ids. + /// Gets or sets the request message for the private link service connection. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateLinkServiceConnection(string name, IList groupIds, string requestMessage, IDictionary serializedAdditionalRawData) + { + Name = name; + GroupIds = groupIds; + RequestMessage = requestMessage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets private link service connection name. + public string Name { get; set; } + /// Gets or sets group ids. + public IList GroupIds { get; } + /// Gets or sets the request message for the private link service connection. + public string RequestMessage { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.Serialization.cs new file mode 100644 index 000000000000..913da6e04f30 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.Serialization.cs @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPrivateLinkServiceConnectionState : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnectionState)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(ActionsRequired)) + { + writer.WritePropertyName("actionsRequired"u8); + writer.WriteStringValue(ActionsRequired); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPrivateLinkServiceConnectionState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnectionState)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateLinkServiceConnectionState(document.RootElement, options); + } + + internal static DataReplicationPrivateLinkServiceConnectionState DeserializeDataReplicationPrivateLinkServiceConnectionState(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationPrivateEndpointConnectionStatus? status = default; + string description = default; + string actionsRequired = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new DataReplicationPrivateEndpointConnectionStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("actionsRequired"u8)) + { + actionsRequired = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateLinkServiceConnectionState(status, description, actionsRequired, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnectionState)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateLinkServiceConnectionState IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateLinkServiceConnectionState(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceConnectionState)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.cs new file mode 100644 index 000000000000..f8512e72711d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceConnectionState.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents Private link service connection state. + public partial class DataReplicationPrivateLinkServiceConnectionState + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateLinkServiceConnectionState() + { + } + + /// Initializes a new instance of . + /// Gets or sets the status. + /// Gets or sets description. + /// Gets or sets actions required. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateLinkServiceConnectionState(DataReplicationPrivateEndpointConnectionStatus? status, string description, string actionsRequired, IDictionary serializedAdditionalRawData) + { + Status = status; + Description = description; + ActionsRequired = actionsRequired; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the status. + public DataReplicationPrivateEndpointConnectionStatus? Status { get; set; } + /// Gets or sets description. + public string Description { get; set; } + /// Gets or sets actions required. + public string ActionsRequired { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.Serialization.cs new file mode 100644 index 000000000000..a8fcd82332c5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.Serialization.cs @@ -0,0 +1,185 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationPrivateLinkServiceProxy : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceProxy)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(RemotePrivateLinkServiceConnectionState)) + { + writer.WritePropertyName("remotePrivateLinkServiceConnectionState"u8); + writer.WriteObjectValue(RemotePrivateLinkServiceConnectionState, options); + } + if (Optional.IsDefined(RemotePrivateEndpointConnection)) + { + writer.WritePropertyName("remotePrivateEndpointConnection"u8); + JsonSerializer.Serialize(writer, RemotePrivateEndpointConnection); + } + if (Optional.IsCollectionDefined(GroupConnectivityInformation)) + { + writer.WritePropertyName("groupConnectivityInformation"u8); + writer.WriteStartArray(); + foreach (var item in GroupConnectivityInformation) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationPrivateLinkServiceProxy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceProxy)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPrivateLinkServiceProxy(document.RootElement, options); + } + + internal static DataReplicationPrivateLinkServiceProxy DeserializeDataReplicationPrivateLinkServiceProxy(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + DataReplicationPrivateLinkServiceConnectionState remotePrivateLinkServiceConnectionState = default; + WritableSubResource remotePrivateEndpointConnection = default; + IList groupConnectivityInformation = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("remotePrivateLinkServiceConnectionState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remotePrivateLinkServiceConnectionState = DataReplicationPrivateLinkServiceConnectionState.DeserializeDataReplicationPrivateLinkServiceConnectionState(property.Value, options); + continue; + } + if (property.NameEquals("remotePrivateEndpointConnection"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + remotePrivateEndpointConnection = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("groupConnectivityInformation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.GroupConnectivityInformation.DeserializeGroupConnectivityInformation(item, options)); + } + groupConnectivityInformation = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationPrivateLinkServiceProxy(id, remotePrivateLinkServiceConnectionState, remotePrivateEndpointConnection, groupConnectivityInformation ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceProxy)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPrivateLinkServiceProxy IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPrivateLinkServiceProxy(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPrivateLinkServiceProxy)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.cs new file mode 100644 index 000000000000..4acfbd31398d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationPrivateLinkServiceProxy.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents NRP private link service proxy. + public partial class DataReplicationPrivateLinkServiceProxy + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationPrivateLinkServiceProxy() + { + GroupConnectivityInformation = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets private link service proxy id. + /// Represents Private link service connection state. + /// Represent remote private endpoint connection. + /// Gets or sets group connectivity information. + /// Keeps track of any properties unknown to the library. + internal DataReplicationPrivateLinkServiceProxy(string id, DataReplicationPrivateLinkServiceConnectionState remotePrivateLinkServiceConnectionState, WritableSubResource remotePrivateEndpointConnection, IList groupConnectivityInformation, IDictionary serializedAdditionalRawData) + { + Id = id; + RemotePrivateLinkServiceConnectionState = remotePrivateLinkServiceConnectionState; + RemotePrivateEndpointConnection = remotePrivateEndpointConnection; + GroupConnectivityInformation = groupConnectivityInformation; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets private link service proxy id. + public string Id { get; set; } + /// Represents Private link service connection state. + public DataReplicationPrivateLinkServiceConnectionState RemotePrivateLinkServiceConnectionState { get; set; } + /// Represent remote private endpoint connection. + internal WritableSubResource RemotePrivateEndpointConnection { get; set; } + /// Gets or sets Id. + public ResourceIdentifier RemotePrivateEndpointConnectionId + { + get => RemotePrivateEndpointConnection is null ? default : RemotePrivateEndpointConnection.Id; + set + { + if (RemotePrivateEndpointConnection is null) + RemotePrivateEndpointConnection = new WritableSubResource(); + RemotePrivateEndpointConnection.Id = value; + } + } + + /// Gets or sets group connectivity information. + public IList GroupConnectivityInformation { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.Serialization.cs new file mode 100644 index 000000000000..38e91fa1b206 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationProtectedItemCustomProperties))] + public partial class DataReplicationProtectedItemCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationProtectedItemCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemCustomProperties(document.RootElement, options); + } + + internal static DataReplicationProtectedItemCustomProperties DeserializeDataReplicationProtectedItemCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciProtectedItemCustomProperties.DeserializeHyperVToAzStackHciProtectedItemCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHciProtectedItemCustomProperties.DeserializeVMwareToAzStackHciProtectedItemCustomProperties(element, options); + } + } + return UnknownDataReplicationProtectedItemCustomProperties.DeserializeUnknownDataReplicationProtectedItemCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.cs new file mode 100644 index 000000000000..6e873ed41dc0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Protected item model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class DataReplicationProtectedItemCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationProtectedItemCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationProtectedItemCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationProtectedItemCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..1ef1b3684955 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationProtectedItemCustomPropertiesUpdate))] + public partial class DataReplicationProtectedItemCustomPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationProtectedItemCustomPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + + internal static DataReplicationProtectedItemCustomPropertiesUpdate DeserializeDataReplicationProtectedItemCustomPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.DeserializeHyperVToAzStackHciProtectedItemCustomPropertiesUpdate(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.DeserializeVMwareToAzStackHciProtectedItemCustomPropertiesUpdate(element, options); + } + } + return UnknownDataReplicationProtectedItemCustomPropertiesUpdate.DeserializeUnknownDataReplicationProtectedItemCustomPropertiesUpdate(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemCustomPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.cs new file mode 100644 index 000000000000..fad7b9e3c898 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemCustomPropertiesUpdate.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Protected item model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class DataReplicationProtectedItemCustomPropertiesUpdate + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationProtectedItemCustomPropertiesUpdate() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomPropertiesUpdate. + /// Keeps track of any properties unknown to the library. + internal DataReplicationProtectedItemCustomPropertiesUpdate(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationProtectedItemCustomPropertiesUpdate. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.Serialization.cs new file mode 100644 index 000000000000..11bfefcd9b7b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationProtectedItemPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + DataReplicationProtectedItemPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemPatch(document.RootElement, options); + } + + internal static DataReplicationProtectedItemPatch DeserializeDataReplicationProtectedItemPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProtectedItemPropertiesUpdate properties = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationProtectedItemPropertiesUpdate.DeserializeDataReplicationProtectedItemPropertiesUpdate(property.Value, options); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationProtectedItemPatch( + id, + name, + type, + systemData, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPatch)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.cs new file mode 100644 index 000000000000..c7362444ef90 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPatch.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item model update. + public partial class DataReplicationProtectedItemPatch : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationProtectedItemPatch() + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Protected item model properties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationProtectedItemPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, DataReplicationProtectedItemPropertiesUpdate properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Protected item model properties. + internal DataReplicationProtectedItemPropertiesUpdate Properties { get; set; } + /// + /// Protected item model custom properties update. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public DataReplicationProtectedItemCustomPropertiesUpdate CustomProperties + { + get => Properties is null ? default : Properties.CustomProperties; + set + { + if (Properties is null) + Properties = new DataReplicationProtectedItemPropertiesUpdate(); + Properties.CustomProperties = value; + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.Serialization.cs new file mode 100644 index 000000000000..1b946fd5de5c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.Serialization.cs @@ -0,0 +1,538 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationProtectedItemProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("policyName"u8); + writer.WriteStringValue(PolicyName); + writer.WritePropertyName("replicationExtensionName"u8); + writer.WriteStringValue(ReplicationExtensionName); + if (options.Format != "W" && Optional.IsDefined(CorrelationId)) + { + writer.WritePropertyName("correlationId"u8); + writer.WriteStringValue(CorrelationId); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProtectionState)) + { + writer.WritePropertyName("protectionState"u8); + writer.WriteStringValue(ProtectionState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProtectionStateDescription)) + { + writer.WritePropertyName("protectionStateDescription"u8); + writer.WriteStringValue(ProtectionStateDescription); + } + if (options.Format != "W" && Optional.IsDefined(TestFailoverState)) + { + writer.WritePropertyName("testFailoverState"u8); + writer.WriteStringValue(TestFailoverState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(TestFailoverStateDescription)) + { + writer.WritePropertyName("testFailoverStateDescription"u8); + writer.WriteStringValue(TestFailoverStateDescription); + } + if (options.Format != "W" && Optional.IsDefined(ResynchronizationState)) + { + writer.WritePropertyName("resynchronizationState"u8); + writer.WriteStringValue(ResynchronizationState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(FabricObjectId)) + { + writer.WritePropertyName("fabricObjectId"u8); + writer.WriteStringValue(FabricObjectId); + } + if (options.Format != "W" && Optional.IsDefined(FabricObjectName)) + { + writer.WritePropertyName("fabricObjectName"u8); + writer.WriteStringValue(FabricObjectName); + } + if (options.Format != "W" && Optional.IsDefined(SourceFabricProviderId)) + { + writer.WritePropertyName("sourceFabricProviderId"u8); + writer.WriteStringValue(SourceFabricProviderId); + } + if (options.Format != "W" && Optional.IsDefined(TargetFabricProviderId)) + { + writer.WritePropertyName("targetFabricProviderId"u8); + writer.WriteStringValue(TargetFabricProviderId); + } + if (options.Format != "W" && Optional.IsDefined(FabricId)) + { + writer.WritePropertyName("fabricId"u8); + writer.WriteStringValue(FabricId); + } + if (options.Format != "W" && Optional.IsDefined(TargetFabricId)) + { + writer.WritePropertyName("targetFabricId"u8); + writer.WriteStringValue(TargetFabricId); + } + if (options.Format != "W" && Optional.IsDefined(FabricAgentId)) + { + writer.WritePropertyName("fabricAgentId"u8); + writer.WriteStringValue(FabricAgentId); + } + if (options.Format != "W" && Optional.IsDefined(TargetFabricAgentId)) + { + writer.WritePropertyName("targetFabricAgentId"u8); + writer.WriteStringValue(TargetFabricAgentId); + } + if (options.Format != "W" && Optional.IsDefined(IsResyncRequired)) + { + writer.WritePropertyName("resyncRequired"u8); + writer.WriteBooleanValue(IsResyncRequired.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastSuccessfulPlannedFailoverOn)) + { + writer.WritePropertyName("lastSuccessfulPlannedFailoverTime"u8); + writer.WriteStringValue(LastSuccessfulPlannedFailoverOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastSuccessfulUnplannedFailoverOn)) + { + writer.WritePropertyName("lastSuccessfulUnplannedFailoverTime"u8); + writer.WriteStringValue(LastSuccessfulUnplannedFailoverOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastSuccessfulTestFailoverOn)) + { + writer.WritePropertyName("lastSuccessfulTestFailoverTime"u8); + writer.WriteStringValue(LastSuccessfulTestFailoverOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(CurrentJob)) + { + writer.WritePropertyName("currentJob"u8); + writer.WriteObjectValue(CurrentJob, options); + } + if (options.Format != "W" && Optional.IsCollectionDefined(AllowedJobs)) + { + writer.WritePropertyName("allowedJobs"u8); + writer.WriteStartArray(); + foreach (var item in AllowedJobs) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(LastFailedEnableProtectionJob)) + { + writer.WritePropertyName("lastFailedEnableProtectionJob"u8); + writer.WriteObjectValue(LastFailedEnableProtectionJob, options); + } + if (options.Format != "W" && Optional.IsDefined(LastFailedPlannedFailoverJob)) + { + writer.WritePropertyName("lastFailedPlannedFailoverJob"u8); + writer.WriteObjectValue(LastFailedPlannedFailoverJob, options); + } + if (options.Format != "W" && Optional.IsDefined(LastTestFailoverJob)) + { + writer.WritePropertyName("lastTestFailoverJob"u8); + writer.WriteObjectValue(LastTestFailoverJob, options); + } + if (options.Format != "W" && Optional.IsDefined(ReplicationHealth)) + { + writer.WritePropertyName("replicationHealth"u8); + writer.WriteStringValue(ReplicationHealth.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(HealthErrors)) + { + writer.WritePropertyName("healthErrors"u8); + writer.WriteStartArray(); + foreach (var item in HealthErrors) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationProtectedItemProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemProperties(document.RootElement, options); + } + + internal static DataReplicationProtectedItemProperties DeserializeDataReplicationProtectedItemProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string policyName = default; + string replicationExtensionName = default; + string correlationId = default; + DataReplicationProvisioningState? provisioningState = default; + DataReplicationProtectionState? protectionState = default; + string protectionStateDescription = default; + DataReplicationTestFailoverState? testFailoverState = default; + string testFailoverStateDescription = default; + DataReplicationResynchronizationState? resynchronizationState = default; + string fabricObjectId = default; + string fabricObjectName = default; + string sourceFabricProviderId = default; + string targetFabricProviderId = default; + string fabricId = default; + string targetFabricId = default; + string fabricAgentId = default; + string targetFabricAgentId = default; + bool? resyncRequired = default; + DateTimeOffset? lastSuccessfulPlannedFailoverTime = default; + DateTimeOffset? lastSuccessfulUnplannedFailoverTime = default; + DateTimeOffset? lastSuccessfulTestFailoverTime = default; + ProtectedItemJobProperties currentJob = default; + IReadOnlyList allowedJobs = default; + ProtectedItemJobProperties lastFailedEnableProtectionJob = default; + ProtectedItemJobProperties lastFailedPlannedFailoverJob = default; + ProtectedItemJobProperties lastTestFailoverJob = default; + DataReplicationHealthStatus? replicationHealth = default; + IReadOnlyList healthErrors = default; + DataReplicationProtectedItemCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("policyName"u8)) + { + policyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("replicationExtensionName"u8)) + { + replicationExtensionName = property.Value.GetString(); + continue; + } + if (property.NameEquals("correlationId"u8)) + { + correlationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("protectionState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + protectionState = new DataReplicationProtectionState(property.Value.GetString()); + continue; + } + if (property.NameEquals("protectionStateDescription"u8)) + { + protectionStateDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("testFailoverState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + testFailoverState = new DataReplicationTestFailoverState(property.Value.GetString()); + continue; + } + if (property.NameEquals("testFailoverStateDescription"u8)) + { + testFailoverStateDescription = property.Value.GetString(); + continue; + } + if (property.NameEquals("resynchronizationState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resynchronizationState = new DataReplicationResynchronizationState(property.Value.GetString()); + continue; + } + if (property.NameEquals("fabricObjectId"u8)) + { + fabricObjectId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricObjectName"u8)) + { + fabricObjectName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceFabricProviderId"u8)) + { + sourceFabricProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricProviderId"u8)) + { + targetFabricProviderId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricId"u8)) + { + fabricId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricId"u8)) + { + targetFabricId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricAgentId"u8)) + { + fabricAgentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricAgentId"u8)) + { + targetFabricAgentId = property.Value.GetString(); + continue; + } + if (property.NameEquals("resyncRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("lastSuccessfulPlannedFailoverTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSuccessfulPlannedFailoverTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSuccessfulUnplannedFailoverTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSuccessfulUnplannedFailoverTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastSuccessfulTestFailoverTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastSuccessfulTestFailoverTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("currentJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + currentJob = ProtectedItemJobProperties.DeserializeProtectedItemJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("allowedJobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + allowedJobs = array; + continue; + } + if (property.NameEquals("lastFailedEnableProtectionJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastFailedEnableProtectionJob = ProtectedItemJobProperties.DeserializeProtectedItemJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("lastFailedPlannedFailoverJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastFailedPlannedFailoverJob = ProtectedItemJobProperties.DeserializeProtectedItemJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("lastTestFailoverJob"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastTestFailoverJob = ProtectedItemJobProperties.DeserializeProtectedItemJobProperties(property.Value, options); + continue; + } + if (property.NameEquals("replicationHealth"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + replicationHealth = new DataReplicationHealthStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("healthErrors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationHealthErrorInfo.DeserializeDataReplicationHealthErrorInfo(item, options)); + } + healthErrors = array; + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationProtectedItemCustomProperties.DeserializeDataReplicationProtectedItemCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationProtectedItemProperties( + policyName, + replicationExtensionName, + correlationId, + provisioningState, + protectionState, + protectionStateDescription, + testFailoverState, + testFailoverStateDescription, + resynchronizationState, + fabricObjectId, + fabricObjectName, + sourceFabricProviderId, + targetFabricProviderId, + fabricId, + targetFabricId, + fabricAgentId, + targetFabricAgentId, + resyncRequired, + lastSuccessfulPlannedFailoverTime, + lastSuccessfulUnplannedFailoverTime, + lastSuccessfulTestFailoverTime, + currentJob, + allowedJobs ?? new ChangeTrackingList(), + lastFailedEnableProtectionJob, + lastFailedPlannedFailoverJob, + lastTestFailoverJob, + replicationHealth, + healthErrors ?? new ChangeTrackingList(), + customProperties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.cs new file mode 100644 index 000000000000..552a140003f6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemProperties.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item model properties. + public partial class DataReplicationProtectedItemProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the policy name. + /// Gets or sets the replication extension name. + /// + /// Protected item model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// , or is null. + public DataReplicationProtectedItemProperties(string policyName, string replicationExtensionName, DataReplicationProtectedItemCustomProperties customProperties) + { + Argument.AssertNotNull(policyName, nameof(policyName)); + Argument.AssertNotNull(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + PolicyName = policyName; + ReplicationExtensionName = replicationExtensionName; + AllowedJobs = new ChangeTrackingList(); + HealthErrors = new ChangeTrackingList(); + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the policy name. + /// Gets or sets the replication extension name. + /// Gets or sets the protected item correlation Id. + /// Gets or sets the provisioning state of the fabric agent. + /// Gets or sets the protection state. + /// Gets or sets the protection state description. + /// Gets or sets the test failover state. + /// Gets or sets the Test failover state description. + /// Gets or sets the resynchronization state. + /// Gets or sets the fabric object Id. + /// Gets or sets the fabric object name. + /// Gets or sets the source fabric provider Id. + /// Gets or sets the target fabric provider Id. + /// Gets or sets the fabric Id. + /// Gets or sets the target fabric Id. + /// Gets or sets the fabric agent Id. + /// Gets or sets the target fabric agent Id. + /// Gets or sets a value indicating whether resynchronization is required or not. + /// Gets or sets the Last successful planned failover time. + /// Gets or sets the Last successful unplanned failover time. + /// Gets or sets the Last successful test failover time. + /// Gets or sets the current scenario. + /// Gets or sets the allowed scenarios on the protected item. + /// Gets or sets the last failed enabled protection job. + /// Gets or sets the last failed planned failover job. + /// Gets or sets the last test failover job. + /// Gets or sets protected item replication health. + /// Gets or sets the list of health errors. + /// + /// Protected item model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Keeps track of any properties unknown to the library. + internal DataReplicationProtectedItemProperties(string policyName, string replicationExtensionName, string correlationId, DataReplicationProvisioningState? provisioningState, DataReplicationProtectionState? protectionState, string protectionStateDescription, DataReplicationTestFailoverState? testFailoverState, string testFailoverStateDescription, DataReplicationResynchronizationState? resynchronizationState, string fabricObjectId, string fabricObjectName, string sourceFabricProviderId, string targetFabricProviderId, string fabricId, string targetFabricId, string fabricAgentId, string targetFabricAgentId, bool? isResyncRequired, DateTimeOffset? lastSuccessfulPlannedFailoverOn, DateTimeOffset? lastSuccessfulUnplannedFailoverOn, DateTimeOffset? lastSuccessfulTestFailoverOn, ProtectedItemJobProperties currentJob, IReadOnlyList allowedJobs, ProtectedItemJobProperties lastFailedEnableProtectionJob, ProtectedItemJobProperties lastFailedPlannedFailoverJob, ProtectedItemJobProperties lastTestFailoverJob, DataReplicationHealthStatus? replicationHealth, IReadOnlyList healthErrors, DataReplicationProtectedItemCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + PolicyName = policyName; + ReplicationExtensionName = replicationExtensionName; + CorrelationId = correlationId; + ProvisioningState = provisioningState; + ProtectionState = protectionState; + ProtectionStateDescription = protectionStateDescription; + TestFailoverState = testFailoverState; + TestFailoverStateDescription = testFailoverStateDescription; + ResynchronizationState = resynchronizationState; + FabricObjectId = fabricObjectId; + FabricObjectName = fabricObjectName; + SourceFabricProviderId = sourceFabricProviderId; + TargetFabricProviderId = targetFabricProviderId; + FabricId = fabricId; + TargetFabricId = targetFabricId; + FabricAgentId = fabricAgentId; + TargetFabricAgentId = targetFabricAgentId; + IsResyncRequired = isResyncRequired; + LastSuccessfulPlannedFailoverOn = lastSuccessfulPlannedFailoverOn; + LastSuccessfulUnplannedFailoverOn = lastSuccessfulUnplannedFailoverOn; + LastSuccessfulTestFailoverOn = lastSuccessfulTestFailoverOn; + CurrentJob = currentJob; + AllowedJobs = allowedJobs; + LastFailedEnableProtectionJob = lastFailedEnableProtectionJob; + LastFailedPlannedFailoverJob = lastFailedPlannedFailoverJob; + LastTestFailoverJob = lastTestFailoverJob; + ReplicationHealth = replicationHealth; + HealthErrors = healthErrors; + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationProtectedItemProperties() + { + } + + /// Gets or sets the policy name. + public string PolicyName { get; set; } + /// Gets or sets the replication extension name. + public string ReplicationExtensionName { get; set; } + /// Gets or sets the protected item correlation Id. + public string CorrelationId { get; } + /// Gets or sets the provisioning state of the fabric agent. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// Gets or sets the protection state. + public DataReplicationProtectionState? ProtectionState { get; } + /// Gets or sets the protection state description. + public string ProtectionStateDescription { get; } + /// Gets or sets the test failover state. + public DataReplicationTestFailoverState? TestFailoverState { get; } + /// Gets or sets the Test failover state description. + public string TestFailoverStateDescription { get; } + /// Gets or sets the resynchronization state. + public DataReplicationResynchronizationState? ResynchronizationState { get; } + /// Gets or sets the fabric object Id. + public string FabricObjectId { get; } + /// Gets or sets the fabric object name. + public string FabricObjectName { get; } + /// Gets or sets the source fabric provider Id. + public string SourceFabricProviderId { get; } + /// Gets or sets the target fabric provider Id. + public string TargetFabricProviderId { get; } + /// Gets or sets the fabric Id. + public string FabricId { get; } + /// Gets or sets the target fabric Id. + public string TargetFabricId { get; } + /// Gets or sets the fabric agent Id. + public string FabricAgentId { get; } + /// Gets or sets the target fabric agent Id. + public string TargetFabricAgentId { get; } + /// Gets or sets a value indicating whether resynchronization is required or not. + public bool? IsResyncRequired { get; } + /// Gets or sets the Last successful planned failover time. + public DateTimeOffset? LastSuccessfulPlannedFailoverOn { get; } + /// Gets or sets the Last successful unplanned failover time. + public DateTimeOffset? LastSuccessfulUnplannedFailoverOn { get; } + /// Gets or sets the Last successful test failover time. + public DateTimeOffset? LastSuccessfulTestFailoverOn { get; } + /// Gets or sets the current scenario. + public ProtectedItemJobProperties CurrentJob { get; } + /// Gets or sets the allowed scenarios on the protected item. + public IReadOnlyList AllowedJobs { get; } + /// Gets or sets the last failed enabled protection job. + public ProtectedItemJobProperties LastFailedEnableProtectionJob { get; } + /// Gets or sets the last failed planned failover job. + public ProtectedItemJobProperties LastFailedPlannedFailoverJob { get; } + /// Gets or sets the last test failover job. + public ProtectedItemJobProperties LastTestFailoverJob { get; } + /// Gets or sets protected item replication health. + public DataReplicationHealthStatus? ReplicationHealth { get; } + /// Gets or sets the list of health errors. + public IReadOnlyList HealthErrors { get; } + /// + /// Protected item model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public DataReplicationProtectedItemCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..2b3f416b0ae5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.Serialization.cs @@ -0,0 +1,133 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class DataReplicationProtectedItemPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPropertiesUpdate)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(CustomProperties)) + { + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationProtectedItemPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemPropertiesUpdate(document.RootElement, options); + } + + internal static DataReplicationProtectedItemPropertiesUpdate DeserializeDataReplicationProtectedItemPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProtectedItemCustomPropertiesUpdate customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customProperties = DataReplicationProtectedItemCustomPropertiesUpdate.DeserializeDataReplicationProtectedItemCustomPropertiesUpdate(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationProtectedItemPropertiesUpdate(customProperties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.cs new file mode 100644 index 000000000000..f46e3bb1980e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectedItemPropertiesUpdate.cs @@ -0,0 +1,73 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item model properties update. + internal partial class DataReplicationProtectedItemPropertiesUpdate + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationProtectedItemPropertiesUpdate() + { + } + + /// Initializes a new instance of . + /// + /// Protected item model custom properties update. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Keeps track of any properties unknown to the library. + internal DataReplicationProtectedItemPropertiesUpdate(DataReplicationProtectedItemCustomPropertiesUpdate customProperties, IDictionary serializedAdditionalRawData) + { + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// Protected item model custom properties update. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public DataReplicationProtectedItemCustomPropertiesUpdate CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectionState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectionState.cs new file mode 100644 index 000000000000..2d32abae86c6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProtectionState.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the protection state. + public readonly partial struct DataReplicationProtectionState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationProtectionState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnprotectedStatesBeginValue = "UnprotectedStatesBegin"; + private const string EnablingProtectionValue = "EnablingProtection"; + private const string EnablingFailedValue = "EnablingFailed"; + private const string DisablingProtectionValue = "DisablingProtection"; + private const string MarkedForDeletionValue = "MarkedForDeletion"; + private const string DisablingFailedValue = "DisablingFailed"; + private const string UnprotectedStatesEndValue = "UnprotectedStatesEnd"; + private const string InitialReplicationStatesBeginValue = "InitialReplicationStatesBegin"; + private const string InitialReplicationInProgressValue = "InitialReplicationInProgress"; + private const string InitialReplicationCompletedOnPrimaryValue = "InitialReplicationCompletedOnPrimary"; + private const string InitialReplicationCompletedOnRecoveryValue = "InitialReplicationCompletedOnRecovery"; + private const string InitialReplicationFailedValue = "InitialReplicationFailed"; + private const string InitialReplicationStatesEndValue = "InitialReplicationStatesEnd"; + private const string ProtectedStatesBeginValue = "ProtectedStatesBegin"; + private const string ProtectedValue = "Protected"; + private const string ProtectedStatesEndValue = "ProtectedStatesEnd"; + private const string PlannedFailoverTransitionStatesBeginValue = "PlannedFailoverTransitionStatesBegin"; + private const string PlannedFailoverInitiatedValue = "PlannedFailoverInitiated"; + private const string PlannedFailoverCompletingValue = "PlannedFailoverCompleting"; + private const string PlannedFailoverCompletedValue = "PlannedFailoverCompleted"; + private const string PlannedFailoverFailedValue = "PlannedFailoverFailed"; + private const string PlannedFailoverCompletionFailedValue = "PlannedFailoverCompletionFailed"; + private const string PlannedFailoverTransitionStatesEndValue = "PlannedFailoverTransitionStatesEnd"; + private const string UnplannedFailoverTransitionStatesBeginValue = "UnplannedFailoverTransitionStatesBegin"; + private const string UnplannedFailoverInitiatedValue = "UnplannedFailoverInitiated"; + private const string UnplannedFailoverCompletingValue = "UnplannedFailoverCompleting"; + private const string UnplannedFailoverCompletedValue = "UnplannedFailoverCompleted"; + private const string UnplannedFailoverFailedValue = "UnplannedFailoverFailed"; + private const string UnplannedFailoverCompletionFailedValue = "UnplannedFailoverCompletionFailed"; + private const string UnplannedFailoverTransitionStatesEndValue = "UnplannedFailoverTransitionStatesEnd"; + private const string CommitFailoverStatesBeginValue = "CommitFailoverStatesBegin"; + private const string CommitFailoverInProgressOnPrimaryValue = "CommitFailoverInProgressOnPrimary"; + private const string CommitFailoverInProgressOnRecoveryValue = "CommitFailoverInProgressOnRecovery"; + private const string CommitFailoverCompletedValue = "CommitFailoverCompleted"; + private const string CommitFailoverFailedOnPrimaryValue = "CommitFailoverFailedOnPrimary"; + private const string CommitFailoverFailedOnRecoveryValue = "CommitFailoverFailedOnRecovery"; + private const string CommitFailoverStatesEndValue = "CommitFailoverStatesEnd"; + private const string CancelFailoverStatesBeginValue = "CancelFailoverStatesBegin"; + private const string CancelFailoverInProgressOnPrimaryValue = "CancelFailoverInProgressOnPrimary"; + private const string CancelFailoverInProgressOnRecoveryValue = "CancelFailoverInProgressOnRecovery"; + private const string CancelFailoverFailedOnPrimaryValue = "CancelFailoverFailedOnPrimary"; + private const string CancelFailoverFailedOnRecoveryValue = "CancelFailoverFailedOnRecovery"; + private const string CancelFailoverStatesEndValue = "CancelFailoverStatesEnd"; + private const string ChangeRecoveryPointStatesBeginValue = "ChangeRecoveryPointStatesBegin"; + private const string ChangeRecoveryPointInitiatedValue = "ChangeRecoveryPointInitiated"; + private const string ChangeRecoveryPointCompletedValue = "ChangeRecoveryPointCompleted"; + private const string ChangeRecoveryPointFailedValue = "ChangeRecoveryPointFailed"; + private const string ChangeRecoveryPointStatesEndValue = "ChangeRecoveryPointStatesEnd"; + private const string ReprotectStatesBeginValue = "ReprotectStatesBegin"; + private const string ReprotectInitiatedValue = "ReprotectInitiated"; + private const string ReprotectFailedValue = "ReprotectFailed"; + private const string ReprotectStatesEndValue = "ReprotectStatesEnd"; + + /// Begin marker for unprotected states. + public static DataReplicationProtectionState UnprotectedStatesBegin { get; } = new DataReplicationProtectionState(UnprotectedStatesBeginValue); + /// Enable protection is in progress. + public static DataReplicationProtectionState EnablingProtection { get; } = new DataReplicationProtectionState(EnablingProtectionValue); + /// Enable protection failed. + public static DataReplicationProtectionState EnablingFailed { get; } = new DataReplicationProtectionState(EnablingFailedValue); + /// Disabling protection is in progress. + public static DataReplicationProtectionState DisablingProtection { get; } = new DataReplicationProtectionState(DisablingProtectionValue); + /// Disabling protection succeeded. This is a transient state before the protected item is deleted. + public static DataReplicationProtectionState MarkedForDeletion { get; } = new DataReplicationProtectionState(MarkedForDeletionValue); + /// Disable protection failed. + public static DataReplicationProtectionState DisablingFailed { get; } = new DataReplicationProtectionState(DisablingFailedValue); + /// End marker for unprotected states. + public static DataReplicationProtectionState UnprotectedStatesEnd { get; } = new DataReplicationProtectionState(UnprotectedStatesEndValue); + /// Begin marker for initial replication states. + public static DataReplicationProtectionState InitialReplicationStatesBegin { get; } = new DataReplicationProtectionState(InitialReplicationStatesBeginValue); + /// Initial replication is in progress. + public static DataReplicationProtectionState InitialReplicationInProgress { get; } = new DataReplicationProtectionState(InitialReplicationInProgressValue); + /// Initial replication has completed on the primary side. + public static DataReplicationProtectionState InitialReplicationCompletedOnPrimary { get; } = new DataReplicationProtectionState(InitialReplicationCompletedOnPrimaryValue); + /// Initial replication has completed on the recovery side. + public static DataReplicationProtectionState InitialReplicationCompletedOnRecovery { get; } = new DataReplicationProtectionState(InitialReplicationCompletedOnRecoveryValue); + /// Initial replication failed and would need to be started again. + public static DataReplicationProtectionState InitialReplicationFailed { get; } = new DataReplicationProtectionState(InitialReplicationFailedValue); + /// End marker for initial replication states. + public static DataReplicationProtectionState InitialReplicationStatesEnd { get; } = new DataReplicationProtectionState(InitialReplicationStatesEndValue); + /// Begin marker for protected steady-state states. + public static DataReplicationProtectionState ProtectedStatesBegin { get; } = new DataReplicationProtectionState(ProtectedStatesBeginValue); + /// Protected item is protected and replication is on-going. Any issues with replication will be surfaced separately via the health property and will not affect the state. + public static DataReplicationProtectionState Protected { get; } = new DataReplicationProtectionState(ProtectedValue); + /// End marker for protected steady-state states. + public static DataReplicationProtectionState ProtectedStatesEnd { get; } = new DataReplicationProtectionState(ProtectedStatesEndValue); + /// Begin marker for planned failover transition states. + public static DataReplicationProtectionState PlannedFailoverTransitionStatesBegin { get; } = new DataReplicationProtectionState(PlannedFailoverTransitionStatesBeginValue); + /// Planned failover has been initiated. + public static DataReplicationProtectionState PlannedFailoverInitiated { get; } = new DataReplicationProtectionState(PlannedFailoverInitiatedValue); + /// Planned failover preparing protected entities is in progress. + public static DataReplicationProtectionState PlannedFailoverCompleting { get; } = new DataReplicationProtectionState(PlannedFailoverCompletingValue); + /// Planned failover has been completed successfully. + public static DataReplicationProtectionState PlannedFailoverCompleted { get; } = new DataReplicationProtectionState(PlannedFailoverCompletedValue); + /// Planned failover initiation failed. + public static DataReplicationProtectionState PlannedFailoverFailed { get; } = new DataReplicationProtectionState(PlannedFailoverFailedValue); + /// Planned failover preparing protected entities failed. + public static DataReplicationProtectionState PlannedFailoverCompletionFailed { get; } = new DataReplicationProtectionState(PlannedFailoverCompletionFailedValue); + /// End marker for planned failover transition states. + public static DataReplicationProtectionState PlannedFailoverTransitionStatesEnd { get; } = new DataReplicationProtectionState(PlannedFailoverTransitionStatesEndValue); + /// Begin marker for unplanned failover transition states. + public static DataReplicationProtectionState UnplannedFailoverTransitionStatesBegin { get; } = new DataReplicationProtectionState(UnplannedFailoverTransitionStatesBeginValue); + /// Unplanned failover has been initiated. + public static DataReplicationProtectionState UnplannedFailoverInitiated { get; } = new DataReplicationProtectionState(UnplannedFailoverInitiatedValue); + /// Unplanned failover preparing protected entities is in progress. + public static DataReplicationProtectionState UnplannedFailoverCompleting { get; } = new DataReplicationProtectionState(UnplannedFailoverCompletingValue); + /// Unplanned failover preparing protected entities is in progress. + public static DataReplicationProtectionState UnplannedFailoverCompleted { get; } = new DataReplicationProtectionState(UnplannedFailoverCompletedValue); + /// Unplanned failover initiation failed. + public static DataReplicationProtectionState UnplannedFailoverFailed { get; } = new DataReplicationProtectionState(UnplannedFailoverFailedValue); + /// Unplanned failover preparing protected entities failed. + public static DataReplicationProtectionState UnplannedFailoverCompletionFailed { get; } = new DataReplicationProtectionState(UnplannedFailoverCompletionFailedValue); + /// End marker for unplanned failover transition states. + public static DataReplicationProtectionState UnplannedFailoverTransitionStatesEnd { get; } = new DataReplicationProtectionState(UnplannedFailoverTransitionStatesEndValue); + /// Begin marker for commit failover states. + public static DataReplicationProtectionState CommitFailoverStatesBegin { get; } = new DataReplicationProtectionState(CommitFailoverStatesBeginValue); + /// Commit failover is in progress on the primary side. + public static DataReplicationProtectionState CommitFailoverInProgressOnPrimary { get; } = new DataReplicationProtectionState(CommitFailoverInProgressOnPrimaryValue); + /// Commit failover is in progress on the recovery side. + public static DataReplicationProtectionState CommitFailoverInProgressOnRecovery { get; } = new DataReplicationProtectionState(CommitFailoverInProgressOnRecoveryValue); + /// Commit failover has been completed successfully. + public static DataReplicationProtectionState CommitFailoverCompleted { get; } = new DataReplicationProtectionState(CommitFailoverCompletedValue); + /// Commit failover failed on the primary side. + public static DataReplicationProtectionState CommitFailoverFailedOnPrimary { get; } = new DataReplicationProtectionState(CommitFailoverFailedOnPrimaryValue); + /// Commit failover failed on the recovery side. + public static DataReplicationProtectionState CommitFailoverFailedOnRecovery { get; } = new DataReplicationProtectionState(CommitFailoverFailedOnRecoveryValue); + /// End marker for commit failover states. + public static DataReplicationProtectionState CommitFailoverStatesEnd { get; } = new DataReplicationProtectionState(CommitFailoverStatesEndValue); + /// Begin marker for cancel failover states. + public static DataReplicationProtectionState CancelFailoverStatesBegin { get; } = new DataReplicationProtectionState(CancelFailoverStatesBeginValue); + /// Cancel failover is in progress on the primary side. + public static DataReplicationProtectionState CancelFailoverInProgressOnPrimary { get; } = new DataReplicationProtectionState(CancelFailoverInProgressOnPrimaryValue); + /// Cancel failover is in progress on the recovery side. + public static DataReplicationProtectionState CancelFailoverInProgressOnRecovery { get; } = new DataReplicationProtectionState(CancelFailoverInProgressOnRecoveryValue); + /// Cancel failover failed on the primary side. + public static DataReplicationProtectionState CancelFailoverFailedOnPrimary { get; } = new DataReplicationProtectionState(CancelFailoverFailedOnPrimaryValue); + /// Cancel failover failed on the recovery side. + public static DataReplicationProtectionState CancelFailoverFailedOnRecovery { get; } = new DataReplicationProtectionState(CancelFailoverFailedOnRecoveryValue); + /// End marker for cancel failover states. + public static DataReplicationProtectionState CancelFailoverStatesEnd { get; } = new DataReplicationProtectionState(CancelFailoverStatesEndValue); + /// Begin marker for change recovery point states. + public static DataReplicationProtectionState ChangeRecoveryPointStatesBegin { get; } = new DataReplicationProtectionState(ChangeRecoveryPointStatesBeginValue); + /// Change recovery point has been initiated.. + public static DataReplicationProtectionState ChangeRecoveryPointInitiated { get; } = new DataReplicationProtectionState(ChangeRecoveryPointInitiatedValue); + /// Change recovery point has been completed successfully. + public static DataReplicationProtectionState ChangeRecoveryPointCompleted { get; } = new DataReplicationProtectionState(ChangeRecoveryPointCompletedValue); + /// Change recovery point has failed. + public static DataReplicationProtectionState ChangeRecoveryPointFailed { get; } = new DataReplicationProtectionState(ChangeRecoveryPointFailedValue); + /// End marker for change recovery point states. + public static DataReplicationProtectionState ChangeRecoveryPointStatesEnd { get; } = new DataReplicationProtectionState(ChangeRecoveryPointStatesEndValue); + /// Begin marker for reprotect states. + public static DataReplicationProtectionState ReprotectStatesBegin { get; } = new DataReplicationProtectionState(ReprotectStatesBeginValue); + /// Reprotect has been initiated. + public static DataReplicationProtectionState ReprotectInitiated { get; } = new DataReplicationProtectionState(ReprotectInitiatedValue); + /// Reprotect has failed. + public static DataReplicationProtectionState ReprotectFailed { get; } = new DataReplicationProtectionState(ReprotectFailedValue); + /// End marker for reprotect states. + public static DataReplicationProtectionState ReprotectStatesEnd { get; } = new DataReplicationProtectionState(ReprotectStatesEndValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationProtectionState left, DataReplicationProtectionState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationProtectionState left, DataReplicationProtectionState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationProtectionState(string value) => new DataReplicationProtectionState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationProtectionState other && Equals(other); + /// + public bool Equals(DataReplicationProtectionState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProvisioningState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProvisioningState.cs new file mode 100644 index 000000000000..4dd9ab51a4b7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationProvisioningState.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the provisioning state of the email configuration. + public readonly partial struct DataReplicationProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CanceledValue = "Canceled"; + private const string CreatingValue = "Creating"; + private const string DeletingValue = "Deleting"; + private const string DeletedValue = "Deleted"; + private const string FailedValue = "Failed"; + private const string SucceededValue = "Succeeded"; + private const string UpdatingValue = "Updating"; + + /// Resource creation has been canceled. + public static DataReplicationProvisioningState Canceled { get; } = new DataReplicationProvisioningState(CanceledValue); + /// Resource is being created. + public static DataReplicationProvisioningState Creating { get; } = new DataReplicationProvisioningState(CreatingValue); + /// Resource is being deleted. + public static DataReplicationProvisioningState Deleting { get; } = new DataReplicationProvisioningState(DeletingValue); + /// Resource has been deleted. + public static DataReplicationProvisioningState Deleted { get; } = new DataReplicationProvisioningState(DeletedValue); + /// Resource creation failed. + public static DataReplicationProvisioningState Failed { get; } = new DataReplicationProvisioningState(FailedValue); + /// Resource creation/update succeeded. + public static DataReplicationProvisioningState Succeeded { get; } = new DataReplicationProvisioningState(SucceededValue); + /// Resource is being updated. + public static DataReplicationProvisioningState Updating { get; } = new DataReplicationProvisioningState(UpdatingValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationProvisioningState left, DataReplicationProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationProvisioningState left, DataReplicationProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationProvisioningState(string value) => new DataReplicationProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationProvisioningState other && Equals(other); + /// + public bool Equals(DataReplicationProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.Serialization.cs new file mode 100644 index 000000000000..aa6ef37140a7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownDataReplicationRecoveryPointCustomProperties))] + public partial class DataReplicationRecoveryPointCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationRecoveryPointCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationRecoveryPointCustomProperties(document.RootElement, options); + } + + internal static DataReplicationRecoveryPointCustomProperties DeserializeDataReplicationRecoveryPointCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciRecoveryPointCustomProperties.DeserializeHyperVToAzStackHciRecoveryPointCustomProperties(element, options); + case "VMwareToAzStackHCIRecoveryPointModelCustomProperties": return VMwareToAzStackHciRecoveryPointCustomProperties.DeserializeVMwareToAzStackHciRecoveryPointCustomProperties(element, options); + } + } + return UnknownDataReplicationRecoveryPointCustomProperties.DeserializeUnknownDataReplicationRecoveryPointCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationRecoveryPointCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationRecoveryPointCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.cs new file mode 100644 index 000000000000..d04425d9e08f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Recovery point model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class DataReplicationRecoveryPointCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected DataReplicationRecoveryPointCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationRecoveryPointCustomProperties. + /// Keeps track of any properties unknown to the library. + internal DataReplicationRecoveryPointCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for DataReplicationRecoveryPointCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.Serialization.cs new file mode 100644 index 000000000000..4cc5aabade1f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.Serialization.cs @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationRecoveryPointProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("recoveryPointTime"u8); + writer.WriteStringValue(RecoveryPointOn, "O"); + writer.WritePropertyName("recoveryPointType"u8); + writer.WriteStringValue(RecoveryPointType.ToString()); + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationRecoveryPointProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationRecoveryPointProperties(document.RootElement, options); + } + + internal static DataReplicationRecoveryPointProperties DeserializeDataReplicationRecoveryPointProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset recoveryPointTime = default; + DataReplicationRecoveryPointType recoveryPointType = default; + DataReplicationRecoveryPointCustomProperties customProperties = default; + DataReplicationProvisioningState? provisioningState = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recoveryPointTime"u8)) + { + recoveryPointTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("recoveryPointType"u8)) + { + recoveryPointType = new DataReplicationRecoveryPointType(property.Value.GetString()); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + customProperties = DataReplicationRecoveryPointCustomProperties.DeserializeDataReplicationRecoveryPointCustomProperties(property.Value, options); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationRecoveryPointProperties(recoveryPointTime, recoveryPointType, customProperties, provisioningState, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationRecoveryPointProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationRecoveryPointProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.cs new file mode 100644 index 000000000000..2e6b0d219eba --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointProperties.cs @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Recovery point model properties. + public partial class DataReplicationRecoveryPointProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the recovery point time. + /// Gets or sets the recovery point type. + /// + /// Recovery point model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// is null. + internal DataReplicationRecoveryPointProperties(DateTimeOffset recoveryPointOn, DataReplicationRecoveryPointType recoveryPointType, DataReplicationRecoveryPointCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + RecoveryPointOn = recoveryPointOn; + RecoveryPointType = recoveryPointType; + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// Gets or sets the recovery point time. + /// Gets or sets the recovery point type. + /// + /// Recovery point model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Gets or sets the provisioning state of the recovery point item. + /// Keeps track of any properties unknown to the library. + internal DataReplicationRecoveryPointProperties(DateTimeOffset recoveryPointOn, DataReplicationRecoveryPointType recoveryPointType, DataReplicationRecoveryPointCustomProperties customProperties, DataReplicationProvisioningState? provisioningState, IDictionary serializedAdditionalRawData) + { + RecoveryPointOn = recoveryPointOn; + RecoveryPointType = recoveryPointType; + CustomProperties = customProperties; + ProvisioningState = provisioningState; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationRecoveryPointProperties() + { + } + + /// Gets or sets the recovery point time. + public DateTimeOffset RecoveryPointOn { get; } + /// Gets or sets the recovery point type. + public DataReplicationRecoveryPointType RecoveryPointType { get; } + /// + /// Recovery point model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public DataReplicationRecoveryPointCustomProperties CustomProperties { get; } + /// Gets or sets the provisioning state of the recovery point item. + public DataReplicationProvisioningState? ProvisioningState { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointType.cs new file mode 100644 index 000000000000..1b121feecf9d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationRecoveryPointType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the recovery point type. + public readonly partial struct DataReplicationRecoveryPointType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationRecoveryPointType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ApplicationConsistentValue = "ApplicationConsistent"; + private const string CrashConsistentValue = "CrashConsistent"; + + /// Application consistent recovery point. + public static DataReplicationRecoveryPointType ApplicationConsistent { get; } = new DataReplicationRecoveryPointType(ApplicationConsistentValue); + /// Crash consistent recovery point. + public static DataReplicationRecoveryPointType CrashConsistent { get; } = new DataReplicationRecoveryPointType(CrashConsistentValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationRecoveryPointType left, DataReplicationRecoveryPointType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationRecoveryPointType left, DataReplicationRecoveryPointType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationRecoveryPointType(string value) => new DataReplicationRecoveryPointType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationRecoveryPointType other && Equals(other); + /// + public bool Equals(DataReplicationRecoveryPointType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationResynchronizationState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationResynchronizationState.cs new file mode 100644 index 000000000000..ed5b55c1b4e1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationResynchronizationState.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the resynchronization state. + public readonly partial struct DataReplicationResynchronizationState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationResynchronizationState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string ResynchronizationInitiatedValue = "ResynchronizationInitiated"; + private const string ResynchronizationCompletedValue = "ResynchronizationCompleted"; + private const string ResynchronizationFailedValue = "ResynchronizationFailed"; + + /// Resynchronization is not active. + public static DataReplicationResynchronizationState None { get; } = new DataReplicationResynchronizationState(NoneValue); + /// Resynchronization has been initiated. + public static DataReplicationResynchronizationState ResynchronizationInitiated { get; } = new DataReplicationResynchronizationState(ResynchronizationInitiatedValue); + /// Resynchronization has been completed successfully. + public static DataReplicationResynchronizationState ResynchronizationCompleted { get; } = new DataReplicationResynchronizationState(ResynchronizationCompletedValue); + /// Resynchronization has failed and would need to be started again. + public static DataReplicationResynchronizationState ResynchronizationFailed { get; } = new DataReplicationResynchronizationState(ResynchronizationFailedValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationResynchronizationState left, DataReplicationResynchronizationState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationResynchronizationState left, DataReplicationResynchronizationState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationResynchronizationState(string value) => new DataReplicationResynchronizationState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationResynchronizationState other && Equals(other); + /// + public bool Equals(DataReplicationResynchronizationState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.Serialization.cs new file mode 100644 index 000000000000..a6114f24f4c5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.Serialization.cs @@ -0,0 +1,221 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationTask : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationTask)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(TaskName)) + { + writer.WritePropertyName("taskName"u8); + writer.WriteStringValue(TaskName); + } + if (options.Format != "W" && Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (Optional.IsDefined(CustomProperties)) + { + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + } + if (Optional.IsCollectionDefined(ChildrenJobs)) + { + writer.WritePropertyName("childrenJobs"u8); + writer.WriteStartArray(); + foreach (var item in ChildrenJobs) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationTask IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationTask)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationTask(document.RootElement, options); + } + + internal static DataReplicationTask DeserializeDataReplicationTask(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string taskName = default; + DataReplicationTaskState? state = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + DataReplicationTaskCustomProperties customProperties = default; + IReadOnlyList childrenJobs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("taskName"u8)) + { + taskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new DataReplicationTaskState(property.Value.GetString()); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("customProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customProperties = DataReplicationTaskCustomProperties.DeserializeDataReplicationTaskCustomProperties(property.Value, options); + continue; + } + if (property.NameEquals("childrenJobs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationJobData.DeserializeDataReplicationJobData(item, options)); + } + childrenJobs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationTask( + taskName, + state, + startTime, + endTime, + customProperties, + childrenJobs ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationTask)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationTask IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationTask(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationTask)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.cs new file mode 100644 index 000000000000..200254809b07 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTask.cs @@ -0,0 +1,92 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Task model. + public partial class DataReplicationTask + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal DataReplicationTask() + { + ChildrenJobs = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets the task name. + /// Gets or sets the task state. + /// Gets or sets the start time. + /// Gets or sets the end time. + /// Task model custom properties. + /// Gets or sets the list of children job models. + /// Keeps track of any properties unknown to the library. + internal DataReplicationTask(string taskName, DataReplicationTaskState? state, DateTimeOffset? startOn, DateTimeOffset? endOn, DataReplicationTaskCustomProperties customProperties, IReadOnlyList childrenJobs, IDictionary serializedAdditionalRawData) + { + TaskName = taskName; + State = state; + StartOn = startOn; + EndOn = endOn; + CustomProperties = customProperties; + ChildrenJobs = childrenJobs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the task name. + public string TaskName { get; } + /// Gets or sets the task state. + public DataReplicationTaskState? State { get; } + /// Gets or sets the start time. + public DateTimeOffset? StartOn { get; } + /// Gets or sets the end time. + public DateTimeOffset? EndOn { get; } + /// Task model custom properties. + internal DataReplicationTaskCustomProperties CustomProperties { get; } + /// Gets or sets the instance type. + public string CustomInstanceType + { + get => CustomProperties?.InstanceType; + } + + /// Gets or sets the list of children job models. + public IReadOnlyList ChildrenJobs { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.Serialization.cs new file mode 100644 index 000000000000..08b16587b7e8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class DataReplicationTaskCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationTaskCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationTaskCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationTaskCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationTaskCustomProperties(document.RootElement, options); + } + + internal static DataReplicationTaskCustomProperties DeserializeDataReplicationTaskCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationTaskCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationTaskCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationTaskCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationTaskCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationTaskCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.cs new file mode 100644 index 000000000000..ca8da00a4de1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskCustomProperties.cs @@ -0,0 +1,75 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Task model custom properties. + internal partial class DataReplicationTaskCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the instance type. + /// is null. + internal DataReplicationTaskCustomProperties(string instanceType) + { + Argument.AssertNotNull(instanceType, nameof(instanceType)); + + InstanceType = instanceType; + } + + /// Initializes a new instance of . + /// Gets or sets the instance type. + /// Keeps track of any properties unknown to the library. + internal DataReplicationTaskCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DataReplicationTaskCustomProperties() + { + } + + /// Gets or sets the instance type. + public string InstanceType { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskState.cs new file mode 100644 index 000000000000..b8f653efd661 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTaskState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the task state. + public readonly partial struct DataReplicationTaskState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationTaskState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PendingValue = "Pending"; + private const string StartedValue = "Started"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CancelledValue = "Cancelled"; + private const string SkippedValue = "Skipped"; + + /// Task has not been started. + public static DataReplicationTaskState Pending { get; } = new DataReplicationTaskState(PendingValue); + /// Task is in progress. + public static DataReplicationTaskState Started { get; } = new DataReplicationTaskState(StartedValue); + /// Task has completed successfully. + public static DataReplicationTaskState Succeeded { get; } = new DataReplicationTaskState(SucceededValue); + /// Task failed. + public static DataReplicationTaskState Failed { get; } = new DataReplicationTaskState(FailedValue); + /// Task has been cancelled. + public static DataReplicationTaskState Cancelled { get; } = new DataReplicationTaskState(CancelledValue); + /// Task has been skipped. + public static DataReplicationTaskState Skipped { get; } = new DataReplicationTaskState(SkippedValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationTaskState left, DataReplicationTaskState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationTaskState left, DataReplicationTaskState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationTaskState(string value) => new DataReplicationTaskState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationTaskState other && Equals(other); + /// + public bool Equals(DataReplicationTaskState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTestFailoverState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTestFailoverState.cs new file mode 100644 index 000000000000..35bd3e4557c6 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationTestFailoverState.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the test failover state. + public readonly partial struct DataReplicationTestFailoverState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationTestFailoverState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string TestFailoverInitiatedValue = "TestFailoverInitiated"; + private const string TestFailoverCompletingValue = "TestFailoverCompleting"; + private const string TestFailoverCompletedValue = "TestFailoverCompleted"; + private const string TestFailoverFailedValue = "TestFailoverFailed"; + private const string TestFailoverCompletionFailedValue = "TestFailoverCompletionFailed"; + private const string TestFailoverCleanupInitiatedValue = "TestFailoverCleanupInitiated"; + private const string TestFailoverCleanupCompletingValue = "TestFailoverCleanupCompleting"; + private const string MarkedForDeletionValue = "MarkedForDeletion"; + + /// Test failover is not active. + public static DataReplicationTestFailoverState None { get; } = new DataReplicationTestFailoverState(NoneValue); + /// Test failover has been initiated. + public static DataReplicationTestFailoverState TestFailoverInitiated { get; } = new DataReplicationTestFailoverState(TestFailoverInitiatedValue); + /// Preparing test protected entities is in progress. + public static DataReplicationTestFailoverState TestFailoverCompleting { get; } = new DataReplicationTestFailoverState(TestFailoverCompletingValue); + /// Test failover has been completed successfully. + public static DataReplicationTestFailoverState TestFailoverCompleted { get; } = new DataReplicationTestFailoverState(TestFailoverCompletedValue); + /// Test failover initiation failed.. + public static DataReplicationTestFailoverState TestFailoverFailed { get; } = new DataReplicationTestFailoverState(TestFailoverFailedValue); + /// Preparing test protected entities failed. + public static DataReplicationTestFailoverState TestFailoverCompletionFailed { get; } = new DataReplicationTestFailoverState(TestFailoverCompletionFailedValue); + /// Test failover cleanup has been initiated. + public static DataReplicationTestFailoverState TestFailoverCleanupInitiated { get; } = new DataReplicationTestFailoverState(TestFailoverCleanupInitiatedValue); + /// Cleaning up test protected entities is in progress. + public static DataReplicationTestFailoverState TestFailoverCleanupCompleting { get; } = new DataReplicationTestFailoverState(TestFailoverCleanupCompletingValue); + /// Test failover cleanup has completed/failed. This is a transient state before the state is moved back to None. + public static DataReplicationTestFailoverState MarkedForDeletion { get; } = new DataReplicationTestFailoverState(MarkedForDeletionValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationTestFailoverState left, DataReplicationTestFailoverState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationTestFailoverState left, DataReplicationTestFailoverState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationTestFailoverState(string value) => new DataReplicationTestFailoverState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationTestFailoverState other && Equals(other); + /// + public bool Equals(DataReplicationTestFailoverState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.Serialization.cs new file mode 100644 index 000000000000..60da0d8a33cb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.Serialization.cs @@ -0,0 +1,197 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationVaultPatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationVaultPatch)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + JsonSerializer.Serialize(writer, Identity); + } + } + + DataReplicationVaultPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationVaultPatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationVaultPatch(document.RootElement, options); + } + + internal static DataReplicationVaultPatch DeserializeDataReplicationVaultPatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + DataReplicationVaultProperties properties = default; + ManagedServiceIdentity identity = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = DataReplicationVaultProperties.DeserializeDataReplicationVaultProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationVaultPatch( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + properties, + identity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationVaultPatch)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationVaultPatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationVaultPatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationVaultPatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.cs new file mode 100644 index 000000000000..aff777c9c300 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultPatch.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Vault model update. + public partial class DataReplicationVaultPatch : ResourceData + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationVaultPatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// Gets or sets the resource tags. + /// Vault properties. + /// Vault identity. Current supported identity types: None, SystemAssigned, UserAssigned. + /// Keeps track of any properties unknown to the library. + internal DataReplicationVaultPatch(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, DataReplicationVaultProperties properties, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + { + Tags = tags; + Properties = properties; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the resource tags. + public IDictionary Tags { get; } + /// Vault properties. + public DataReplicationVaultProperties Properties { get; set; } + /// Vault identity. Current supported identity types: None, SystemAssigned, UserAssigned. + public ManagedServiceIdentity Identity { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.Serialization.cs new file mode 100644 index 000000000000..919991a2785b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.Serialization.cs @@ -0,0 +1,163 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DataReplicationVaultProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationVaultProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ServiceResourceId)) + { + writer.WritePropertyName("serviceResourceId"u8); + writer.WriteStringValue(ServiceResourceId); + } + if (Optional.IsDefined(VaultType)) + { + writer.WritePropertyName("vaultType"u8); + writer.WriteStringValue(VaultType.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DataReplicationVaultProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationVaultProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationVaultProperties(document.RootElement, options); + } + + internal static DataReplicationVaultProperties DeserializeDataReplicationVaultProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DataReplicationProvisioningState? provisioningState = default; + ResourceIdentifier serviceResourceId = default; + DataReplicationVaultType? vaultType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new DataReplicationProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("serviceResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + serviceResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vaultType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vaultType = new DataReplicationVaultType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DataReplicationVaultProperties(provisioningState, serviceResourceId, vaultType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationVaultProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationVaultProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationVaultProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationVaultProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.cs new file mode 100644 index 000000000000..7464d2a973bc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultProperties.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Vault properties. + public partial class DataReplicationVaultProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DataReplicationVaultProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the provisioning state of the vault. + /// Gets or sets the service resource Id. + /// Gets or sets the type of vault. + /// Keeps track of any properties unknown to the library. + internal DataReplicationVaultProperties(DataReplicationProvisioningState? provisioningState, ResourceIdentifier serviceResourceId, DataReplicationVaultType? vaultType, IDictionary serializedAdditionalRawData) + { + ProvisioningState = provisioningState; + ServiceResourceId = serviceResourceId; + VaultType = vaultType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the provisioning state of the vault. + public DataReplicationProvisioningState? ProvisioningState { get; } + /// Gets or sets the service resource Id. + public ResourceIdentifier ServiceResourceId { get; } + /// Gets or sets the type of vault. + public DataReplicationVaultType? VaultType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultType.cs new file mode 100644 index 000000000000..57ab10259484 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DataReplicationVaultType.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the type of vault. + public readonly partial struct DataReplicationVaultType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DataReplicationVaultType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DisasterRecoveryValue = "DisasterRecovery"; + private const string MigrateValue = "Migrate"; + + /// Disaster recovery vault. + public static DataReplicationVaultType DisasterRecovery { get; } = new DataReplicationVaultType(DisasterRecoveryValue); + /// Migrate vault. + public static DataReplicationVaultType Migrate { get; } = new DataReplicationVaultType(MigrateValue); + /// Determines if two values are the same. + public static bool operator ==(DataReplicationVaultType left, DataReplicationVaultType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DataReplicationVaultType left, DataReplicationVaultType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DataReplicationVaultType(string value) => new DataReplicationVaultType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DataReplicationVaultType other && Equals(other); + /// + public bool Equals(DataReplicationVaultType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.Serialization.cs new file mode 100644 index 000000000000..c9faaac378e5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DeploymentPreflight : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentPreflight)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(Resources)) + { + writer.WritePropertyName("resources"u8); + writer.WriteStartArray(); + foreach (var item in Resources) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentPreflight IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentPreflight)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentPreflight(document.RootElement, options); + } + + internal static DeploymentPreflight DeserializeDeploymentPreflight(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList resources = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resources"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeploymentPreflightResourceInfo.DeserializeDeploymentPreflightResourceInfo(item, options)); + } + resources = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentPreflight(resources ?? new ChangeTrackingList(), serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeploymentPreflight)} does not support writing '{options.Format}' format."); + } + } + + DeploymentPreflight IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeploymentPreflight(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentPreflight)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.cs new file mode 100644 index 000000000000..dc4c10606cd4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflight.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Deployment preflight model. + public partial class DeploymentPreflight + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeploymentPreflight() + { + Resources = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets the list of resources. + /// Keeps track of any properties unknown to the library. + internal DeploymentPreflight(IList resources, IDictionary serializedAdditionalRawData) + { + Resources = resources; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the list of resources. + public IList Resources { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.Serialization.cs new file mode 100644 index 000000000000..8b7d39007f7d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.Serialization.cs @@ -0,0 +1,198 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class DeploymentPreflightResourceInfo : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentPreflightResourceInfo)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value); + } + if (Optional.IsDefined(Location)) + { + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location.Value); + } + if (Optional.IsDefined(ApiVersion)) + { + writer.WritePropertyName("apiVersion"u8); + writer.WriteStringValue(ApiVersion); + } + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); +#if NET6_0_OR_GREATER + writer.WriteRawValue(Properties); +#else + using (JsonDocument document = JsonDocument.Parse(Properties, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DeploymentPreflightResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentPreflightResourceInfo)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentPreflightResourceInfo(document.RootElement, options); + } + + internal static DeploymentPreflightResourceInfo DeserializeDeploymentPreflightResourceInfo(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + ResourceType? type = default; + AzureLocation? location = default; + string apiVersion = default; + BinaryData properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("location"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("apiVersion"u8)) + { + apiVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = BinaryData.FromString(property.Value.GetRawText()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentPreflightResourceInfo( + name, + type, + location, + apiVersion, + properties, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DeploymentPreflightResourceInfo)} does not support writing '{options.Format}' format."); + } + } + + DeploymentPreflightResourceInfo IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeploymentPreflightResourceInfo(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentPreflightResourceInfo)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.cs new file mode 100644 index 000000000000..ff63b5899143 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/DeploymentPreflightResourceInfo.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Deployment preflight resource. + public partial class DeploymentPreflightResourceInfo + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public DeploymentPreflightResourceInfo() + { + } + + /// Initializes a new instance of . + /// Gets or sets the resource name. + /// Gets or sets the resource type. + /// Gets or sets the location of the resource. + /// Gets or sets the Api version. + /// Gets or sets the properties of the resource. + /// Keeps track of any properties unknown to the library. + internal DeploymentPreflightResourceInfo(string name, ResourceType? type, AzureLocation? location, string apiVersion, BinaryData properties, IDictionary serializedAdditionalRawData) + { + Name = name; + Type = type; + Location = location; + ApiVersion = apiVersion; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the resource name. + public string Name { get; set; } + /// Gets or sets the resource type. + public ResourceType? Type { get; set; } + /// Gets or sets the location of the resource. + public AzureLocation? Location { get; set; } + /// Gets or sets the Api version. + public string ApiVersion { get; set; } + /// + /// Gets or sets the properties of the resource. + /// + /// To assign an object to this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + public BinaryData Properties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.Serialization.cs new file mode 100644 index 000000000000..3777aabaae75 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class EmailConfigurationModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmailConfigurationModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EmailConfigurationModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EmailConfigurationModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEmailConfigurationModelListResult(document.RootElement, options); + } + + internal static EmailConfigurationModelListResult DeserializeEmailConfigurationModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EmailConfigurationModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EmailConfigurationModelListResult)} does not support writing '{options.Format}' format."); + } + } + + EmailConfigurationModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEmailConfigurationModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EmailConfigurationModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.cs new file mode 100644 index 000000000000..9bbfe88efaa3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EmailConfigurationModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a EmailConfigurationModel list operation. + internal partial class EmailConfigurationModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The EmailConfigurationModel items on this page. + /// is null. + internal EmailConfigurationModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The EmailConfigurationModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal EmailConfigurationModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EmailConfigurationModelListResult() + { + } + + /// The EmailConfigurationModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.Serialization.cs new file mode 100644 index 000000000000..021070c56552 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class EventModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EventModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + EventModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EventModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEventModelListResult(document.RootElement, options); + } + + internal static EventModelListResult DeserializeEventModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationEventData.DeserializeDataReplicationEventData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EventModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(EventModelListResult)} does not support writing '{options.Format}' format."); + } + } + + EventModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEventModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EventModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.cs new file mode 100644 index 000000000000..5b38c81917c9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/EventModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a EventModel list operation. + internal partial class EventModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The EventModel items on this page. + /// is null. + internal EventModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The EventModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal EventModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal EventModelListResult() + { + } + + /// The EventModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.Serialization.cs new file mode 100644 index 000000000000..f68d20825226 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class FabricAgentModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricAgentModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FabricAgentModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricAgentModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricAgentModelListResult(document.RootElement, options); + } + + internal static FabricAgentModelListResult DeserializeFabricAgentModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationFabricAgentData.DeserializeDataReplicationFabricAgentData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FabricAgentModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FabricAgentModelListResult)} does not support writing '{options.Format}' format."); + } + } + + FabricAgentModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFabricAgentModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricAgentModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.cs new file mode 100644 index 000000000000..d93ed1a75ee9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricAgentModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a FabricAgentModel list operation. + internal partial class FabricAgentModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The FabricAgentModel items on this page. + /// is null. + internal FabricAgentModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FabricAgentModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FabricAgentModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FabricAgentModelListResult() + { + } + + /// The FabricAgentModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.Serialization.cs new file mode 100644 index 000000000000..c98e6580290f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class FabricModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FabricModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FabricModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFabricModelListResult(document.RootElement, options); + } + + internal static FabricModelListResult DeserializeFabricModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationFabricData.DeserializeDataReplicationFabricData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FabricModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FabricModelListResult)} does not support writing '{options.Format}' format."); + } + } + + FabricModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFabricModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FabricModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.cs new file mode 100644 index 000000000000..ab056421422d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FabricModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a FabricModel list operation. + internal partial class FabricModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The FabricModel items on this page. + /// is null. + internal FabricModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FabricModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FabricModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FabricModelListResult() + { + } + + /// The FabricModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.Serialization.cs new file mode 100644 index 000000000000..a81c0c953922 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class FailoverJobCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FailoverJobCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedItemDetails)) + { + writer.WritePropertyName("protectedItemDetails"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedItemDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + FailoverJobCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FailoverJobCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFailoverJobCustomProperties(document.RootElement, options); + } + + internal static FailoverJobCustomProperties DeserializeFailoverJobCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList protectedItemDetails = default; + string instanceType = default; + JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protectedItemDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailoverProtectedItemProperties.DeserializeFailoverProtectedItemProperties(item, options)); + } + protectedItemDetails = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedObjectDetails = JobModelCustomPropertiesAffectedObjectDetails.DeserializeJobModelCustomPropertiesAffectedObjectDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FailoverJobCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData, protectedItemDetails ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FailoverJobCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + FailoverJobCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFailoverJobCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FailoverJobCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.cs new file mode 100644 index 000000000000..4a880d47abb7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverJobCustomProperties.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Failover job model custom properties. + public partial class FailoverJobCustomProperties : DataReplicationJobCustomProperties + { + /// Initializes a new instance of . + internal FailoverJobCustomProperties() + { + ProtectedItemDetails = new ChangeTrackingList(); + InstanceType = "FailoverJobDetails"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationJobCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the failed over protected item details. + internal FailoverJobCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData, IReadOnlyList protectedItemDetails) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + ProtectedItemDetails = protectedItemDetails; + InstanceType = instanceType ?? "FailoverJobDetails"; + } + + /// Gets or sets the failed over protected item details. + public IReadOnlyList ProtectedItemDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.Serialization.cs new file mode 100644 index 000000000000..5d9a1910ba1b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class FailoverProtectedItemProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FailoverProtectedItemProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ProtectedItemName)) + { + writer.WritePropertyName("protectedItemName"u8); + writer.WriteStringValue(ProtectedItemName); + } + if (options.Format != "W" && Optional.IsDefined(VmName)) + { + writer.WritePropertyName("vmName"u8); + writer.WriteStringValue(VmName); + } + if (options.Format != "W" && Optional.IsDefined(TestVmName)) + { + writer.WritePropertyName("testVmName"u8); + writer.WriteStringValue(TestVmName); + } + if (options.Format != "W" && Optional.IsDefined(RecoveryPointId)) + { + writer.WritePropertyName("recoveryPointId"u8); + writer.WriteStringValue(RecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(RecoveryPointOn)) + { + writer.WritePropertyName("recoveryPointTime"u8); + writer.WriteStringValue(RecoveryPointOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (options.Format != "W" && Optional.IsDefined(Subnet)) + { + writer.WritePropertyName("subnet"u8); + writer.WriteStringValue(Subnet); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + FailoverProtectedItemProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FailoverProtectedItemProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFailoverProtectedItemProperties(document.RootElement, options); + } + + internal static FailoverProtectedItemProperties DeserializeFailoverProtectedItemProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string protectedItemName = default; + string vmName = default; + string testVmName = default; + string recoveryPointId = default; + DateTimeOffset? recoveryPointTime = default; + string networkName = default; + string subnet = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protectedItemName"u8)) + { + protectedItemName = property.Value.GetString(); + continue; + } + if (property.NameEquals("vmName"u8)) + { + vmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("testVmName"u8)) + { + testVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoveryPointId"u8)) + { + recoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("recoveryPointTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recoveryPointTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnet"u8)) + { + subnet = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FailoverProtectedItemProperties( + protectedItemName, + vmName, + testVmName, + recoveryPointId, + recoveryPointTime, + networkName, + subnet, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(FailoverProtectedItemProperties)} does not support writing '{options.Format}' format."); + } + } + + FailoverProtectedItemProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFailoverProtectedItemProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FailoverProtectedItemProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.cs new file mode 100644 index 000000000000..ba5635ae92a1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/FailoverProtectedItemProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Failover properties of the protected item. + public partial class FailoverProtectedItemProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal FailoverProtectedItemProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the protected item name. + /// Gets or sets the VM name. + /// Gets or sets the test VM name. + /// Gets or sets the recovery point Id. + /// Gets or sets the recovery point time. + /// Gets or sets the network name. + /// Gets or sets the network subnet. + /// Keeps track of any properties unknown to the library. + internal FailoverProtectedItemProperties(string protectedItemName, string vmName, string testVmName, string recoveryPointId, DateTimeOffset? recoveryPointOn, string networkName, string subnet, IDictionary serializedAdditionalRawData) + { + ProtectedItemName = protectedItemName; + VmName = vmName; + TestVmName = testVmName; + RecoveryPointId = recoveryPointId; + RecoveryPointOn = recoveryPointOn; + NetworkName = networkName; + Subnet = subnet; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the protected item name. + public string ProtectedItemName { get; } + /// Gets or sets the VM name. + public string VmName { get; } + /// Gets or sets the test VM name. + public string TestVmName { get; } + /// Gets or sets the recovery point Id. + public string RecoveryPointId { get; } + /// Gets or sets the recovery point time. + public DateTimeOffset? RecoveryPointOn { get; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the network subnet. + public string Subnet { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.Serialization.cs new file mode 100644 index 000000000000..427c35ded0fe --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class GroupConnectivityInformation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GroupConnectivityInformation)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"u8); + writer.WriteStringValue(GroupId); + } + if (Optional.IsDefined(MemberName)) + { + writer.WritePropertyName("memberName"u8); + writer.WriteStringValue(MemberName); + } + if (Optional.IsCollectionDefined(CustomerVisibleFqdns)) + { + writer.WritePropertyName("customerVisibleFqdns"u8); + writer.WriteStartArray(); + foreach (var item in CustomerVisibleFqdns) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(InternalFqdn)) + { + writer.WritePropertyName("internalFqdn"u8); + writer.WriteStringValue(InternalFqdn); + } + if (Optional.IsDefined(RedirectMapId)) + { + writer.WritePropertyName("redirectMapId"u8); + writer.WriteStringValue(RedirectMapId); + } + if (Optional.IsDefined(PrivateLinkServiceArmRegion)) + { + writer.WritePropertyName("privateLinkServiceArmRegion"u8); + writer.WriteStringValue(PrivateLinkServiceArmRegion); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + GroupConnectivityInformation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GroupConnectivityInformation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGroupConnectivityInformation(document.RootElement, options); + } + + internal static GroupConnectivityInformation DeserializeGroupConnectivityInformation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string groupId = default; + string memberName = default; + IList customerVisibleFqdns = default; + string internalFqdn = default; + string redirectMapId = default; + string privateLinkServiceArmRegion = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("groupId"u8)) + { + groupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("memberName"u8)) + { + memberName = property.Value.GetString(); + continue; + } + if (property.NameEquals("customerVisibleFqdns"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + customerVisibleFqdns = array; + continue; + } + if (property.NameEquals("internalFqdn"u8)) + { + internalFqdn = property.Value.GetString(); + continue; + } + if (property.NameEquals("redirectMapId"u8)) + { + redirectMapId = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateLinkServiceArmRegion"u8)) + { + privateLinkServiceArmRegion = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GroupConnectivityInformation( + groupId, + memberName, + customerVisibleFqdns ?? new ChangeTrackingList(), + internalFqdn, + redirectMapId, + privateLinkServiceArmRegion, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(GroupConnectivityInformation)} does not support writing '{options.Format}' format."); + } + } + + GroupConnectivityInformation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGroupConnectivityInformation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GroupConnectivityInformation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.cs new file mode 100644 index 000000000000..bc4ad49ffc23 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/GroupConnectivityInformation.cs @@ -0,0 +1,86 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represents of a connection's group information. + public partial class GroupConnectivityInformation + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public GroupConnectivityInformation() + { + CustomerVisibleFqdns = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets group id. + /// Gets or sets member name. + /// Gets or sets customer visible FQDNs. + /// Gets or sets Internal Fqdn. + /// Gets or sets the redirect map id. + /// Gets or sets the private link service arm region. + /// Keeps track of any properties unknown to the library. + internal GroupConnectivityInformation(string groupId, string memberName, IList customerVisibleFqdns, string internalFqdn, string redirectMapId, string privateLinkServiceArmRegion, IDictionary serializedAdditionalRawData) + { + GroupId = groupId; + MemberName = memberName; + CustomerVisibleFqdns = customerVisibleFqdns; + InternalFqdn = internalFqdn; + RedirectMapId = redirectMapId; + PrivateLinkServiceArmRegion = privateLinkServiceArmRegion; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets group id. + public string GroupId { get; set; } + /// Gets or sets member name. + public string MemberName { get; set; } + /// Gets or sets customer visible FQDNs. + public IList CustomerVisibleFqdns { get; } + /// Gets or sets Internal Fqdn. + public string InternalFqdn { get; set; } + /// Gets or sets the redirect map id. + public string RedirectMapId { get; set; } + /// Gets or sets the private link service arm region. + public string PrivateLinkServiceArmRegion { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.Serialization.cs new file mode 100644 index 000000000000..ef495c3855a5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.Serialization.cs @@ -0,0 +1,178 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVMigrateFabricCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVMigrateFabricCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("hyperVSiteId"u8); + writer.WriteStringValue(HyperVSiteId); + if (options.Format != "W" && Optional.IsDefined(FabricResourceId)) + { + writer.WritePropertyName("fabricResourceId"u8); + writer.WriteStringValue(FabricResourceId); + } + if (options.Format != "W" && Optional.IsDefined(FabricContainerId)) + { + writer.WritePropertyName("fabricContainerId"u8); + writer.WriteStringValue(FabricContainerId); + } + writer.WritePropertyName("migrationSolutionId"u8); + writer.WriteStringValue(MigrationSolutionId); + if (options.Format != "W" && Optional.IsDefined(MigrationHubUri)) + { + writer.WritePropertyName("migrationHubUri"u8); + writer.WriteStringValue(MigrationHubUri.AbsoluteUri); + } + } + + HyperVMigrateFabricCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVMigrateFabricCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVMigrateFabricCustomProperties(document.RootElement, options); + } + + internal static HyperVMigrateFabricCustomProperties DeserializeHyperVMigrateFabricCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier hyperVSiteId = default; + ResourceIdentifier fabricResourceId = default; + ResourceIdentifier fabricContainerId = default; + ResourceIdentifier migrationSolutionId = default; + Uri migrationHubUri = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperVSiteId"u8)) + { + hyperVSiteId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("fabricResourceId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fabricResourceId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("fabricContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + fabricContainerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationSolutionId"u8)) + { + migrationSolutionId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationHubUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationHubUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVMigrateFabricCustomProperties( + instanceType, + serializedAdditionalRawData, + hyperVSiteId, + fabricResourceId, + fabricContainerId, + migrationSolutionId, + migrationHubUri); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVMigrateFabricCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVMigrateFabricCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVMigrateFabricCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVMigrateFabricCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.cs new file mode 100644 index 000000000000..2a30f572c1ea --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVMigrateFabricCustomProperties.cs @@ -0,0 +1,65 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV migrate fabric model custom properties. + public partial class HyperVMigrateFabricCustomProperties : DataReplicationFabricCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the migration solution ARM Id. + /// or is null. + public HyperVMigrateFabricCustomProperties(ResourceIdentifier hyperVSiteId, ResourceIdentifier migrationSolutionId) + { + Argument.AssertNotNull(hyperVSiteId, nameof(hyperVSiteId)); + Argument.AssertNotNull(migrationSolutionId, nameof(migrationSolutionId)); + + HyperVSiteId = hyperVSiteId; + MigrationSolutionId = migrationSolutionId; + InstanceType = "HyperVMigrate"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the fabric resource Id. + /// Gets or sets the fabric container Id. + /// Gets or sets the migration solution ARM Id. + /// Gets or sets the migration hub Uri. + internal HyperVMigrateFabricCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier hyperVSiteId, ResourceIdentifier fabricResourceId, ResourceIdentifier fabricContainerId, ResourceIdentifier migrationSolutionId, Uri migrationHubUri) : base(instanceType, serializedAdditionalRawData) + { + HyperVSiteId = hyperVSiteId; + FabricResourceId = fabricResourceId; + FabricContainerId = fabricContainerId; + MigrationSolutionId = migrationSolutionId; + MigrationHubUri = migrationHubUri; + InstanceType = instanceType ?? "HyperVMigrate"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVMigrateFabricCustomProperties() + { + } + + /// Gets or sets the ARM Id of the HyperV site. + public ResourceIdentifier HyperVSiteId { get; set; } + /// Gets or sets the fabric resource Id. + public ResourceIdentifier FabricResourceId { get; } + /// Gets or sets the fabric container Id. + public ResourceIdentifier FabricContainerId { get; } + /// Gets or sets the migration solution ARM Id. + public ResourceIdentifier MigrationSolutionId { get; set; } + /// Gets or sets the migration hub Uri. + public Uri MigrationHubUri { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciDiskInput.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciDiskInput.Serialization.cs new file mode 100644 index 000000000000..42f3364403da --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciDiskInput.Serialization.cs @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciDiskInput : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciDiskInput)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("diskId"u8); + writer.WriteStringValue(DiskId); + if (Optional.IsDefined(StorageContainerId)) + { + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + } + if (Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"u8); + writer.WriteBooleanValue(IsDynamic.Value); + } + writer.WritePropertyName("diskSizeGB"u8); + writer.WriteNumberValue(DiskSizeGB); + writer.WritePropertyName("diskFileFormat"u8); + writer.WriteStringValue(DiskFileFormat); + writer.WritePropertyName("isOsDisk"u8); + writer.WriteBooleanValue(IsOSDisk); + if (Optional.IsDefined(DiskBlockSize)) + { + writer.WritePropertyName("diskBlockSize"u8); + writer.WriteNumberValue(DiskBlockSize.Value); + } + if (Optional.IsDefined(DiskLogicalSectorSize)) + { + writer.WritePropertyName("diskLogicalSectorSize"u8); + writer.WriteNumberValue(DiskLogicalSectorSize.Value); + } + if (Optional.IsDefined(DiskPhysicalSectorSize)) + { + writer.WritePropertyName("diskPhysicalSectorSize"u8); + writer.WriteNumberValue(DiskPhysicalSectorSize.Value); + } + if (Optional.IsDefined(DiskIdentifier)) + { + writer.WritePropertyName("diskIdentifier"u8); + writer.WriteStringValue(DiskIdentifier); + } + if (Optional.IsDefined(DiskController)) + { + writer.WritePropertyName("diskController"u8); + writer.WriteObjectValue(DiskController, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HyperVToAzStackHciDiskInput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciDiskInput)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciDiskInput(document.RootElement, options); + } + + internal static HyperVToAzStackHciDiskInput DeserializeHyperVToAzStackHciDiskInput(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string diskId = default; + ResourceIdentifier storageContainerId = default; + bool? isDynamic = default; + long diskSizeGB = default; + string diskFileFormat = default; + bool isOSDisk = default; + long? diskBlockSize = default; + long? diskLogicalSectorSize = default; + long? diskPhysicalSectorSize = default; + string diskIdentifier = default; + DataReplicationDiskControllerInputs diskController = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskId"u8)) + { + diskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageContainerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("isDynamic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskSizeGB"u8)) + { + diskSizeGB = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskFileFormat"u8)) + { + diskFileFormat = property.Value.GetString(); + continue; + } + if (property.NameEquals("isOsDisk"u8)) + { + isOSDisk = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskBlockSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBlockSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskLogicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskLogicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskPhysicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskPhysicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskIdentifier"u8)) + { + diskIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskController"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskController = DataReplicationDiskControllerInputs.DeserializeDataReplicationDiskControllerInputs(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciDiskInput( + diskId, + storageContainerId, + isDynamic, + diskSizeGB, + diskFileFormat, + isOSDisk, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + diskIdentifier, + diskController, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciDiskInput)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciDiskInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciDiskInput(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciDiskInput)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciDiskInput.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciDiskInput.cs new file mode 100644 index 000000000000..f068fa12789e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciDiskInput.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperVToAzStack disk input. + public partial class HyperVToAzStackHciDiskInput + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the disk Id. + /// Gets or sets the disk size in GB. + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + /// Gets or sets a value indicating whether disk is os disk. + /// or is null. + public HyperVToAzStackHciDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) + { + Argument.AssertNotNull(diskId, nameof(diskId)); + Argument.AssertNotNull(diskFileFormat, nameof(diskFileFormat)); + + DiskId = diskId; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + } + + /// Initializes a new instance of . + /// Gets or sets the disk Id. + /// Gets or sets the target storage account ARM Id. + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + /// Gets or sets the disk size in GB. + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + /// Gets or sets a value indicating whether disk is os disk. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// Gets or sets a value of disk identifier. + /// Disk controller. + /// Keeps track of any properties unknown to the library. + internal HyperVToAzStackHciDiskInput(string diskId, ResourceIdentifier storageContainerId, bool? isDynamic, long diskSizeGB, string diskFileFormat, bool isOSDisk, long? diskBlockSize, long? diskLogicalSectorSize, long? diskPhysicalSectorSize, string diskIdentifier, DataReplicationDiskControllerInputs diskController, IDictionary serializedAdditionalRawData) + { + DiskId = diskId; + StorageContainerId = storageContainerId; + IsDynamic = isDynamic; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + DiskBlockSize = diskBlockSize; + DiskLogicalSectorSize = diskLogicalSectorSize; + DiskPhysicalSectorSize = diskPhysicalSectorSize; + DiskIdentifier = diskIdentifier; + DiskController = diskController; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHciDiskInput() + { + } + + /// Gets or sets the disk Id. + public string DiskId { get; set; } + /// Gets or sets the target storage account ARM Id. + public ResourceIdentifier StorageContainerId { get; set; } + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + public bool? IsDynamic { get; set; } + /// Gets or sets the disk size in GB. + public long DiskSizeGB { get; set; } + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + public string DiskFileFormat { get; set; } + /// Gets or sets a value indicating whether disk is os disk. + public bool IsOSDisk { get; set; } + /// Gets or sets a value of disk block size. + public long? DiskBlockSize { get; set; } + /// Gets or sets a value of disk logical sector size. + public long? DiskLogicalSectorSize { get; set; } + /// Gets or sets a value of disk physical sector size. + public long? DiskPhysicalSectorSize { get; set; } + /// Gets or sets a value of disk identifier. + public string DiskIdentifier { get; set; } + /// Disk controller. + public DataReplicationDiskControllerInputs DiskController { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.Serialization.cs new file mode 100644 index 000000000000..fd99da42b724 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciEventCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciEventCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(EventSourceFriendlyName)) + { + writer.WritePropertyName("eventSourceFriendlyName"u8); + writer.WriteStringValue(EventSourceFriendlyName); + } + if (options.Format != "W" && Optional.IsDefined(ProtectedItemFriendlyName)) + { + writer.WritePropertyName("protectedItemFriendlyName"u8); + writer.WriteStringValue(ProtectedItemFriendlyName); + } + if (options.Format != "W" && Optional.IsDefined(SourceApplianceName)) + { + writer.WritePropertyName("sourceApplianceName"u8); + writer.WriteStringValue(SourceApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(TargetApplianceName)) + { + writer.WritePropertyName("targetApplianceName"u8); + writer.WriteStringValue(TargetApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(ServerType)) + { + writer.WritePropertyName("serverType"u8); + writer.WriteStringValue(ServerType); + } + } + + HyperVToAzStackHciEventCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciEventCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciEventCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciEventCustomProperties DeserializeHyperVToAzStackHciEventCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string eventSourceFriendlyName = default; + string protectedItemFriendlyName = default; + string sourceApplianceName = default; + string targetApplianceName = default; + string serverType = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eventSourceFriendlyName"u8)) + { + eventSourceFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("protectedItemFriendlyName"u8)) + { + protectedItemFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceApplianceName"u8)) + { + sourceApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetApplianceName"u8)) + { + targetApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverType"u8)) + { + serverType = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciEventCustomProperties( + instanceType, + serializedAdditionalRawData, + eventSourceFriendlyName, + protectedItemFriendlyName, + sourceApplianceName, + targetApplianceName, + serverType); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciEventCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciEventCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciEventCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciEventCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.cs new file mode 100644 index 000000000000..4d1862609196 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciEventCustomProperties.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI event model custom properties. This class provides provider specific details for events of type DataContract.HealthEvents.HealthEventType.ProtectedItemHealth and DataContract.HealthEvents.HealthEventType.AgentHealth. + public partial class HyperVToAzStackHciEventCustomProperties : DataReplicationEventCustomProperties + { + /// Initializes a new instance of . + internal HyperVToAzStackHciEventCustomProperties() + { + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationEventCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the friendly name of the source which has raised this health event. + /// Gets or sets the protected item friendly name. + /// Gets or sets the source appliance name. + /// Gets or sets the source target name. + /// Gets or sets the server type. + internal HyperVToAzStackHciEventCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string eventSourceFriendlyName, string protectedItemFriendlyName, string sourceApplianceName, string targetApplianceName, string serverType) : base(instanceType, serializedAdditionalRawData) + { + EventSourceFriendlyName = eventSourceFriendlyName; + ProtectedItemFriendlyName = protectedItemFriendlyName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + ServerType = serverType; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Gets or sets the friendly name of the source which has raised this health event. + public string EventSourceFriendlyName { get; } + /// Gets or sets the protected item friendly name. + public string ProtectedItemFriendlyName { get; } + /// Gets or sets the source appliance name. + public string SourceApplianceName { get; } + /// Gets or sets the source target name. + public string TargetApplianceName { get; } + /// Gets or sets the server type. + public string ServerType { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciNicInput.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciNicInput.Serialization.cs new file mode 100644 index 000000000000..4af130172358 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciNicInput.Serialization.cs @@ -0,0 +1,205 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciNicInput : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciNicInput)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.ToString()); + if (Optional.IsDefined(IsStaticIPMigrationEnabled)) + { + writer.WritePropertyName("isStaticIpMigrationEnabled"u8); + writer.WriteBooleanValue(IsStaticIPMigrationEnabled.Value); + } + if (Optional.IsDefined(IsMacMigrationEnabled)) + { + writer.WritePropertyName("isMacMigrationEnabled"u8); + writer.WriteBooleanValue(IsMacMigrationEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HyperVToAzStackHciNicInput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciNicInput)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciNicInput(document.RootElement, options); + } + + internal static HyperVToAzStackHciNicInput DeserializeHyperVToAzStackHciNicInput(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + string networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection selectionTypeForFailover = default; + bool? isStaticIPMigrationEnabled = default; + bool? isMacMigrationEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicId"u8)) + { + nicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("selectionTypeForFailover"u8)) + { + selectionTypeForFailover = new VmNicSelection(property.Value.GetString()); + continue; + } + if (property.NameEquals("isStaticIpMigrationEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isStaticIPMigrationEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isMacMigrationEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMacMigrationEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciNicInput( + nicId, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + isStaticIPMigrationEnabled, + isMacMigrationEnabled, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciNicInput)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciNicInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciNicInput(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciNicInput)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciNicInput.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciNicInput.cs new file mode 100644 index 000000000000..d136c4f96124 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciNicInput.cs @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperVToAzStackHCI NIC properties. + public partial class HyperVToAzStackHciNicInput + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the selection type of the NIC. + /// is null. + public HyperVToAzStackHciNicInput(string nicId, VmNicSelection selectionTypeForFailover) + { + Argument.AssertNotNull(nicId, nameof(nicId)); + + NicId = nicId; + SelectionTypeForFailover = selectionTypeForFailover; + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// Gets or sets a value indicating whether static ip migration is enabled. + /// Gets or sets a value indicating whether mac address migration is enabled. + /// Keeps track of any properties unknown to the library. + internal HyperVToAzStackHciNicInput(string nicId, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection selectionTypeForFailover, bool? isStaticIPMigrationEnabled, bool? isMacMigrationEnabled, IDictionary serializedAdditionalRawData) + { + NicId = nicId; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + IsStaticIPMigrationEnabled = isStaticIPMigrationEnabled; + IsMacMigrationEnabled = isMacMigrationEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHciNicInput() + { + } + + /// Gets or sets the NIC Id. + public string NicId { get; set; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; set; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; set; } + /// Gets or sets the selection type of the NIC. + public VmNicSelection SelectionTypeForFailover { get; set; } + /// Gets or sets a value indicating whether static ip migration is enabled. + public bool? IsStaticIPMigrationEnabled { get; set; } + /// Gets or sets a value indicating whether mac address migration is enabled. + public bool? IsMacMigrationEnabled { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.Serialization.cs new file mode 100644 index 000000000000..f6284ae98cea --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciPlannedFailoverCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciPlannedFailoverCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("shutdownSourceVM"u8); + writer.WriteBooleanValue(ShutdownSourceVm); + } + + HyperVToAzStackHciPlannedFailoverCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciPlannedFailoverCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciPlannedFailoverCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciPlannedFailoverCustomProperties DeserializeHyperVToAzStackHciPlannedFailoverCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool shutdownSourceVm = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("shutdownSourceVM"u8)) + { + shutdownSourceVm = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciPlannedFailoverCustomProperties(instanceType, serializedAdditionalRawData, shutdownSourceVm); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciPlannedFailoverCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciPlannedFailoverCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciPlannedFailoverCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciPlannedFailoverCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.cs new file mode 100644 index 000000000000..c3ab7b48e6b1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPlannedFailoverCustomProperties.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI planned failover model custom properties. + public partial class HyperVToAzStackHciPlannedFailoverCustomProperties : PlannedFailoverCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets a value indicating whether VM needs to be shut down. + public HyperVToAzStackHciPlannedFailoverCustomProperties(bool shutdownSourceVm) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for PlannedFailoverCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets a value indicating whether VM needs to be shut down. + internal HyperVToAzStackHciPlannedFailoverCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, bool shutdownSourceVm) : base(instanceType, serializedAdditionalRawData) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHciPlannedFailoverCustomProperties() + { + } + + /// Gets or sets a value indicating whether VM needs to be shut down. + public bool ShutdownSourceVm { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.Serialization.cs new file mode 100644 index 000000000000..8e870c6bd5ac --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciPolicyCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciPolicyCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("recoveryPointHistoryInMinutes"u8); + writer.WriteNumberValue(RecoveryPointHistoryInMinutes); + writer.WritePropertyName("crashConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(CrashConsistentFrequencyInMinutes); + writer.WritePropertyName("appConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(AppConsistentFrequencyInMinutes); + } + + HyperVToAzStackHciPolicyCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciPolicyCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciPolicyCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciPolicyCustomProperties DeserializeHyperVToAzStackHciPolicyCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int recoveryPointHistoryInMinutes = default; + int crashConsistentFrequencyInMinutes = default; + int appConsistentFrequencyInMinutes = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recoveryPointHistoryInMinutes"u8)) + { + recoveryPointHistoryInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("crashConsistentFrequencyInMinutes"u8)) + { + crashConsistentFrequencyInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("appConsistentFrequencyInMinutes"u8)) + { + appConsistentFrequencyInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciPolicyCustomProperties(instanceType, serializedAdditionalRawData, recoveryPointHistoryInMinutes, crashConsistentFrequencyInMinutes, appConsistentFrequencyInMinutes); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciPolicyCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciPolicyCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciPolicyCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciPolicyCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.cs new file mode 100644 index 000000000000..8b37d53437ed --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciPolicyCustomProperties.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV To AzStackHCI Policy model custom properties. + public partial class HyperVToAzStackHciPolicyCustomProperties : DataReplicationPolicyCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the duration in minutes until which the recovery points need to be stored. + /// Gets or sets the crash consistent snapshot frequency (in minutes). + /// Gets or sets the app consistent snapshot frequency (in minutes). + public HyperVToAzStackHciPolicyCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationPolicyCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the duration in minutes until which the recovery points need to be stored. + /// Gets or sets the crash consistent snapshot frequency (in minutes). + /// Gets or sets the app consistent snapshot frequency (in minutes). + internal HyperVToAzStackHciPolicyCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) : base(instanceType, serializedAdditionalRawData) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHciPolicyCustomProperties() + { + } + + /// Gets or sets the duration in minutes until which the recovery points need to be stored. + public int RecoveryPointHistoryInMinutes { get; set; } + /// Gets or sets the crash consistent snapshot frequency (in minutes). + public int CrashConsistentFrequencyInMinutes { get; set; } + /// Gets or sets the app consistent snapshot frequency (in minutes). + public int AppConsistentFrequencyInMinutes { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedDiskProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedDiskProperties.Serialization.cs new file mode 100644 index 000000000000..e0f31501d4b4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedDiskProperties.Serialization.cs @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciProtectedDiskProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedDiskProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(StorageContainerId)) + { + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + } + if (options.Format != "W" && Optional.IsDefined(StorageContainerLocalPath)) + { + writer.WritePropertyName("storageContainerLocalPath"u8); + writer.WriteStringValue(StorageContainerLocalPath); + } + if (options.Format != "W" && Optional.IsDefined(SourceDiskId)) + { + writer.WritePropertyName("sourceDiskId"u8); + writer.WriteStringValue(SourceDiskId); + } + if (options.Format != "W" && Optional.IsDefined(SourceDiskName)) + { + writer.WritePropertyName("sourceDiskName"u8); + writer.WriteStringValue(SourceDiskName); + } + if (options.Format != "W" && Optional.IsDefined(SeedDiskName)) + { + writer.WritePropertyName("seedDiskName"u8); + writer.WriteStringValue(SeedDiskName); + } + if (options.Format != "W" && Optional.IsDefined(TestMigrateDiskName)) + { + writer.WritePropertyName("testMigrateDiskName"u8); + writer.WriteStringValue(TestMigrateDiskName); + } + if (options.Format != "W" && Optional.IsDefined(MigrateDiskName)) + { + writer.WritePropertyName("migrateDiskName"u8); + writer.WriteStringValue(MigrateDiskName); + } + if (options.Format != "W" && Optional.IsDefined(IsOSDisk)) + { + writer.WritePropertyName("isOsDisk"u8); + writer.WriteBooleanValue(IsOSDisk.Value); + } + if (options.Format != "W" && Optional.IsDefined(CapacityInBytes)) + { + writer.WritePropertyName("capacityInBytes"u8); + writer.WriteNumberValue(CapacityInBytes.Value); + } + if (options.Format != "W" && Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"u8); + writer.WriteBooleanValue(IsDynamic.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskType)) + { + writer.WritePropertyName("diskType"u8); + writer.WriteStringValue(DiskType); + } + if (options.Format != "W" && Optional.IsDefined(DiskBlockSize)) + { + writer.WritePropertyName("diskBlockSize"u8); + writer.WriteNumberValue(DiskBlockSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskLogicalSectorSize)) + { + writer.WritePropertyName("diskLogicalSectorSize"u8); + writer.WriteNumberValue(DiskLogicalSectorSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskPhysicalSectorSize)) + { + writer.WritePropertyName("diskPhysicalSectorSize"u8); + writer.WriteNumberValue(DiskPhysicalSectorSize.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HyperVToAzStackHciProtectedDiskProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedDiskProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciProtectedDiskProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciProtectedDiskProperties DeserializeHyperVToAzStackHciProtectedDiskProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier storageContainerId = default; + string storageContainerLocalPath = default; + string sourceDiskId = default; + string sourceDiskName = default; + string seedDiskName = default; + string testMigrateDiskName = default; + string migrateDiskName = default; + bool? isOSDisk = default; + long? capacityInBytes = default; + bool? isDynamic = default; + string diskType = default; + long? diskBlockSize = default; + long? diskLogicalSectorSize = default; + long? diskPhysicalSectorSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageContainerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageContainerLocalPath"u8)) + { + storageContainerLocalPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDiskId"u8)) + { + sourceDiskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDiskName"u8)) + { + sourceDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("seedDiskName"u8)) + { + seedDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("testMigrateDiskName"u8)) + { + testMigrateDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrateDiskName"u8)) + { + migrateDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isOsDisk"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isOSDisk = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("capacityInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityInBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("isDynamic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskType"u8)) + { + diskType = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskBlockSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBlockSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskLogicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskLogicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskPhysicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskPhysicalSectorSize = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciProtectedDiskProperties( + storageContainerId, + storageContainerLocalPath, + sourceDiskId, + sourceDiskName, + seedDiskName, + testMigrateDiskName, + migrateDiskName, + isOSDisk, + capacityInBytes, + isDynamic, + diskType, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedDiskProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciProtectedDiskProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciProtectedDiskProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedDiskProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedDiskProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedDiskProperties.cs new file mode 100644 index 000000000000..acc4cc016afa --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedDiskProperties.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperVToAzStackHCI protected disk properties. + public partial class HyperVToAzStackHciProtectedDiskProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal HyperVToAzStackHciProtectedDiskProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the storage container. + /// Gets or sets the local path of the storage container. + /// Gets or sets the source disk Id. + /// Gets or sets the source disk Name. + /// Gets or sets the seed disk name. + /// Gets or sets the test failover clone disk. + /// Gets or sets the failover clone disk. + /// Gets or sets a value indicating whether the disk is the OS disk. + /// Gets or sets the disk capacity in bytes. + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + /// Gets or sets the disk type. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// Keeps track of any properties unknown to the library. + internal HyperVToAzStackHciProtectedDiskProperties(ResourceIdentifier storageContainerId, string storageContainerLocalPath, string sourceDiskId, string sourceDiskName, string seedDiskName, string testMigrateDiskName, string migrateDiskName, bool? isOSDisk, long? capacityInBytes, bool? isDynamic, string diskType, long? diskBlockSize, long? diskLogicalSectorSize, long? diskPhysicalSectorSize, IDictionary serializedAdditionalRawData) + { + StorageContainerId = storageContainerId; + StorageContainerLocalPath = storageContainerLocalPath; + SourceDiskId = sourceDiskId; + SourceDiskName = sourceDiskName; + SeedDiskName = seedDiskName; + TestMigrateDiskName = testMigrateDiskName; + MigrateDiskName = migrateDiskName; + IsOSDisk = isOSDisk; + CapacityInBytes = capacityInBytes; + IsDynamic = isDynamic; + DiskType = diskType; + DiskBlockSize = diskBlockSize; + DiskLogicalSectorSize = diskLogicalSectorSize; + DiskPhysicalSectorSize = diskPhysicalSectorSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the ARM Id of the storage container. + public ResourceIdentifier StorageContainerId { get; } + /// Gets or sets the local path of the storage container. + public string StorageContainerLocalPath { get; } + /// Gets or sets the source disk Id. + public string SourceDiskId { get; } + /// Gets or sets the source disk Name. + public string SourceDiskName { get; } + /// Gets or sets the seed disk name. + public string SeedDiskName { get; } + /// Gets or sets the test failover clone disk. + public string TestMigrateDiskName { get; } + /// Gets or sets the failover clone disk. + public string MigrateDiskName { get; } + /// Gets or sets a value indicating whether the disk is the OS disk. + public bool? IsOSDisk { get; } + /// Gets or sets the disk capacity in bytes. + public long? CapacityInBytes { get; } + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + public bool? IsDynamic { get; } + /// Gets or sets the disk type. + public string DiskType { get; } + /// Gets or sets a value of disk block size. + public long? DiskBlockSize { get; } + /// Gets or sets a value of disk logical sector size. + public long? DiskLogicalSectorSize { get; } + /// Gets or sets a value of disk physical sector size. + public long? DiskPhysicalSectorSize { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.Serialization.cs new file mode 100644 index 000000000000..69d7c420d97a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.Serialization.cs @@ -0,0 +1,636 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciProtectedItemCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ActiveLocation)) + { + writer.WritePropertyName("activeLocation"u8); + writer.WriteStringValue(ActiveLocation.Value.ToString()); + } + writer.WritePropertyName("targetHciClusterId"u8); + writer.WriteStringValue(TargetHciClusterId); + writer.WritePropertyName("targetArcClusterCustomLocationId"u8); + writer.WriteStringValue(TargetArcClusterCustomLocationId); + if (options.Format != "W" && Optional.IsDefined(TargetAzStackHciClusterName)) + { + writer.WritePropertyName("targetAzStackHciClusterName"u8); + writer.WriteStringValue(TargetAzStackHciClusterName); + } + writer.WritePropertyName("fabricDiscoveryMachineId"u8); + writer.WriteStringValue(FabricDiscoveryMachineId); + writer.WritePropertyName("disksToInclude"u8); + writer.WriteStartArray(); + foreach (var item in DisksToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsDefined(SourceVmName)) + { + writer.WritePropertyName("sourceVmName"u8); + writer.WriteStringValue(SourceVmName); + } + if (options.Format != "W" && Optional.IsDefined(SourceCpuCores)) + { + writer.WritePropertyName("sourceCpuCores"u8); + writer.WriteNumberValue(SourceCpuCores.Value); + } + if (options.Format != "W" && Optional.IsDefined(SourceMemoryInMegaBytes)) + { + writer.WritePropertyName("sourceMemoryInMegaBytes"u8); + writer.WriteNumberValue(SourceMemoryInMegaBytes.Value); + } + if (Optional.IsDefined(TargetVmName)) + { + writer.WritePropertyName("targetVmName"u8); + writer.WriteStringValue(TargetVmName); + } + writer.WritePropertyName("targetResourceGroupId"u8); + writer.WriteStringValue(TargetResourceGroupId); + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + writer.WritePropertyName("hyperVGeneration"u8); + writer.WriteStringValue(HyperVGeneration); + if (Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + if (Optional.IsDefined(TargetCpuCores)) + { + writer.WritePropertyName("targetCpuCores"u8); + writer.WriteNumberValue(TargetCpuCores.Value); + } + if (Optional.IsDefined(IsDynamicRam)) + { + writer.WritePropertyName("isDynamicRam"u8); + writer.WriteBooleanValue(IsDynamicRam.Value); + } + if (Optional.IsDefined(DynamicMemoryConfig)) + { + writer.WritePropertyName("dynamicMemoryConfig"u8); + writer.WriteObjectValue(DynamicMemoryConfig, options); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + writer.WritePropertyName("runAsAccountId"u8); + writer.WriteStringValue(RunAsAccountId); + writer.WritePropertyName("sourceFabricAgentName"u8); + writer.WriteStringValue(SourceFabricAgentName); + writer.WritePropertyName("targetFabricAgentName"u8); + writer.WriteStringValue(TargetFabricAgentName); + if (options.Format != "W" && Optional.IsDefined(SourceApplianceName)) + { + writer.WritePropertyName("sourceApplianceName"u8); + writer.WriteStringValue(SourceApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(TargetApplianceName)) + { + writer.WritePropertyName("targetApplianceName"u8); + writer.WriteStringValue(TargetApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType); + } + if (options.Format != "W" && Optional.IsDefined(OSName)) + { + writer.WritePropertyName("osName"u8); + writer.WriteStringValue(OSName); + } + if (options.Format != "W" && Optional.IsDefined(FirmwareType)) + { + writer.WritePropertyName("firmwareType"u8); + writer.WriteStringValue(FirmwareType); + } + if (options.Format != "W" && Optional.IsDefined(TargetLocation)) + { + writer.WritePropertyName("targetLocation"u8); + writer.WriteStringValue(TargetLocation); + } + writer.WritePropertyName("customLocationRegion"u8); + writer.WriteStringValue(CustomLocationRegion); + if (options.Format != "W" && Optional.IsDefined(FailoverRecoveryPointId)) + { + writer.WritePropertyName("failoverRecoveryPointId"u8); + writer.WriteStringValue(FailoverRecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(LastRecoveryPointReceivedOn)) + { + writer.WritePropertyName("lastRecoveryPointReceived"u8); + writer.WriteStringValue(LastRecoveryPointReceivedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastRecoveryPointId)) + { + writer.WritePropertyName("lastRecoveryPointId"u8); + writer.WriteStringValue(LastRecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(InitialReplicationProgressPercentage)) + { + writer.WritePropertyName("initialReplicationProgressPercentage"u8); + writer.WriteNumberValue(InitialReplicationProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncProgressPercentage)) + { + writer.WritePropertyName("resyncProgressPercentage"u8); + writer.WriteNumberValue(ResyncProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedDisks)) + { + writer.WritePropertyName("protectedDisks"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedNics)) + { + writer.WritePropertyName("protectedNics"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedNics) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(TargetVmBiosId)) + { + writer.WritePropertyName("targetVmBiosId"u8); + writer.WriteStringValue(TargetVmBiosId); + } + if (options.Format != "W" && Optional.IsDefined(LastReplicationUpdateOn)) + { + writer.WritePropertyName("lastReplicationUpdateTime"u8); + writer.WriteStringValue(LastReplicationUpdateOn.Value, "O"); + } + } + + HyperVToAzStackHciProtectedItemCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciProtectedItemCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciProtectedItemCustomProperties DeserializeHyperVToAzStackHciProtectedItemCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProtectedItemActiveLocation? activeLocation = default; + ResourceIdentifier targetHciClusterId = default; + ResourceIdentifier targetArcClusterCustomLocationId = default; + string targetAzStackHciClusterName = default; + ResourceIdentifier fabricDiscoveryMachineId = default; + IList disksToInclude = default; + IList nicsToInclude = default; + string sourceVmName = default; + int? sourceCpuCores = default; + double? sourceMemoryInMegaBytes = default; + string targetVmName = default; + ResourceIdentifier targetResourceGroupId = default; + ResourceIdentifier storageContainerId = default; + string hyperVGeneration = default; + string targetNetworkId = default; + string testNetworkId = default; + int? targetCpuCores = default; + bool? isDynamicRam = default; + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = default; + int? targetMemoryInMegaBytes = default; + string runAsAccountId = default; + string sourceFabricAgentName = default; + string targetFabricAgentName = default; + string sourceApplianceName = default; + string targetApplianceName = default; + string osType = default; + string osName = default; + string firmwareType = default; + string targetLocation = default; + string customLocationRegion = default; + string failoverRecoveryPointId = default; + DateTimeOffset? lastRecoveryPointReceived = default; + string lastRecoveryPointId = default; + int? initialReplicationProgressPercentage = default; + int? resyncProgressPercentage = default; + IReadOnlyList protectedDisks = default; + IReadOnlyList protectedNics = default; + string targetVmBiosId = default; + DateTimeOffset? lastReplicationUpdateTime = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("activeLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + activeLocation = new ProtectedItemActiveLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetHciClusterId"u8)) + { + targetHciClusterId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetArcClusterCustomLocationId"u8)) + { + targetArcClusterCustomLocationId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetAzStackHciClusterName"u8)) + { + targetAzStackHciClusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricDiscoveryMachineId"u8)) + { + fabricDiscoveryMachineId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("disksToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHciDiskInput.DeserializeHyperVToAzStackHciDiskInput(item, options)); + } + disksToInclude = array; + continue; + } + if (property.NameEquals("nicsToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHciNicInput.DeserializeHyperVToAzStackHciNicInput(item, options)); + } + nicsToInclude = array; + continue; + } + if (property.NameEquals("sourceVmName"u8)) + { + sourceVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sourceMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceMemoryInMegaBytes = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("targetVmName"u8)) + { + targetVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetResourceGroupId"u8)) + { + targetResourceGroupId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("hyperVGeneration"u8)) + { + hyperVGeneration = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isDynamicRam"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamicRam = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dynamicMemoryConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicMemoryConfig = ProtectedItemDynamicMemoryConfig.DeserializeProtectedItemDynamicMemoryConfig(property.Value, options); + continue; + } + if (property.NameEquals("targetMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetMemoryInMegaBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("runAsAccountId"u8)) + { + runAsAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceFabricAgentName"u8)) + { + sourceFabricAgentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricAgentName"u8)) + { + targetFabricAgentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceApplianceName"u8)) + { + sourceApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetApplianceName"u8)) + { + targetApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("osType"u8)) + { + osType = property.Value.GetString(); + continue; + } + if (property.NameEquals("osName"u8)) + { + osName = property.Value.GetString(); + continue; + } + if (property.NameEquals("firmwareType"u8)) + { + firmwareType = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetLocation"u8)) + { + targetLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("customLocationRegion"u8)) + { + customLocationRegion = property.Value.GetString(); + continue; + } + if (property.NameEquals("failoverRecoveryPointId"u8)) + { + failoverRecoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastRecoveryPointReceived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastRecoveryPointReceived = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastRecoveryPointId"u8)) + { + lastRecoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("initialReplicationProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialReplicationProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resyncProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("protectedDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHciProtectedDiskProperties.DeserializeHyperVToAzStackHciProtectedDiskProperties(item, options)); + } + protectedDisks = array; + continue; + } + if (property.NameEquals("protectedNics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHciProtectedNicProperties.DeserializeHyperVToAzStackHciProtectedNicProperties(item, options)); + } + protectedNics = array; + continue; + } + if (property.NameEquals("targetVmBiosId"u8)) + { + targetVmBiosId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastReplicationUpdateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastReplicationUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciProtectedItemCustomProperties( + instanceType, + serializedAdditionalRawData, + activeLocation, + targetHciClusterId, + targetArcClusterCustomLocationId, + targetAzStackHciClusterName, + fabricDiscoveryMachineId, + disksToInclude, + nicsToInclude, + sourceVmName, + sourceCpuCores, + sourceMemoryInMegaBytes, + targetVmName, + targetResourceGroupId, + storageContainerId, + hyperVGeneration, + targetNetworkId, + testNetworkId, + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + runAsAccountId, + sourceFabricAgentName, + targetFabricAgentName, + sourceApplianceName, + targetApplianceName, + osType, + osName, + firmwareType, + targetLocation, + customLocationRegion, + failoverRecoveryPointId, + lastRecoveryPointReceived, + lastRecoveryPointId, + initialReplicationProgressPercentage, + resyncProgressPercentage, + protectedDisks ?? new ChangeTrackingList(), + protectedNics ?? new ChangeTrackingList(), + targetVmBiosId, + lastReplicationUpdateTime); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciProtectedItemCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciProtectedItemCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.cs new file mode 100644 index 000000000000..e8e5d023be87 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomProperties.cs @@ -0,0 +1,234 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI Protected item model custom properties. + public partial class HyperVToAzStackHciProtectedItemCustomProperties : DataReplicationProtectedItemCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the hypervisor generation of the virtual machine. + /// Gets or sets the Run As account Id. + /// Gets or sets the source fabric agent name. + /// Gets or sets the target fabric agent name. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// , , , , , , , , , , or is null. + public HyperVToAzStackHciProtectedItemCustomProperties(ResourceIdentifier targetHciClusterId, ResourceIdentifier targetArcClusterCustomLocationId, ResourceIdentifier fabricDiscoveryMachineId, IEnumerable disksToInclude, IEnumerable nicsToInclude, ResourceIdentifier targetResourceGroupId, ResourceIdentifier storageContainerId, string hyperVGeneration, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, string customLocationRegion) + { + Argument.AssertNotNull(targetHciClusterId, nameof(targetHciClusterId)); + Argument.AssertNotNull(targetArcClusterCustomLocationId, nameof(targetArcClusterCustomLocationId)); + Argument.AssertNotNull(fabricDiscoveryMachineId, nameof(fabricDiscoveryMachineId)); + Argument.AssertNotNull(disksToInclude, nameof(disksToInclude)); + Argument.AssertNotNull(nicsToInclude, nameof(nicsToInclude)); + Argument.AssertNotNull(targetResourceGroupId, nameof(targetResourceGroupId)); + Argument.AssertNotNull(storageContainerId, nameof(storageContainerId)); + Argument.AssertNotNull(hyperVGeneration, nameof(hyperVGeneration)); + Argument.AssertNotNull(runAsAccountId, nameof(runAsAccountId)); + Argument.AssertNotNull(sourceFabricAgentName, nameof(sourceFabricAgentName)); + Argument.AssertNotNull(targetFabricAgentName, nameof(targetFabricAgentName)); + Argument.AssertNotNull(customLocationRegion, nameof(customLocationRegion)); + + TargetHciClusterId = targetHciClusterId; + TargetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + FabricDiscoveryMachineId = fabricDiscoveryMachineId; + DisksToInclude = disksToInclude.ToList(); + NicsToInclude = nicsToInclude.ToList(); + TargetResourceGroupId = targetResourceGroupId; + StorageContainerId = storageContainerId; + HyperVGeneration = hyperVGeneration; + RunAsAccountId = runAsAccountId; + SourceFabricAgentName = sourceFabricAgentName; + TargetFabricAgentName = targetFabricAgentName; + CustomLocationRegion = customLocationRegion; + ProtectedDisks = new ChangeTrackingList(); + ProtectedNics = new ChangeTrackingList(); + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the location of the protected item. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the Target AzStackHCI cluster name. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the source VM display name. + /// Gets or sets the source VM CPU cores. + /// Gets or sets the source VM ram memory size in megabytes. + /// Gets or sets the target VM display name. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the hypervisor generation of the virtual machine. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the Run As account Id. + /// Gets or sets the source fabric agent name. + /// Gets or sets the target fabric agent name. + /// Gets or sets the source appliance name. + /// Gets or sets the target appliance name. + /// Gets or sets the type of the OS. + /// Gets or sets the name of the OS. + /// Gets or sets the firmware type. + /// Gets or sets the target location. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the recovery point Id to which the VM was failed over. + /// Gets or sets the last recovery point received time. + /// Gets or sets the last recovery point Id. + /// Gets or sets the initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the list of protected disks. + /// Gets or sets the VM NIC details. + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + /// Gets or sets the latest timestamp that replication status is updated. + internal HyperVToAzStackHciProtectedItemCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ProtectedItemActiveLocation? activeLocation, ResourceIdentifier targetHciClusterId, ResourceIdentifier targetArcClusterCustomLocationId, string targetAzStackHciClusterName, ResourceIdentifier fabricDiscoveryMachineId, IList disksToInclude, IList nicsToInclude, string sourceVmName, int? sourceCpuCores, double? sourceMemoryInMegaBytes, string targetVmName, ResourceIdentifier targetResourceGroupId, ResourceIdentifier storageContainerId, string hyperVGeneration, string targetNetworkId, string testNetworkId, int? targetCpuCores, bool? isDynamicRam, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig, int? targetMemoryInMegaBytes, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, string sourceApplianceName, string targetApplianceName, string osType, string osName, string firmwareType, string targetLocation, string customLocationRegion, string failoverRecoveryPointId, DateTimeOffset? lastRecoveryPointReceivedOn, string lastRecoveryPointId, int? initialReplicationProgressPercentage, int? resyncProgressPercentage, IReadOnlyList protectedDisks, IReadOnlyList protectedNics, string targetVmBiosId, DateTimeOffset? lastReplicationUpdateOn) : base(instanceType, serializedAdditionalRawData) + { + ActiveLocation = activeLocation; + TargetHciClusterId = targetHciClusterId; + TargetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + TargetAzStackHciClusterName = targetAzStackHciClusterName; + FabricDiscoveryMachineId = fabricDiscoveryMachineId; + DisksToInclude = disksToInclude; + NicsToInclude = nicsToInclude; + SourceVmName = sourceVmName; + SourceCpuCores = sourceCpuCores; + SourceMemoryInMegaBytes = sourceMemoryInMegaBytes; + TargetVmName = targetVmName; + TargetResourceGroupId = targetResourceGroupId; + StorageContainerId = storageContainerId; + HyperVGeneration = hyperVGeneration; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + TargetCpuCores = targetCpuCores; + IsDynamicRam = isDynamicRam; + DynamicMemoryConfig = dynamicMemoryConfig; + TargetMemoryInMegaBytes = targetMemoryInMegaBytes; + RunAsAccountId = runAsAccountId; + SourceFabricAgentName = sourceFabricAgentName; + TargetFabricAgentName = targetFabricAgentName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + OSType = osType; + OSName = osName; + FirmwareType = firmwareType; + TargetLocation = targetLocation; + CustomLocationRegion = customLocationRegion; + FailoverRecoveryPointId = failoverRecoveryPointId; + LastRecoveryPointReceivedOn = lastRecoveryPointReceivedOn; + LastRecoveryPointId = lastRecoveryPointId; + InitialReplicationProgressPercentage = initialReplicationProgressPercentage; + ResyncProgressPercentage = resyncProgressPercentage; + ProtectedDisks = protectedDisks; + ProtectedNics = protectedNics; + TargetVmBiosId = targetVmBiosId; + LastReplicationUpdateOn = lastReplicationUpdateOn; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHciProtectedItemCustomProperties() + { + } + + /// Gets or sets the location of the protected item. + public ProtectedItemActiveLocation? ActiveLocation { get; } + /// Gets or sets the Target HCI Cluster ARM Id. + public ResourceIdentifier TargetHciClusterId { get; set; } + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + public ResourceIdentifier TargetArcClusterCustomLocationId { get; set; } + /// Gets or sets the Target AzStackHCI cluster name. + public string TargetAzStackHciClusterName { get; } + /// Gets or sets the ARM Id of the discovered machine. + public ResourceIdentifier FabricDiscoveryMachineId { get; set; } + /// Gets or sets the list of disks to replicate. + public IList DisksToInclude { get; } + /// Gets or sets the list of VM NIC to replicate. + public IList NicsToInclude { get; } + /// Gets or sets the source VM display name. + public string SourceVmName { get; } + /// Gets or sets the source VM CPU cores. + public int? SourceCpuCores { get; } + /// Gets or sets the source VM ram memory size in megabytes. + public double? SourceMemoryInMegaBytes { get; } + /// Gets or sets the target VM display name. + public string TargetVmName { get; set; } + /// Gets or sets the target resource group ARM Id. + public ResourceIdentifier TargetResourceGroupId { get; set; } + /// Gets or sets the target storage container ARM Id. + public ResourceIdentifier StorageContainerId { get; set; } + /// Gets or sets the hypervisor generation of the virtual machine. + public string HyperVGeneration { get; set; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; set; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; set; } + /// Gets or sets the target CPU cores. + public int? TargetCpuCores { get; set; } + /// Gets or sets a value indicating whether memory is dynamical. + public bool? IsDynamicRam { get; set; } + /// Protected item dynamic memory config. + public ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get; set; } + /// Gets or sets the target memory in mega-bytes. + public int? TargetMemoryInMegaBytes { get; set; } + /// Gets or sets the Run As account Id. + public string RunAsAccountId { get; set; } + /// Gets or sets the source fabric agent name. + public string SourceFabricAgentName { get; set; } + /// Gets or sets the target fabric agent name. + public string TargetFabricAgentName { get; set; } + /// Gets or sets the source appliance name. + public string SourceApplianceName { get; } + /// Gets or sets the target appliance name. + public string TargetApplianceName { get; } + /// Gets or sets the type of the OS. + public string OSType { get; } + /// Gets or sets the name of the OS. + public string OSName { get; } + /// Gets or sets the firmware type. + public string FirmwareType { get; } + /// Gets or sets the target location. + public string TargetLocation { get; } + /// Gets or sets the location of Azure Arc HCI custom location resource. + public string CustomLocationRegion { get; set; } + /// Gets or sets the recovery point Id to which the VM was failed over. + public string FailoverRecoveryPointId { get; } + /// Gets or sets the last recovery point received time. + public DateTimeOffset? LastRecoveryPointReceivedOn { get; } + /// Gets or sets the last recovery point Id. + public string LastRecoveryPointId { get; } + /// Gets or sets the initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + public int? InitialReplicationProgressPercentage { get; } + /// Gets or sets the resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + public int? ResyncProgressPercentage { get; } + /// Gets or sets the list of protected disks. + public IReadOnlyList ProtectedDisks { get; } + /// Gets or sets the VM NIC details. + public IReadOnlyList ProtectedNics { get; } + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + public string TargetVmBiosId { get; } + /// Gets or sets the latest timestamp that replication status is updated. + public DateTimeOffset? LastReplicationUpdateOn { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..5f3cf7509520 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciProtectedItemCustomPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(NicsToInclude)) + { + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(TargetCpuCores)) + { + writer.WritePropertyName("targetCpuCores"u8); + writer.WriteNumberValue(TargetCpuCores.Value); + } + if (Optional.IsDefined(IsDynamicRam)) + { + writer.WritePropertyName("isDynamicRam"u8); + writer.WriteBooleanValue(IsDynamicRam.Value); + } + if (Optional.IsDefined(DynamicMemoryConfig)) + { + writer.WritePropertyName("dynamicMemoryConfig"u8); + writer.WriteObjectValue(DynamicMemoryConfig, options); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + if (Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType); + } + } + + HyperVToAzStackHciProtectedItemCustomPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + + internal static HyperVToAzStackHciProtectedItemCustomPropertiesUpdate DeserializeHyperVToAzStackHciProtectedItemCustomPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList nicsToInclude = default; + int? targetCpuCores = default; + bool? isDynamicRam = default; + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = default; + int? targetMemoryInMegaBytes = default; + string osType = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicsToInclude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(HyperVToAzStackHciNicInput.DeserializeHyperVToAzStackHciNicInput(item, options)); + } + nicsToInclude = array; + continue; + } + if (property.NameEquals("targetCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isDynamicRam"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamicRam = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dynamicMemoryConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicMemoryConfig = ProtectedItemDynamicMemoryConfig.DeserializeProtectedItemDynamicMemoryConfig(property.Value, options); + continue; + } + if (property.NameEquals("targetMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetMemoryInMegaBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("osType"u8)) + { + osType = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciProtectedItemCustomPropertiesUpdate( + instanceType, + serializedAdditionalRawData, + nicsToInclude ?? new ChangeTrackingList(), + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + osType); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciProtectedItemCustomPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.cs new file mode 100644 index 000000000000..60ddff5d5d04 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedItemCustomPropertiesUpdate.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI Protected item model custom properties. + public partial class HyperVToAzStackHciProtectedItemCustomPropertiesUpdate : DataReplicationProtectedItemCustomPropertiesUpdate + { + /// Initializes a new instance of . + public HyperVToAzStackHciProtectedItemCustomPropertiesUpdate() + { + NicsToInclude = new ChangeTrackingList(); + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomPropertiesUpdate. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the type of the OS. + internal HyperVToAzStackHciProtectedItemCustomPropertiesUpdate(string instanceType, IDictionary serializedAdditionalRawData, IList nicsToInclude, int? targetCpuCores, bool? isDynamicRam, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig, int? targetMemoryInMegaBytes, string osType) : base(instanceType, serializedAdditionalRawData) + { + NicsToInclude = nicsToInclude; + TargetCpuCores = targetCpuCores; + IsDynamicRam = isDynamicRam; + DynamicMemoryConfig = dynamicMemoryConfig; + TargetMemoryInMegaBytes = targetMemoryInMegaBytes; + OSType = osType; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Gets or sets the list of VM NIC to replicate. + public IList NicsToInclude { get; } + /// Gets or sets the target CPU cores. + public int? TargetCpuCores { get; set; } + /// Gets or sets a value indicating whether memory is dynamical. + public bool? IsDynamicRam { get; set; } + /// Protected item dynamic memory config. + public ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get; set; } + /// Gets or sets the target memory in mega-bytes. + public int? TargetMemoryInMegaBytes { get; set; } + /// Gets or sets the type of the OS. + public string OSType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedNicProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedNicProperties.Serialization.cs new file mode 100644 index 000000000000..73c7e718fca8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedNicProperties.Serialization.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciProtectedNicProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedNicProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(NicId)) + { + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + } + if (options.Format != "W" && Optional.IsDefined(MacAddress)) + { + writer.WritePropertyName("macAddress"u8); + writer.WriteStringValue(MacAddress); + } + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (options.Format != "W" && Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (options.Format != "W" && Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + if (options.Format != "W" && Optional.IsDefined(SelectionTypeForFailover)) + { + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + HyperVToAzStackHciProtectedNicProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedNicProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciProtectedNicProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciProtectedNicProperties DeserializeHyperVToAzStackHciProtectedNicProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + string macAddress = default; + string networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection? selectionTypeForFailover = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicId"u8)) + { + nicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("macAddress"u8)) + { + macAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("selectionTypeForFailover"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selectionTypeForFailover = new VmNicSelection(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciProtectedNicProperties( + nicId, + macAddress, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedNicProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciProtectedNicProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciProtectedNicProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciProtectedNicProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedNicProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedNicProperties.cs new file mode 100644 index 000000000000..0d997349cd48 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciProtectedNicProperties.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperVToAzStackHCI NIC properties. + public partial class HyperVToAzStackHciProtectedNicProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal HyperVToAzStackHciProtectedNicProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC mac address. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// Keeps track of any properties unknown to the library. + internal HyperVToAzStackHciProtectedNicProperties(string nicId, string macAddress, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection? selectionTypeForFailover, IDictionary serializedAdditionalRawData) + { + NicId = nicId; + MacAddress = macAddress; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the NIC Id. + public string NicId { get; } + /// Gets or sets the NIC mac address. + public string MacAddress { get; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; } + /// Gets or sets the selection type of the NIC. + public VmNicSelection? SelectionTypeForFailover { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.Serialization.cs new file mode 100644 index 000000000000..c0f9e7e449e8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciRecoveryPointCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciRecoveryPointCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsCollectionDefined(DiskIds)) + { + writer.WritePropertyName("diskIds"u8); + writer.WriteStartArray(); + foreach (var item in DiskIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + HyperVToAzStackHciRecoveryPointCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciRecoveryPointCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciRecoveryPointCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciRecoveryPointCustomProperties DeserializeHyperVToAzStackHciRecoveryPointCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList diskIds = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + diskIds = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciRecoveryPointCustomProperties(instanceType, serializedAdditionalRawData, diskIds ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciRecoveryPointCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciRecoveryPointCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciRecoveryPointCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciRecoveryPointCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.cs new file mode 100644 index 000000000000..423a260e63f5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciRecoveryPointCustomProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI recovery point model custom properties. + public partial class HyperVToAzStackHciRecoveryPointCustomProperties : DataReplicationRecoveryPointCustomProperties + { + /// Initializes a new instance of . + internal HyperVToAzStackHciRecoveryPointCustomProperties() + { + DiskIds = new ChangeTrackingList(); + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationRecoveryPointCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the list of the disk Ids. + internal HyperVToAzStackHciRecoveryPointCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, IReadOnlyList diskIds) : base(instanceType, serializedAdditionalRawData) + { + DiskIds = diskIds; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Gets or sets the list of the disk Ids. + public IReadOnlyList DiskIds { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.Serialization.cs new file mode 100644 index 000000000000..f71a81c02712 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.Serialization.cs @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class HyperVToAzStackHciReplicationExtensionCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciReplicationExtensionCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("hyperVFabricArmId"u8); + writer.WriteStringValue(HyperVFabricArmId); + if (options.Format != "W" && Optional.IsDefined(HyperVSiteId)) + { + writer.WritePropertyName("hyperVSiteId"u8); + writer.WriteStringValue(HyperVSiteId); + } + writer.WritePropertyName("azStackHciFabricArmId"u8); + writer.WriteStringValue(AzStackHciFabricArmId); + if (options.Format != "W" && Optional.IsDefined(AzStackHciSiteId)) + { + writer.WritePropertyName("azStackHciSiteId"u8); + writer.WriteStringValue(AzStackHciSiteId); + } + if (Optional.IsDefined(StorageAccountId)) + { + writer.WritePropertyName("storageAccountId"u8); + writer.WriteStringValue(StorageAccountId); + } + if (Optional.IsDefined(StorageAccountSasSecretName)) + { + writer.WritePropertyName("storageAccountSasSecretName"u8); + writer.WriteStringValue(StorageAccountSasSecretName); + } + if (options.Format != "W" && Optional.IsDefined(AsrServiceUri)) + { + writer.WritePropertyName("asrServiceUri"u8); + writer.WriteStringValue(AsrServiceUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(RcmServiceUri)) + { + writer.WritePropertyName("rcmServiceUri"u8); + writer.WriteStringValue(RcmServiceUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(GatewayServiceUri)) + { + writer.WritePropertyName("gatewayServiceUri"u8); + writer.WriteStringValue(GatewayServiceUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(SourceGatewayServiceId)) + { + writer.WritePropertyName("sourceGatewayServiceId"u8); + writer.WriteStringValue(SourceGatewayServiceId); + } + if (options.Format != "W" && Optional.IsDefined(TargetGatewayServiceId)) + { + writer.WritePropertyName("targetGatewayServiceId"u8); + writer.WriteStringValue(TargetGatewayServiceId); + } + if (options.Format != "W" && Optional.IsDefined(SourceStorageContainerName)) + { + writer.WritePropertyName("sourceStorageContainerName"u8); + writer.WriteStringValue(SourceStorageContainerName); + } + if (options.Format != "W" && Optional.IsDefined(TargetStorageContainerName)) + { + writer.WritePropertyName("targetStorageContainerName"u8); + writer.WriteStringValue(TargetStorageContainerName); + } + if (options.Format != "W" && Optional.IsDefined(ResourceLocation)) + { + writer.WritePropertyName("resourceLocation"u8); + writer.WriteStringValue(ResourceLocation); + } + if (options.Format != "W" && Optional.IsDefined(SubscriptionId)) + { + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + } + if (options.Format != "W" && Optional.IsDefined(ResourceGroup)) + { + writer.WritePropertyName("resourceGroup"u8); + writer.WriteStringValue(ResourceGroup); + } + } + + HyperVToAzStackHciReplicationExtensionCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HyperVToAzStackHciReplicationExtensionCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHyperVToAzStackHciReplicationExtensionCustomProperties(document.RootElement, options); + } + + internal static HyperVToAzStackHciReplicationExtensionCustomProperties DeserializeHyperVToAzStackHciReplicationExtensionCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier hyperVFabricArmId = default; + ResourceIdentifier hyperVSiteId = default; + ResourceIdentifier azStackHciFabricArmId = default; + ResourceIdentifier azStackHciSiteId = default; + string storageAccountId = default; + string storageAccountSasSecretName = default; + Uri asrServiceUri = default; + Uri rcmServiceUri = default; + Uri gatewayServiceUri = default; + string sourceGatewayServiceId = default; + string targetGatewayServiceId = default; + string sourceStorageContainerName = default; + string targetStorageContainerName = default; + string resourceLocation = default; + string subscriptionId = default; + string resourceGroup = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hyperVFabricArmId"u8)) + { + hyperVFabricArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("hyperVSiteId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + hyperVSiteId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azStackHciFabricArmId"u8)) + { + azStackHciFabricArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azStackHciSiteId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azStackHciSiteId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageAccountId"u8)) + { + storageAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountSasSecretName"u8)) + { + storageAccountSasSecretName = property.Value.GetString(); + continue; + } + if (property.NameEquals("asrServiceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + asrServiceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("rcmServiceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rcmServiceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("gatewayServiceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gatewayServiceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceGatewayServiceId"u8)) + { + sourceGatewayServiceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetGatewayServiceId"u8)) + { + targetGatewayServiceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceStorageContainerName"u8)) + { + sourceStorageContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetStorageContainerName"u8)) + { + targetStorageContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceLocation"u8)) + { + resourceLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceGroup"u8)) + { + resourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HyperVToAzStackHciReplicationExtensionCustomProperties( + instanceType, + serializedAdditionalRawData, + hyperVFabricArmId, + hyperVSiteId, + azStackHciFabricArmId, + azStackHciSiteId, + storageAccountId, + storageAccountSasSecretName, + asrServiceUri, + rcmServiceUri, + gatewayServiceUri, + sourceGatewayServiceId, + targetGatewayServiceId, + sourceStorageContainerName, + targetStorageContainerName, + resourceLocation, + subscriptionId, + resourceGroup); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciReplicationExtensionCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + HyperVToAzStackHciReplicationExtensionCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHyperVToAzStackHciReplicationExtensionCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HyperVToAzStackHciReplicationExtensionCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.cs new file mode 100644 index 000000000000..ff1bc33be8dc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/HyperVToAzStackHciReplicationExtensionCustomProperties.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// HyperV to AzStackHCI Replication extension model custom properties. + public partial class HyperVToAzStackHciReplicationExtensionCustomProperties : DataReplicationExtensionCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the source HyperV fabric. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// or is null. + public HyperVToAzStackHciReplicationExtensionCustomProperties(ResourceIdentifier hyperVFabricArmId, ResourceIdentifier azStackHciFabricArmId) + { + Argument.AssertNotNull(hyperVFabricArmId, nameof(hyperVFabricArmId)); + Argument.AssertNotNull(azStackHciFabricArmId, nameof(azStackHciFabricArmId)); + + HyperVFabricArmId = hyperVFabricArmId; + AzStackHciFabricArmId = azStackHciFabricArmId; + InstanceType = "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationExtensionCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the ARM Id of the source HyperV fabric. + /// Gets or sets the ARM Id of the HyperV site. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the storage account Id. + /// Gets or sets the Sas Secret of storage account. + /// Gets or sets the Uri of ASR. + /// Gets or sets the Uri of Rcm. + /// Gets or sets the Uri of Gateway. + /// Gets or sets the gateway service Id of source. + /// Gets or sets the gateway service Id of target. + /// Gets or sets the source storage container name. + /// Gets or sets the target storage container name. + /// Gets or sets the resource location. + /// Gets or sets the subscription. + /// Gets or sets the resource group. + internal HyperVToAzStackHciReplicationExtensionCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier hyperVFabricArmId, ResourceIdentifier hyperVSiteId, ResourceIdentifier azStackHciFabricArmId, ResourceIdentifier azStackHciSiteId, string storageAccountId, string storageAccountSasSecretName, Uri asrServiceUri, Uri rcmServiceUri, Uri gatewayServiceUri, string sourceGatewayServiceId, string targetGatewayServiceId, string sourceStorageContainerName, string targetStorageContainerName, string resourceLocation, string subscriptionId, string resourceGroup) : base(instanceType, serializedAdditionalRawData) + { + HyperVFabricArmId = hyperVFabricArmId; + HyperVSiteId = hyperVSiteId; + AzStackHciFabricArmId = azStackHciFabricArmId; + AzStackHciSiteId = azStackHciSiteId; + StorageAccountId = storageAccountId; + StorageAccountSasSecretName = storageAccountSasSecretName; + AsrServiceUri = asrServiceUri; + RcmServiceUri = rcmServiceUri; + GatewayServiceUri = gatewayServiceUri; + SourceGatewayServiceId = sourceGatewayServiceId; + TargetGatewayServiceId = targetGatewayServiceId; + SourceStorageContainerName = sourceStorageContainerName; + TargetStorageContainerName = targetStorageContainerName; + ResourceLocation = resourceLocation; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + InstanceType = instanceType ?? "HyperVToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal HyperVToAzStackHciReplicationExtensionCustomProperties() + { + } + + /// Gets or sets the ARM Id of the source HyperV fabric. + public ResourceIdentifier HyperVFabricArmId { get; set; } + /// Gets or sets the ARM Id of the HyperV site. + public ResourceIdentifier HyperVSiteId { get; } + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + public ResourceIdentifier AzStackHciFabricArmId { get; set; } + /// Gets or sets the ARM Id of the AzStackHCI site. + public ResourceIdentifier AzStackHciSiteId { get; } + /// Gets or sets the storage account Id. + public string StorageAccountId { get; set; } + /// Gets or sets the Sas Secret of storage account. + public string StorageAccountSasSecretName { get; set; } + /// Gets or sets the Uri of ASR. + public Uri AsrServiceUri { get; } + /// Gets or sets the Uri of Rcm. + public Uri RcmServiceUri { get; } + /// Gets or sets the Uri of Gateway. + public Uri GatewayServiceUri { get; } + /// Gets or sets the gateway service Id of source. + public string SourceGatewayServiceId { get; } + /// Gets or sets the gateway service Id of target. + public string TargetGatewayServiceId { get; } + /// Gets or sets the source storage container name. + public string SourceStorageContainerName { get; } + /// Gets or sets the target storage container name. + public string TargetStorageContainerName { get; } + /// Gets or sets the resource location. + public string ResourceLocation { get; } + /// Gets or sets the subscription. + public string SubscriptionId { get; } + /// Gets or sets the resource group. + public string ResourceGroup { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.Serialization.cs new file mode 100644 index 000000000000..5028f9cead8d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.Serialization.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class JobModelCustomPropertiesAffectedObjectDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobModelCustomPropertiesAffectedObjectDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + JobModelCustomPropertiesAffectedObjectDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobModelCustomPropertiesAffectedObjectDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJobModelCustomPropertiesAffectedObjectDetails(document.RootElement, options); + } + + internal static JobModelCustomPropertiesAffectedObjectDetails DeserializeJobModelCustomPropertiesAffectedObjectDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string description = default; + JobModelCustomPropertiesAffectedObjectDetailsType? type = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new JobModelCustomPropertiesAffectedObjectDetailsType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new JobModelCustomPropertiesAffectedObjectDetails(description, type, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(JobModelCustomPropertiesAffectedObjectDetails)} does not support writing '{options.Format}' format."); + } + } + + JobModelCustomPropertiesAffectedObjectDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeJobModelCustomPropertiesAffectedObjectDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JobModelCustomPropertiesAffectedObjectDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.cs new file mode 100644 index 000000000000..f164407b0c96 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetails.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The JobModelCustomPropertiesAffectedObjectDetails. + public partial class JobModelCustomPropertiesAffectedObjectDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal JobModelCustomPropertiesAffectedObjectDetails() + { + } + + /// Initializes a new instance of . + /// + /// + /// Keeps track of any properties unknown to the library. + internal JobModelCustomPropertiesAffectedObjectDetails(string description, JobModelCustomPropertiesAffectedObjectDetailsType? type, IDictionary serializedAdditionalRawData) + { + Description = description; + Type = type; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the description. + public string Description { get; } + /// Gets the type. + public JobModelCustomPropertiesAffectedObjectDetailsType? Type { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetailsType.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetailsType.cs new file mode 100644 index 000000000000..fbc06c6e77d8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelCustomPropertiesAffectedObjectDetailsType.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The JobModelCustomPropertiesAffectedObjectDetails_type. + public readonly partial struct JobModelCustomPropertiesAffectedObjectDetailsType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public JobModelCustomPropertiesAffectedObjectDetailsType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ObjectValue = "object"; + + /// object. + public static JobModelCustomPropertiesAffectedObjectDetailsType Object { get; } = new JobModelCustomPropertiesAffectedObjectDetailsType(ObjectValue); + /// Determines if two values are the same. + public static bool operator ==(JobModelCustomPropertiesAffectedObjectDetailsType left, JobModelCustomPropertiesAffectedObjectDetailsType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(JobModelCustomPropertiesAffectedObjectDetailsType left, JobModelCustomPropertiesAffectedObjectDetailsType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator JobModelCustomPropertiesAffectedObjectDetailsType(string value) => new JobModelCustomPropertiesAffectedObjectDetailsType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is JobModelCustomPropertiesAffectedObjectDetailsType other && Equals(other); + /// + public bool Equals(JobModelCustomPropertiesAffectedObjectDetailsType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.Serialization.cs new file mode 100644 index 000000000000..83104fa0093d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class JobModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + JobModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(JobModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeJobModelListResult(document.RootElement, options); + } + + internal static JobModelListResult DeserializeJobModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationJobData.DeserializeDataReplicationJobData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new JobModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(JobModelListResult)} does not support writing '{options.Format}' format."); + } + } + + JobModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeJobModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(JobModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.cs new file mode 100644 index 000000000000..a7ada724de79 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/JobModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a JobModel list operation. + internal partial class JobModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The JobModel items on this page. + /// is null. + internal JobModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The JobModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal JobModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal JobModelListResult() + { + } + + /// The JobModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.Serialization.cs new file mode 100644 index 000000000000..f56d77a276e1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class PlannedFailover : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailover)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlannedFailover IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailover)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlannedFailover(document.RootElement, options); + } + + internal static PlannedFailover DeserializePlannedFailover(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PlannedFailoverProperties properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + properties = PlannedFailoverProperties.DeserializePlannedFailoverProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PlannedFailover(properties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PlannedFailover)} does not support writing '{options.Format}' format."); + } + } + + PlannedFailover IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePlannedFailover(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlannedFailover)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.cs new file mode 100644 index 000000000000..b63eeed155b3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailover.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Planned failover model. + public partial class PlannedFailover + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Planned failover model properties. + /// is null. + public PlannedFailover(PlannedFailoverProperties properties) + { + Argument.AssertNotNull(properties, nameof(properties)); + + Properties = properties; + } + + /// Initializes a new instance of . + /// Planned failover model properties. + /// Keeps track of any properties unknown to the library. + internal PlannedFailover(PlannedFailoverProperties properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PlannedFailover() + { + } + + /// Planned failover model properties. + internal PlannedFailoverProperties Properties { get; set; } + /// + /// Planned failover model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public PlannedFailoverCustomProperties PlannedFailoverCustomProperties + { + get => Properties is null ? default : Properties.CustomProperties; + set => Properties = new PlannedFailoverProperties(value); + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.Serialization.cs new file mode 100644 index 000000000000..b09b8986ccfa --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + [PersistableModelProxy(typeof(UnknownPlannedFailoverCustomProperties))] + public partial class PlannedFailoverCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("instanceType"u8); + writer.WriteStringValue(InstanceType); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlannedFailoverCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlannedFailoverCustomProperties(document.RootElement, options); + } + + internal static PlannedFailoverCustomProperties DeserializePlannedFailoverCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("instanceType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "HyperVToAzStackHCI": return HyperVToAzStackHciPlannedFailoverCustomProperties.DeserializeHyperVToAzStackHciPlannedFailoverCustomProperties(element, options); + case "VMwareToAzStackHCI": return VMwareToAzStackHciPlannedFailoverCustomProperties.DeserializeVMwareToAzStackHciPlannedFailoverCustomProperties(element, options); + } + } + return UnknownPlannedFailoverCustomProperties.DeserializeUnknownPlannedFailoverCustomProperties(element, options); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + PlannedFailoverCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePlannedFailoverCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.cs new file mode 100644 index 000000000000..f1d984795625 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverCustomProperties.cs @@ -0,0 +1,69 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// + /// Planned failover model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class PlannedFailoverCustomProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private protected IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + protected PlannedFailoverCustomProperties() + { + } + + /// Initializes a new instance of . + /// Discriminator property for PlannedFailoverCustomProperties. + /// Keeps track of any properties unknown to the library. + internal PlannedFailoverCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) + { + InstanceType = instanceType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Discriminator property for PlannedFailoverCustomProperties. + internal string InstanceType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.Serialization.cs new file mode 100644 index 000000000000..367a27412cc7 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class PlannedFailoverProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("customProperties"u8); + writer.WriteObjectValue(CustomProperties, options); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PlannedFailoverProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlannedFailoverProperties(document.RootElement, options); + } + + internal static PlannedFailoverProperties DeserializePlannedFailoverProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + PlannedFailoverCustomProperties customProperties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("customProperties"u8)) + { + customProperties = PlannedFailoverCustomProperties.DeserializePlannedFailoverCustomProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PlannedFailoverProperties(customProperties, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PlannedFailoverProperties)} does not support writing '{options.Format}' format."); + } + } + + PlannedFailoverProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePlannedFailoverProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlannedFailoverProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.cs new file mode 100644 index 000000000000..288367ca8ed5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PlannedFailoverProperties.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Planned failover model properties. + public partial class PlannedFailoverProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Planned failover model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// is null. + public PlannedFailoverProperties(PlannedFailoverCustomProperties customProperties) + { + Argument.AssertNotNull(customProperties, nameof(customProperties)); + + CustomProperties = customProperties; + } + + /// Initializes a new instance of . + /// + /// Planned failover model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + /// Keeps track of any properties unknown to the library. + internal PlannedFailoverProperties(PlannedFailoverCustomProperties customProperties, IDictionary serializedAdditionalRawData) + { + CustomProperties = customProperties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PlannedFailoverProperties() + { + } + + /// + /// Planned failover model custom properties. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public PlannedFailoverCustomProperties CustomProperties { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.Serialization.cs new file mode 100644 index 000000000000..c0eb5ee33040 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class PolicyModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PolicyModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PolicyModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PolicyModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePolicyModelListResult(document.RootElement, options); + } + + internal static PolicyModelListResult DeserializePolicyModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPolicyData.DeserializeDataReplicationPolicyData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PolicyModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PolicyModelListResult)} does not support writing '{options.Format}' format."); + } + } + + PolicyModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePolicyModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PolicyModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.cs new file mode 100644 index 000000000000..d4fceabe846d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PolicyModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a PolicyModel list operation. + internal partial class PolicyModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The PolicyModel items on this page. + /// is null. + internal PolicyModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PolicyModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal PolicyModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PolicyModelListResult() + { + } + + /// The PolicyModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.Serialization.cs new file mode 100644 index 000000000000..ff41b8c8b205 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class PrivateEndpointConnectionProxyListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + PrivateEndpointConnectionProxyListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePrivateEndpointConnectionProxyListResult(document.RootElement, options); + } + + internal static PrivateEndpointConnectionProxyListResult DeserializePrivateEndpointConnectionProxyListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new PrivateEndpointConnectionProxyListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyListResult)} does not support writing '{options.Format}' format."); + } + } + + PrivateEndpointConnectionProxyListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePrivateEndpointConnectionProxyListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PrivateEndpointConnectionProxyListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.cs new file mode 100644 index 000000000000..be2432e6561c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/PrivateEndpointConnectionProxyListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a PrivateEndpointConnectionProxy list operation. + internal partial class PrivateEndpointConnectionProxyListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The PrivateEndpointConnectionProxy items on this page. + /// is null. + internal PrivateEndpointConnectionProxyListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PrivateEndpointConnectionProxy items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal PrivateEndpointConnectionProxyListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal PrivateEndpointConnectionProxyListResult() + { + } + + /// The PrivateEndpointConnectionProxy items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemActiveLocation.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemActiveLocation.cs new file mode 100644 index 000000000000..e7fb5c914aed --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemActiveLocation.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the location of the protected item. + public readonly partial struct ProtectedItemActiveLocation : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ProtectedItemActiveLocation(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PrimaryValue = "Primary"; + private const string RecoveryValue = "Recovery"; + + /// Protected item is active on Primary. + public static ProtectedItemActiveLocation Primary { get; } = new ProtectedItemActiveLocation(PrimaryValue); + /// Protected item is active on Recovery. + public static ProtectedItemActiveLocation Recovery { get; } = new ProtectedItemActiveLocation(RecoveryValue); + /// Determines if two values are the same. + public static bool operator ==(ProtectedItemActiveLocation left, ProtectedItemActiveLocation right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ProtectedItemActiveLocation left, ProtectedItemActiveLocation right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ProtectedItemActiveLocation(string value) => new ProtectedItemActiveLocation(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ProtectedItemActiveLocation other && Equals(other); + /// + public bool Equals(ProtectedItemActiveLocation other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.Serialization.cs new file mode 100644 index 000000000000..5198b18fdf6d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class ProtectedItemDynamicMemoryConfig : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemDynamicMemoryConfig)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("maximumMemoryInMegaBytes"u8); + writer.WriteNumberValue(MaximumMemoryInMegaBytes); + writer.WritePropertyName("minimumMemoryInMegaBytes"u8); + writer.WriteNumberValue(MinimumMemoryInMegaBytes); + writer.WritePropertyName("targetMemoryBufferPercentage"u8); + writer.WriteNumberValue(TargetMemoryBufferPercentage); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProtectedItemDynamicMemoryConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemDynamicMemoryConfig)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemDynamicMemoryConfig(document.RootElement, options); + } + + internal static ProtectedItemDynamicMemoryConfig DeserializeProtectedItemDynamicMemoryConfig(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long maximumMemoryInMegaBytes = default; + long minimumMemoryInMegaBytes = default; + int targetMemoryBufferPercentage = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("maximumMemoryInMegaBytes"u8)) + { + maximumMemoryInMegaBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("minimumMemoryInMegaBytes"u8)) + { + minimumMemoryInMegaBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("targetMemoryBufferPercentage"u8)) + { + targetMemoryBufferPercentage = property.Value.GetInt32(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProtectedItemDynamicMemoryConfig(maximumMemoryInMegaBytes, minimumMemoryInMegaBytes, targetMemoryBufferPercentage, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProtectedItemDynamicMemoryConfig)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemDynamicMemoryConfig IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProtectedItemDynamicMemoryConfig(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemDynamicMemoryConfig)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.cs new file mode 100644 index 000000000000..95f93ff06669 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemDynamicMemoryConfig.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item dynamic memory config. + public partial class ProtectedItemDynamicMemoryConfig + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets maximum memory in MB. + /// Gets or sets minimum memory in MB. + /// Gets or sets target memory buffer in %. + public ProtectedItemDynamicMemoryConfig(long maximumMemoryInMegaBytes, long minimumMemoryInMegaBytes, int targetMemoryBufferPercentage) + { + MaximumMemoryInMegaBytes = maximumMemoryInMegaBytes; + MinimumMemoryInMegaBytes = minimumMemoryInMegaBytes; + TargetMemoryBufferPercentage = targetMemoryBufferPercentage; + } + + /// Initializes a new instance of . + /// Gets or sets maximum memory in MB. + /// Gets or sets minimum memory in MB. + /// Gets or sets target memory buffer in %. + /// Keeps track of any properties unknown to the library. + internal ProtectedItemDynamicMemoryConfig(long maximumMemoryInMegaBytes, long minimumMemoryInMegaBytes, int targetMemoryBufferPercentage, IDictionary serializedAdditionalRawData) + { + MaximumMemoryInMegaBytes = maximumMemoryInMegaBytes; + MinimumMemoryInMegaBytes = minimumMemoryInMegaBytes; + TargetMemoryBufferPercentage = targetMemoryBufferPercentage; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProtectedItemDynamicMemoryConfig() + { + } + + /// Gets or sets maximum memory in MB. + public long MaximumMemoryInMegaBytes { get; set; } + /// Gets or sets minimum memory in MB. + public long MinimumMemoryInMegaBytes { get; set; } + /// Gets or sets target memory buffer in %. + public int TargetMemoryBufferPercentage { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.Serialization.cs new file mode 100644 index 000000000000..4b34b981b2aa --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class ProtectedItemJobProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemJobProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ScenarioName)) + { + writer.WritePropertyName("scenarioName"u8); + writer.WriteStringValue(ScenarioName); + } + if (options.Format != "W" && Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && Optional.IsDefined(DisplayName)) + { + writer.WritePropertyName("displayName"u8); + writer.WriteStringValue(DisplayName); + } + if (options.Format != "W" && Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State); + } + if (options.Format != "W" && Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProtectedItemJobProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemJobProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemJobProperties(document.RootElement, options); + } + + internal static ProtectedItemJobProperties DeserializeProtectedItemJobProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string scenarioName = default; + string id = default; + string name = default; + string displayName = default; + string state = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("scenarioName"u8)) + { + scenarioName = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("displayName"u8)) + { + displayName = property.Value.GetString(); + continue; + } + if (property.NameEquals("state"u8)) + { + state = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProtectedItemJobProperties( + scenarioName, + id, + name, + displayName, + state, + startTime, + endTime, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProtectedItemJobProperties)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemJobProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProtectedItemJobProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemJobProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.cs new file mode 100644 index 000000000000..f19142061375 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemJobProperties.cs @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Protected item job properties. + public partial class ProtectedItemJobProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal ProtectedItemJobProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets protection scenario name. + /// Gets or sets job Id. + /// Gets or sets job name. + /// Gets or sets the job friendly display name. + /// Gets or sets job state. + /// Gets or sets start time of the job. + /// Gets or sets end time of the job. + /// Keeps track of any properties unknown to the library. + internal ProtectedItemJobProperties(string scenarioName, string id, string name, string displayName, string state, DateTimeOffset? startOn, DateTimeOffset? endOn, IDictionary serializedAdditionalRawData) + { + ScenarioName = scenarioName; + Id = id; + Name = name; + DisplayName = displayName; + State = state; + StartOn = startOn; + EndOn = endOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets protection scenario name. + public string ScenarioName { get; } + /// Gets or sets job Id. + public string Id { get; } + /// Gets or sets job name. + public string Name { get; } + /// Gets or sets the job friendly display name. + public string DisplayName { get; } + /// Gets or sets job state. + public string State { get; } + /// Gets or sets start time of the job. + public DateTimeOffset? StartOn { get; } + /// Gets or sets end time of the job. + public DateTimeOffset? EndOn { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.Serialization.cs new file mode 100644 index 000000000000..f5b8d44b00cf --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class ProtectedItemModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ProtectedItemModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ProtectedItemModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeProtectedItemModelListResult(document.RootElement, options); + } + + internal static ProtectedItemModelListResult DeserializeProtectedItemModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationProtectedItemData.DeserializeDataReplicationProtectedItemData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ProtectedItemModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ProtectedItemModelListResult)} does not support writing '{options.Format}' format."); + } + } + + ProtectedItemModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeProtectedItemModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ProtectedItemModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.cs new file mode 100644 index 000000000000..572c7890028f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ProtectedItemModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a ProtectedItemModel list operation. + internal partial class ProtectedItemModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The ProtectedItemModel items on this page. + /// is null. + internal ProtectedItemModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ProtectedItemModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ProtectedItemModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ProtectedItemModelListResult() + { + } + + /// The ProtectedItemModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.Serialization.cs new file mode 100644 index 000000000000..2b0692979d79 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class RecoveryPointModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryPointModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RecoveryPointModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryPointModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryPointModelListResult(document.RootElement, options); + } + + internal static RecoveryPointModelListResult DeserializeRecoveryPointModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationRecoveryPointData.DeserializeDataReplicationRecoveryPointData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RecoveryPointModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RecoveryPointModelListResult)} does not support writing '{options.Format}' format."); + } + } + + RecoveryPointModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRecoveryPointModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryPointModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.cs new file mode 100644 index 000000000000..342601dba457 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryPointModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a RecoveryPointModel list operation. + internal partial class RecoveryPointModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The RecoveryPointModel items on this page. + /// is null. + internal RecoveryPointModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The RecoveryPointModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal RecoveryPointModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RecoveryPointModelListResult() + { + } + + /// The RecoveryPointModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.Serialization.cs new file mode 100644 index 000000000000..6f896b90e3a0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class RecoveryServicesDataReplicationPrivateEndpointConnectionListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateEndpointConnectionListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateEndpointConnectionListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement, options); + } + + internal static RecoveryServicesDataReplicationPrivateEndpointConnectionListResult DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RecoveryServicesDataReplicationPrivateEndpointConnectionListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateEndpointConnectionListResult)} does not support writing '{options.Format}' format."); + } + } + + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateEndpointConnectionListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.cs new file mode 100644 index 000000000000..f97dae4b52f0 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a PrivateEndpointConnection list operation. + internal partial class RecoveryServicesDataReplicationPrivateEndpointConnectionListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The PrivateEndpointConnection items on this page. + /// is null. + internal RecoveryServicesDataReplicationPrivateEndpointConnectionListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PrivateEndpointConnection items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal RecoveryServicesDataReplicationPrivateEndpointConnectionListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RecoveryServicesDataReplicationPrivateEndpointConnectionListResult() + { + } + + /// The PrivateEndpointConnection items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.Serialization.cs new file mode 100644 index 000000000000..1877f55107e3 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class RecoveryServicesDataReplicationPrivateLinkResourceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RecoveryServicesDataReplicationPrivateLinkResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement, options); + } + + internal static RecoveryServicesDataReplicationPrivateLinkResourceListResult DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPrivateLinkResourceData.DeserializeDataReplicationPrivateLinkResourceData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RecoveryServicesDataReplicationPrivateLinkResourceListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceListResult)} does not support writing '{options.Format}' format."); + } + } + + RecoveryServicesDataReplicationPrivateLinkResourceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RecoveryServicesDataReplicationPrivateLinkResourceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.cs new file mode 100644 index 000000000000..b5476f002771 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RecoveryServicesDataReplicationPrivateLinkResourceListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a PrivateLinkResource list operation. + internal partial class RecoveryServicesDataReplicationPrivateLinkResourceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The PrivateLinkResource items on this page. + /// is null. + internal RecoveryServicesDataReplicationPrivateLinkResourceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The PrivateLinkResource items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal RecoveryServicesDataReplicationPrivateLinkResourceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RecoveryServicesDataReplicationPrivateLinkResourceListResult() + { + } + + /// The PrivateLinkResource items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.Serialization.cs new file mode 100644 index 000000000000..d5c2e77c0cc8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.Serialization.cs @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class RemotePrivateEndpoint : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RemotePrivateEndpoint)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + if (Optional.IsCollectionDefined(PrivateLinkServiceConnections)) + { + writer.WritePropertyName("privateLinkServiceConnections"u8); + writer.WriteStartArray(); + foreach (var item in PrivateLinkServiceConnections) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ManualPrivateLinkServiceConnections)) + { + writer.WritePropertyName("manualPrivateLinkServiceConnections"u8); + writer.WriteStartArray(); + foreach (var item in ManualPrivateLinkServiceConnections) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(PrivateLinkServiceProxies)) + { + writer.WritePropertyName("privateLinkServiceProxies"u8); + writer.WriteStartArray(); + foreach (var item in PrivateLinkServiceProxies) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(ConnectionDetails)) + { + writer.WritePropertyName("connectionDetails"u8); + writer.WriteStartArray(); + foreach (var item in ConnectionDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RemotePrivateEndpoint IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RemotePrivateEndpoint)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRemotePrivateEndpoint(document.RootElement, options); + } + + internal static RemotePrivateEndpoint DeserializeRemotePrivateEndpoint(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + IList privateLinkServiceConnections = default; + IList manualPrivateLinkServiceConnections = default; + IList privateLinkServiceProxies = default; + IList connectionDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateLinkServiceConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPrivateLinkServiceConnection.DeserializeDataReplicationPrivateLinkServiceConnection(item, options)); + } + privateLinkServiceConnections = array; + continue; + } + if (property.NameEquals("manualPrivateLinkServiceConnections"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPrivateLinkServiceConnection.DeserializeDataReplicationPrivateLinkServiceConnection(item, options)); + } + manualPrivateLinkServiceConnections = array; + continue; + } + if (property.NameEquals("privateLinkServiceProxies"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationPrivateLinkServiceProxy.DeserializeDataReplicationPrivateLinkServiceProxy(item, options)); + } + privateLinkServiceProxies = array; + continue; + } + if (property.NameEquals("connectionDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(RemotePrivateEndpointConnectionDetails.DeserializeRemotePrivateEndpointConnectionDetails(item, options)); + } + connectionDetails = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RemotePrivateEndpoint( + id, + privateLinkServiceConnections ?? new ChangeTrackingList(), + manualPrivateLinkServiceConnections ?? new ChangeTrackingList(), + privateLinkServiceProxies ?? new ChangeTrackingList(), + connectionDetails ?? new ChangeTrackingList(), + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RemotePrivateEndpoint)} does not support writing '{options.Format}' format."); + } + } + + RemotePrivateEndpoint IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRemotePrivateEndpoint(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RemotePrivateEndpoint)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.cs new file mode 100644 index 000000000000..9522d06a8c7b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpoint.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Represent remote private endpoint information for the private endpoint connection proxy. + public partial class RemotePrivateEndpoint + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets private link service proxy id. + /// is null. + public RemotePrivateEndpoint(string id) + { + Argument.AssertNotNull(id, nameof(id)); + + Id = id; + PrivateLinkServiceConnections = new ChangeTrackingList(); + ManualPrivateLinkServiceConnections = new ChangeTrackingList(); + PrivateLinkServiceProxies = new ChangeTrackingList(); + ConnectionDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets or sets private link service proxy id. + /// Gets or sets the list of Private Link Service Connections and gets populated for Auto approval flow. + /// Gets or sets the list of Manual Private Link Service Connections and gets populated for Manual approval flow. + /// Gets or sets the list of private link service proxies. + /// Gets or sets the list of Connection Details. This is the connection details for private endpoint. + /// Keeps track of any properties unknown to the library. + internal RemotePrivateEndpoint(string id, IList privateLinkServiceConnections, IList manualPrivateLinkServiceConnections, IList privateLinkServiceProxies, IList connectionDetails, IDictionary serializedAdditionalRawData) + { + Id = id; + PrivateLinkServiceConnections = privateLinkServiceConnections; + ManualPrivateLinkServiceConnections = manualPrivateLinkServiceConnections; + PrivateLinkServiceProxies = privateLinkServiceProxies; + ConnectionDetails = connectionDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal RemotePrivateEndpoint() + { + } + + /// Gets or sets private link service proxy id. + public string Id { get; set; } + /// Gets or sets the list of Private Link Service Connections and gets populated for Auto approval flow. + public IList PrivateLinkServiceConnections { get; } + /// Gets or sets the list of Manual Private Link Service Connections and gets populated for Manual approval flow. + public IList ManualPrivateLinkServiceConnections { get; } + /// Gets or sets the list of private link service proxies. + public IList PrivateLinkServiceProxies { get; } + /// Gets or sets the list of Connection Details. This is the connection details for private endpoint. + public IList ConnectionDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.Serialization.cs new file mode 100644 index 000000000000..ab0eb402548b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.Serialization.cs @@ -0,0 +1,179 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class RemotePrivateEndpointConnectionDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RemotePrivateEndpointConnectionDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(PrivateIPAddress)) + { + writer.WritePropertyName("privateIpAddress"u8); + writer.WriteStringValue(PrivateIPAddress); + } + if (Optional.IsDefined(LinkIdentifier)) + { + writer.WritePropertyName("linkIdentifier"u8); + writer.WriteStringValue(LinkIdentifier); + } + if (Optional.IsDefined(GroupId)) + { + writer.WritePropertyName("groupId"u8); + writer.WriteStringValue(GroupId); + } + if (Optional.IsDefined(MemberName)) + { + writer.WritePropertyName("memberName"u8); + writer.WriteStringValue(MemberName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + RemotePrivateEndpointConnectionDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(RemotePrivateEndpointConnectionDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeRemotePrivateEndpointConnectionDetails(document.RootElement, options); + } + + internal static RemotePrivateEndpointConnectionDetails DeserializeRemotePrivateEndpointConnectionDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string privateIPAddress = default; + string linkIdentifier = default; + string groupId = default; + string memberName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateIpAddress"u8)) + { + privateIPAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("linkIdentifier"u8)) + { + linkIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("groupId"u8)) + { + groupId = property.Value.GetString(); + continue; + } + if (property.NameEquals("memberName"u8)) + { + memberName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new RemotePrivateEndpointConnectionDetails( + id, + privateIPAddress, + linkIdentifier, + groupId, + memberName, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(RemotePrivateEndpointConnectionDetails)} does not support writing '{options.Format}' format."); + } + } + + RemotePrivateEndpointConnectionDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeRemotePrivateEndpointConnectionDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(RemotePrivateEndpointConnectionDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.cs new file mode 100644 index 000000000000..0337de2a5360 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/RemotePrivateEndpointConnectionDetails.cs @@ -0,0 +1,81 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Private endpoint connection details at member level. + public partial class RemotePrivateEndpointConnectionDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + public RemotePrivateEndpointConnectionDetails() + { + } + + /// Initializes a new instance of . + /// Gets or sets id. + /// Gets or sets private IP address. + /// Gets or sets link identifier. + /// Gets or sets group id. + /// Gets or sets member name. + /// Keeps track of any properties unknown to the library. + internal RemotePrivateEndpointConnectionDetails(string id, string privateIPAddress, string linkIdentifier, string groupId, string memberName, IDictionary serializedAdditionalRawData) + { + Id = id; + PrivateIPAddress = privateIPAddress; + LinkIdentifier = linkIdentifier; + GroupId = groupId; + MemberName = memberName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets id. + public string Id { get; set; } + /// Gets or sets private IP address. + public string PrivateIPAddress { get; set; } + /// Gets or sets link identifier. + public string LinkIdentifier { get; set; } + /// Gets or sets group id. + public string GroupId { get; set; } + /// Gets or sets member name. + public string MemberName { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.Serialization.cs new file mode 100644 index 000000000000..ed0b3cfef7a9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class ReplicationExtensionModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicationExtensionModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ReplicationExtensionModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ReplicationExtensionModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeReplicationExtensionModelListResult(document.RootElement, options); + } + + internal static ReplicationExtensionModelListResult DeserializeReplicationExtensionModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationExtensionData.DeserializeDataReplicationExtensionData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ReplicationExtensionModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ReplicationExtensionModelListResult)} does not support writing '{options.Format}' format."); + } + } + + ReplicationExtensionModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeReplicationExtensionModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ReplicationExtensionModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.cs new file mode 100644 index 000000000000..c42257d5ea2e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/ReplicationExtensionModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a ReplicationExtensionModel list operation. + internal partial class ReplicationExtensionModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The ReplicationExtensionModel items on this page. + /// is null. + internal ReplicationExtensionModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The ReplicationExtensionModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal ReplicationExtensionModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ReplicationExtensionModelListResult() + { + } + + /// The ReplicationExtensionModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.Serialization.cs new file mode 100644 index 000000000000..123d323ef6d2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class StorageContainerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StorageContainerProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + writer.WritePropertyName("clusterSharedVolumePath"u8); + writer.WriteStringValue(ClusterSharedVolumePath); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + StorageContainerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StorageContainerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageContainerProperties(document.RootElement, options); + } + + internal static StorageContainerProperties DeserializeStorageContainerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + string clusterSharedVolumePath = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("clusterSharedVolumePath"u8)) + { + clusterSharedVolumePath = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StorageContainerProperties(name, clusterSharedVolumePath, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(StorageContainerProperties)} does not support writing '{options.Format}' format."); + } + } + + StorageContainerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStorageContainerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageContainerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.cs new file mode 100644 index 000000000000..b1cd48805258 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/StorageContainerProperties.cs @@ -0,0 +1,82 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Storage container properties. + public partial class StorageContainerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the Name. + /// Gets or sets the ClusterSharedVolumePath. + /// or is null. + public StorageContainerProperties(string name, string clusterSharedVolumePath) + { + Argument.AssertNotNull(name, nameof(name)); + Argument.AssertNotNull(clusterSharedVolumePath, nameof(clusterSharedVolumePath)); + + Name = name; + ClusterSharedVolumePath = clusterSharedVolumePath; + } + + /// Initializes a new instance of . + /// Gets or sets the Name. + /// Gets or sets the ClusterSharedVolumePath. + /// Keeps track of any properties unknown to the library. + internal StorageContainerProperties(string name, string clusterSharedVolumePath, IDictionary serializedAdditionalRawData) + { + Name = name; + ClusterSharedVolumePath = clusterSharedVolumePath; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal StorageContainerProperties() + { + } + + /// Gets or sets the Name. + public string Name { get; set; } + /// Gets or sets the ClusterSharedVolumePath. + public string ClusterSharedVolumePath { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.Serialization.cs new file mode 100644 index 000000000000..e7888418ed31 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.Serialization.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class TestFailoverCleanupJobCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestFailoverCleanupJobCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(Comments)) + { + writer.WritePropertyName("comments"u8); + writer.WriteStringValue(Comments); + } + } + + TestFailoverCleanupJobCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestFailoverCleanupJobCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTestFailoverCleanupJobCustomProperties(document.RootElement, options); + } + + internal static TestFailoverCleanupJobCustomProperties DeserializeTestFailoverCleanupJobCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string comments = default; + string instanceType = default; + JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("comments"u8)) + { + comments = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedObjectDetails = JobModelCustomPropertiesAffectedObjectDetails.DeserializeJobModelCustomPropertiesAffectedObjectDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TestFailoverCleanupJobCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData, comments); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TestFailoverCleanupJobCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + TestFailoverCleanupJobCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTestFailoverCleanupJobCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TestFailoverCleanupJobCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.cs new file mode 100644 index 000000000000..8da682f17645 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverCleanupJobCustomProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Test failover cleanup job model custom properties. + public partial class TestFailoverCleanupJobCustomProperties : DataReplicationJobCustomProperties + { + /// Initializes a new instance of . + internal TestFailoverCleanupJobCustomProperties() + { + InstanceType = "TestFailoverCleanupJobDetails"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationJobCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the test failover cleanup comments. + internal TestFailoverCleanupJobCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData, string comments) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + Comments = comments; + InstanceType = instanceType ?? "TestFailoverCleanupJobDetails"; + } + + /// Gets or sets the test failover cleanup comments. + public string Comments { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.Serialization.cs new file mode 100644 index 000000000000..4f9f74ebc33b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.Serialization.cs @@ -0,0 +1,145 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class TestFailoverJobCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestFailoverJobCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedItemDetails)) + { + writer.WritePropertyName("protectedItemDetails"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedItemDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + } + + TestFailoverJobCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(TestFailoverJobCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeTestFailoverJobCustomProperties(document.RootElement, options); + } + + internal static TestFailoverJobCustomProperties DeserializeTestFailoverJobCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList protectedItemDetails = default; + string instanceType = default; + JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("protectedItemDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(FailoverProtectedItemProperties.DeserializeFailoverProtectedItemProperties(item, options)); + } + protectedItemDetails = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedObjectDetails = JobModelCustomPropertiesAffectedObjectDetails.DeserializeJobModelCustomPropertiesAffectedObjectDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new TestFailoverJobCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData, protectedItemDetails ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(TestFailoverJobCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + TestFailoverJobCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeTestFailoverJobCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(TestFailoverJobCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.cs new file mode 100644 index 000000000000..6d28f8b032b8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/TestFailoverJobCustomProperties.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Test failover job model custom properties. + public partial class TestFailoverJobCustomProperties : DataReplicationJobCustomProperties + { + /// Initializes a new instance of . + internal TestFailoverJobCustomProperties() + { + ProtectedItemDetails = new ChangeTrackingList(); + InstanceType = "TestFailoverJobDetails"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationJobCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the test VM details. + internal TestFailoverJobCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData, IReadOnlyList protectedItemDetails) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + ProtectedItemDetails = protectedItemDetails; + InstanceType = instanceType ?? "TestFailoverJobDetails"; + } + + /// Gets or sets the test VM details. + public IReadOnlyList ProtectedItemDetails { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.Serialization.cs new file mode 100644 index 000000000000..8b3f857552a2 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationEventCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationEventCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationEventCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationEventCustomProperties DeserializeUnknownDataReplicationEventCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationEventCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationEventCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationEventCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationEventCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.cs new file mode 100644 index 000000000000..ab737e790e79 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationEventCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationEventCustomProperties. + internal partial class UnknownDataReplicationEventCustomProperties : DataReplicationEventCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationEventCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationEventCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationEventCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.Serialization.cs new file mode 100644 index 000000000000..5c22d1ec72ae --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationExtensionCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationExtensionCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationExtensionCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationExtensionCustomProperties DeserializeUnknownDataReplicationExtensionCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationExtensionCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationExtensionCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationExtensionCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationExtensionCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.cs new file mode 100644 index 000000000000..4ee2b0074542 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationExtensionCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationExtensionCustomProperties. + internal partial class UnknownDataReplicationExtensionCustomProperties : DataReplicationExtensionCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationExtensionCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationExtensionCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationExtensionCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.Serialization.cs new file mode 100644 index 000000000000..cacd59c30927 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationFabricAgentCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationFabricAgentCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricAgentCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationFabricAgentCustomProperties DeserializeUnknownDataReplicationFabricAgentCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationFabricAgentCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricAgentCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricAgentCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricAgentCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.cs new file mode 100644 index 000000000000..d3bdbb783a48 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricAgentCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationFabricAgentCustomProperties. + internal partial class UnknownDataReplicationFabricAgentCustomProperties : DataReplicationFabricAgentCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricAgentCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationFabricAgentCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationFabricAgentCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.Serialization.cs new file mode 100644 index 000000000000..aed5d2c2005f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationFabricCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationFabricCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationFabricCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationFabricCustomProperties DeserializeUnknownDataReplicationFabricCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationFabricCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationFabricCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationFabricCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationFabricCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.cs new file mode 100644 index 000000000000..ac9d5ca7db1e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationFabricCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationFabricCustomProperties. + internal partial class UnknownDataReplicationFabricCustomProperties : DataReplicationFabricCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationFabricCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationFabricCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.Serialization.cs new file mode 100644 index 000000000000..d1769a51e84d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.Serialization.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationJobCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationJobCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationJobCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationJobCustomProperties DeserializeUnknownDataReplicationJobCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (property.NameEquals("affectedObjectDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + affectedObjectDetails = JobModelCustomPropertiesAffectedObjectDetails.DeserializeJobModelCustomPropertiesAffectedObjectDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationJobCustomProperties(instanceType, affectedObjectDetails, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationJobCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationJobCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationJobCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.cs new file mode 100644 index 000000000000..383e0c8382e5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationJobCustomProperties.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationJobCustomProperties. + internal partial class UnknownDataReplicationJobCustomProperties : DataReplicationJobCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationJobCustomProperties. + /// Gets or sets any custom properties of the affected object. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationJobCustomProperties(string instanceType, JobModelCustomPropertiesAffectedObjectDetails affectedObjectDetails, IDictionary serializedAdditionalRawData) : base(instanceType, affectedObjectDetails, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationJobCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.Serialization.cs new file mode 100644 index 000000000000..bf28fa7846ce --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationPolicyCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationPolicyCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationPolicyCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationPolicyCustomProperties DeserializeUnknownDataReplicationPolicyCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationPolicyCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationPolicyCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationPolicyCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationPolicyCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.cs new file mode 100644 index 000000000000..2bb868c42baa --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationPolicyCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationPolicyCustomProperties. + internal partial class UnknownDataReplicationPolicyCustomProperties : DataReplicationPolicyCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationPolicyCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationPolicyCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationPolicyCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.Serialization.cs new file mode 100644 index 000000000000..f763e047053e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationProtectedItemCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationProtectedItemCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationProtectedItemCustomProperties DeserializeUnknownDataReplicationProtectedItemCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationProtectedItemCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.cs new file mode 100644 index 000000000000..818ca7ce7472 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationProtectedItemCustomProperties. + internal partial class UnknownDataReplicationProtectedItemCustomProperties : DataReplicationProtectedItemCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationProtectedItemCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationProtectedItemCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..c45d443df947 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationProtectedItemCustomPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationProtectedItemCustomPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + + internal static UnknownDataReplicationProtectedItemCustomPropertiesUpdate DeserializeUnknownDataReplicationProtectedItemCustomPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationProtectedItemCustomPropertiesUpdate(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationProtectedItemCustomPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationProtectedItemCustomPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.cs new file mode 100644 index 000000000000..04e22418a734 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationProtectedItemCustomPropertiesUpdate.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationProtectedItemCustomPropertiesUpdate. + internal partial class UnknownDataReplicationProtectedItemCustomPropertiesUpdate : DataReplicationProtectedItemCustomPropertiesUpdate + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomPropertiesUpdate. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationProtectedItemCustomPropertiesUpdate(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationProtectedItemCustomPropertiesUpdate() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.Serialization.cs new file mode 100644 index 000000000000..867e6168973b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownDataReplicationRecoveryPointCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + DataReplicationRecoveryPointCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDataReplicationRecoveryPointCustomProperties(document.RootElement, options); + } + + internal static UnknownDataReplicationRecoveryPointCustomProperties DeserializeUnknownDataReplicationRecoveryPointCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownDataReplicationRecoveryPointCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + DataReplicationRecoveryPointCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDataReplicationRecoveryPointCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DataReplicationRecoveryPointCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.cs new file mode 100644 index 000000000000..73f536d6dcac --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownDataReplicationRecoveryPointCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of DataReplicationRecoveryPointCustomProperties. + internal partial class UnknownDataReplicationRecoveryPointCustomProperties : DataReplicationRecoveryPointCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for DataReplicationRecoveryPointCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownDataReplicationRecoveryPointCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownDataReplicationRecoveryPointCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.Serialization.cs new file mode 100644 index 000000000000..10751449a45f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class UnknownPlannedFailoverCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + PlannedFailoverCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializePlannedFailoverCustomProperties(document.RootElement, options); + } + + internal static UnknownPlannedFailoverCustomProperties DeserializeUnknownPlannedFailoverCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownPlannedFailoverCustomProperties(instanceType, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + PlannedFailoverCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializePlannedFailoverCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(PlannedFailoverCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.cs new file mode 100644 index 000000000000..d733e7e7d101 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/UnknownPlannedFailoverCustomProperties.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Unknown version of PlannedFailoverCustomProperties. + internal partial class UnknownPlannedFailoverCustomProperties : PlannedFailoverCustomProperties + { + /// Initializes a new instance of . + /// Discriminator property for PlannedFailoverCustomProperties. + /// Keeps track of any properties unknown to the library. + internal UnknownPlannedFailoverCustomProperties(string instanceType, IDictionary serializedAdditionalRawData) : base(instanceType, serializedAdditionalRawData) + { + InstanceType = instanceType ?? "Unknown"; + } + + /// Initializes a new instance of for deserialization. + internal UnknownPlannedFailoverCustomProperties() + { + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.Serialization.cs new file mode 100644 index 000000000000..180163d88a64 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareFabricAgentCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareFabricAgentCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("biosId"u8); + writer.WriteStringValue(BiosId); + writer.WritePropertyName("marsAuthenticationIdentity"u8); + writer.WriteObjectValue(MarsAuthenticationIdentity, options); + } + + VMwareFabricAgentCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareFabricAgentCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareFabricAgentCustomProperties(document.RootElement, options); + } + + internal static VMwareFabricAgentCustomProperties DeserializeVMwareFabricAgentCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string biosId = default; + DataReplicationIdentity marsAuthenticationIdentity = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("biosId"u8)) + { + biosId = property.Value.GetString(); + continue; + } + if (property.NameEquals("marsAuthenticationIdentity"u8)) + { + marsAuthenticationIdentity = DataReplicationIdentity.DeserializeDataReplicationIdentity(property.Value, options); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareFabricAgentCustomProperties(instanceType, serializedAdditionalRawData, biosId, marsAuthenticationIdentity); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareFabricAgentCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareFabricAgentCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareFabricAgentCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareFabricAgentCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.cs new file mode 100644 index 000000000000..45d542e0359d --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareFabricAgentCustomProperties.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware fabric agent model custom properties. + public partial class VMwareFabricAgentCustomProperties : DataReplicationFabricAgentCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the BIOS Id of the fabric agent machine. + /// Identity model. + /// or is null. + public VMwareFabricAgentCustomProperties(string biosId, DataReplicationIdentity marsAuthenticationIdentity) + { + Argument.AssertNotNull(biosId, nameof(biosId)); + Argument.AssertNotNull(marsAuthenticationIdentity, nameof(marsAuthenticationIdentity)); + + BiosId = biosId; + MarsAuthenticationIdentity = marsAuthenticationIdentity; + InstanceType = "VMware"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricAgentCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the BIOS Id of the fabric agent machine. + /// Identity model. + internal VMwareFabricAgentCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string biosId, DataReplicationIdentity marsAuthenticationIdentity) : base(instanceType, serializedAdditionalRawData) + { + BiosId = biosId; + MarsAuthenticationIdentity = marsAuthenticationIdentity; + InstanceType = instanceType ?? "VMware"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareFabricAgentCustomProperties() + { + } + + /// Gets or sets the BIOS Id of the fabric agent machine. + public string BiosId { get; set; } + /// Identity model. + public DataReplicationIdentity MarsAuthenticationIdentity { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.Serialization.cs new file mode 100644 index 000000000000..57340f216d6b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.Serialization.cs @@ -0,0 +1,126 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareMigrateFabricCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareMigrateFabricCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("vmwareSiteId"u8); + writer.WriteStringValue(VmwareSiteId); + writer.WritePropertyName("migrationSolutionId"u8); + writer.WriteStringValue(MigrationSolutionId); + } + + VMwareMigrateFabricCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareMigrateFabricCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareMigrateFabricCustomProperties(document.RootElement, options); + } + + internal static VMwareMigrateFabricCustomProperties DeserializeVMwareMigrateFabricCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier vmwareSiteId = default; + ResourceIdentifier migrationSolutionId = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmwareSiteId"u8)) + { + vmwareSiteId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("migrationSolutionId"u8)) + { + migrationSolutionId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareMigrateFabricCustomProperties(instanceType, serializedAdditionalRawData, vmwareSiteId, migrationSolutionId); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareMigrateFabricCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareMigrateFabricCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareMigrateFabricCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareMigrateFabricCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.cs new file mode 100644 index 000000000000..cfb0cf0099d9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareMigrateFabricCustomProperties.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware migrate fabric model custom properties. + public partial class VMwareMigrateFabricCustomProperties : DataReplicationFabricCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the migration solution. + /// or is null. + public VMwareMigrateFabricCustomProperties(ResourceIdentifier vmwareSiteId, ResourceIdentifier migrationSolutionId) + { + Argument.AssertNotNull(vmwareSiteId, nameof(vmwareSiteId)); + Argument.AssertNotNull(migrationSolutionId, nameof(migrationSolutionId)); + + VmwareSiteId = vmwareSiteId; + MigrationSolutionId = migrationSolutionId; + InstanceType = "VMwareMigrate"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationFabricCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the migration solution. + internal VMwareMigrateFabricCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier vmwareSiteId, ResourceIdentifier migrationSolutionId) : base(instanceType, serializedAdditionalRawData) + { + VmwareSiteId = vmwareSiteId; + MigrationSolutionId = migrationSolutionId; + InstanceType = instanceType ?? "VMwareMigrate"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareMigrateFabricCustomProperties() + { + } + + /// Gets or sets the ARM Id of the VMware site. + public ResourceIdentifier VmwareSiteId { get; set; } + /// Gets or sets the ARM Id of the migration solution. + public ResourceIdentifier MigrationSolutionId { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciDiskInput.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciDiskInput.Serialization.cs new file mode 100644 index 000000000000..44f709633dbc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciDiskInput.Serialization.cs @@ -0,0 +1,263 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciDiskInput : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciDiskInput)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("diskId"u8); + writer.WriteStringValue(DiskId); + if (Optional.IsDefined(StorageContainerId)) + { + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + } + if (Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"u8); + writer.WriteBooleanValue(IsDynamic.Value); + } + writer.WritePropertyName("diskSizeGB"u8); + writer.WriteNumberValue(DiskSizeGB); + writer.WritePropertyName("diskFileFormat"u8); + writer.WriteStringValue(DiskFileFormat); + writer.WritePropertyName("isOsDisk"u8); + writer.WriteBooleanValue(IsOSDisk); + if (Optional.IsDefined(DiskBlockSize)) + { + writer.WritePropertyName("diskBlockSize"u8); + writer.WriteNumberValue(DiskBlockSize.Value); + } + if (Optional.IsDefined(DiskLogicalSectorSize)) + { + writer.WritePropertyName("diskLogicalSectorSize"u8); + writer.WriteNumberValue(DiskLogicalSectorSize.Value); + } + if (Optional.IsDefined(DiskPhysicalSectorSize)) + { + writer.WritePropertyName("diskPhysicalSectorSize"u8); + writer.WriteNumberValue(DiskPhysicalSectorSize.Value); + } + if (Optional.IsDefined(DiskIdentifier)) + { + writer.WritePropertyName("diskIdentifier"u8); + writer.WriteStringValue(DiskIdentifier); + } + if (Optional.IsDefined(DiskController)) + { + writer.WritePropertyName("diskController"u8); + writer.WriteObjectValue(DiskController, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMwareToAzStackHciDiskInput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciDiskInput)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciDiskInput(document.RootElement, options); + } + + internal static VMwareToAzStackHciDiskInput DeserializeVMwareToAzStackHciDiskInput(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string diskId = default; + ResourceIdentifier storageContainerId = default; + bool? isDynamic = default; + long diskSizeGB = default; + string diskFileFormat = default; + bool isOSDisk = default; + long? diskBlockSize = default; + long? diskLogicalSectorSize = default; + long? diskPhysicalSectorSize = default; + string diskIdentifier = default; + DataReplicationDiskControllerInputs diskController = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskId"u8)) + { + diskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageContainerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("isDynamic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskSizeGB"u8)) + { + diskSizeGB = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskFileFormat"u8)) + { + diskFileFormat = property.Value.GetString(); + continue; + } + if (property.NameEquals("isOsDisk"u8)) + { + isOSDisk = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskBlockSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBlockSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskLogicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskLogicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskPhysicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskPhysicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskIdentifier"u8)) + { + diskIdentifier = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskController"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskController = DataReplicationDiskControllerInputs.DeserializeDataReplicationDiskControllerInputs(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciDiskInput( + diskId, + storageContainerId, + isDynamic, + diskSizeGB, + diskFileFormat, + isOSDisk, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + diskIdentifier, + diskController, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciDiskInput)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciDiskInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciDiskInput(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciDiskInput)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciDiskInput.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciDiskInput.cs new file mode 100644 index 000000000000..01df92aa0379 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciDiskInput.cs @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMwareToAzStack disk input. + public partial class VMwareToAzStackHciDiskInput + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the disk Id. + /// Gets or sets the disk size in GB. + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + /// Gets or sets a value indicating whether disk is os disk. + /// or is null. + public VMwareToAzStackHciDiskInput(string diskId, long diskSizeGB, string diskFileFormat, bool isOSDisk) + { + Argument.AssertNotNull(diskId, nameof(diskId)); + Argument.AssertNotNull(diskFileFormat, nameof(diskFileFormat)); + + DiskId = diskId; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + } + + /// Initializes a new instance of . + /// Gets or sets the disk Id. + /// Gets or sets the target storage account ARM Id. + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + /// Gets or sets the disk size in GB. + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + /// Gets or sets a value indicating whether disk is os disk. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// Gets or sets a value of disk identifier. + /// Disk controller. + /// Keeps track of any properties unknown to the library. + internal VMwareToAzStackHciDiskInput(string diskId, ResourceIdentifier storageContainerId, bool? isDynamic, long diskSizeGB, string diskFileFormat, bool isOSDisk, long? diskBlockSize, long? diskLogicalSectorSize, long? diskPhysicalSectorSize, string diskIdentifier, DataReplicationDiskControllerInputs diskController, IDictionary serializedAdditionalRawData) + { + DiskId = diskId; + StorageContainerId = storageContainerId; + IsDynamic = isDynamic; + DiskSizeGB = diskSizeGB; + DiskFileFormat = diskFileFormat; + IsOSDisk = isOSDisk; + DiskBlockSize = diskBlockSize; + DiskLogicalSectorSize = diskLogicalSectorSize; + DiskPhysicalSectorSize = diskPhysicalSectorSize; + DiskIdentifier = diskIdentifier; + DiskController = diskController; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHciDiskInput() + { + } + + /// Gets or sets the disk Id. + public string DiskId { get; set; } + /// Gets or sets the target storage account ARM Id. + public ResourceIdentifier StorageContainerId { get; set; } + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + public bool? IsDynamic { get; set; } + /// Gets or sets the disk size in GB. + public long DiskSizeGB { get; set; } + /// Gets or sets the type of the virtual hard disk, vhd or vhdx. + public string DiskFileFormat { get; set; } + /// Gets or sets a value indicating whether disk is os disk. + public bool IsOSDisk { get; set; } + /// Gets or sets a value of disk block size. + public long? DiskBlockSize { get; set; } + /// Gets or sets a value of disk logical sector size. + public long? DiskLogicalSectorSize { get; set; } + /// Gets or sets a value of disk physical sector size. + public long? DiskPhysicalSectorSize { get; set; } + /// Gets or sets a value of disk identifier. + public string DiskIdentifier { get; set; } + /// Disk controller. + public DataReplicationDiskControllerInputs DiskController { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.Serialization.cs new file mode 100644 index 000000000000..4a236ca915c5 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciEventCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciEventCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(EventSourceFriendlyName)) + { + writer.WritePropertyName("eventSourceFriendlyName"u8); + writer.WriteStringValue(EventSourceFriendlyName); + } + if (options.Format != "W" && Optional.IsDefined(ProtectedItemFriendlyName)) + { + writer.WritePropertyName("protectedItemFriendlyName"u8); + writer.WriteStringValue(ProtectedItemFriendlyName); + } + if (options.Format != "W" && Optional.IsDefined(SourceApplianceName)) + { + writer.WritePropertyName("sourceApplianceName"u8); + writer.WriteStringValue(SourceApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(TargetApplianceName)) + { + writer.WritePropertyName("targetApplianceName"u8); + writer.WriteStringValue(TargetApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(ServerType)) + { + writer.WritePropertyName("serverType"u8); + writer.WriteStringValue(ServerType); + } + } + + VMwareToAzStackHciEventCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciEventCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciEventCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciEventCustomProperties DeserializeVMwareToAzStackHciEventCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string eventSourceFriendlyName = default; + string protectedItemFriendlyName = default; + string sourceApplianceName = default; + string targetApplianceName = default; + string serverType = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("eventSourceFriendlyName"u8)) + { + eventSourceFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("protectedItemFriendlyName"u8)) + { + protectedItemFriendlyName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceApplianceName"u8)) + { + sourceApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetApplianceName"u8)) + { + targetApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("serverType"u8)) + { + serverType = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciEventCustomProperties( + instanceType, + serializedAdditionalRawData, + eventSourceFriendlyName, + protectedItemFriendlyName, + sourceApplianceName, + targetApplianceName, + serverType); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciEventCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciEventCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciEventCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciEventCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.cs new file mode 100644 index 000000000000..56b31bf94ea9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciEventCustomProperties.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI event model custom properties. This class provides provider specific details for events of type DataContract.HealthEvents.HealthEventType.ProtectedItemHealth and DataContract.HealthEvents.HealthEventType.AgentHealth. + public partial class VMwareToAzStackHciEventCustomProperties : DataReplicationEventCustomProperties + { + /// Initializes a new instance of . + internal VMwareToAzStackHciEventCustomProperties() + { + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationEventCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the friendly name of the source which has raised this health event. + /// Gets or sets the protected item friendly name. + /// Gets or sets the source appliance name. + /// Gets or sets the source target name. + /// Gets or sets the server type. + internal VMwareToAzStackHciEventCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, string eventSourceFriendlyName, string protectedItemFriendlyName, string sourceApplianceName, string targetApplianceName, string serverType) : base(instanceType, serializedAdditionalRawData) + { + EventSourceFriendlyName = eventSourceFriendlyName; + ProtectedItemFriendlyName = protectedItemFriendlyName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + ServerType = serverType; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Gets or sets the friendly name of the source which has raised this health event. + public string EventSourceFriendlyName { get; } + /// Gets or sets the protected item friendly name. + public string ProtectedItemFriendlyName { get; } + /// Gets or sets the source appliance name. + public string SourceApplianceName { get; } + /// Gets or sets the source target name. + public string TargetApplianceName { get; } + /// Gets or sets the server type. + public string ServerType { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciNicInput.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciNicInput.Serialization.cs new file mode 100644 index 000000000000..8401fdcfd165 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciNicInput.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciNicInput : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciNicInput)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + writer.WritePropertyName("label"u8); + writer.WriteStringValue(Label); + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.ToString()); + if (Optional.IsDefined(IsStaticIPMigrationEnabled)) + { + writer.WritePropertyName("isStaticIpMigrationEnabled"u8); + writer.WriteBooleanValue(IsStaticIPMigrationEnabled.Value); + } + if (Optional.IsDefined(IsMacMigrationEnabled)) + { + writer.WritePropertyName("isMacMigrationEnabled"u8); + writer.WriteBooleanValue(IsMacMigrationEnabled.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMwareToAzStackHciNicInput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciNicInput)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciNicInput(document.RootElement, options); + } + + internal static VMwareToAzStackHciNicInput DeserializeVMwareToAzStackHciNicInput(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + string label = default; + string networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection selectionTypeForFailover = default; + bool? isStaticIPMigrationEnabled = default; + bool? isMacMigrationEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicId"u8)) + { + nicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("label"u8)) + { + label = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("selectionTypeForFailover"u8)) + { + selectionTypeForFailover = new VmNicSelection(property.Value.GetString()); + continue; + } + if (property.NameEquals("isStaticIpMigrationEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isStaticIPMigrationEnabled = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isMacMigrationEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isMacMigrationEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciNicInput( + nicId, + label, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + isStaticIPMigrationEnabled, + isMacMigrationEnabled, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciNicInput)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciNicInput IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciNicInput(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciNicInput)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciNicInput.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciNicInput.cs new file mode 100644 index 000000000000..b8851668908c --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciNicInput.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMwareToAzStackHCI NIC properties. + public partial class VMwareToAzStackHciNicInput + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC label. + /// Gets or sets the selection type of the NIC. + /// or is null. + public VMwareToAzStackHciNicInput(string nicId, string label, VmNicSelection selectionTypeForFailover) + { + Argument.AssertNotNull(nicId, nameof(nicId)); + Argument.AssertNotNull(label, nameof(label)); + + NicId = nicId; + Label = label; + SelectionTypeForFailover = selectionTypeForFailover; + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC label. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// Gets or sets a value indicating whether static ip migration is enabled. + /// Gets or sets a value indicating whether mac address migration is enabled. + /// Keeps track of any properties unknown to the library. + internal VMwareToAzStackHciNicInput(string nicId, string label, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection selectionTypeForFailover, bool? isStaticIPMigrationEnabled, bool? isMacMigrationEnabled, IDictionary serializedAdditionalRawData) + { + NicId = nicId; + Label = label; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + IsStaticIPMigrationEnabled = isStaticIPMigrationEnabled; + IsMacMigrationEnabled = isMacMigrationEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHciNicInput() + { + } + + /// Gets or sets the NIC Id. + public string NicId { get; set; } + /// Gets or sets the NIC label. + public string Label { get; set; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; set; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; set; } + /// Gets or sets the selection type of the NIC. + public VmNicSelection SelectionTypeForFailover { get; set; } + /// Gets or sets a value indicating whether static ip migration is enabled. + public bool? IsStaticIPMigrationEnabled { get; set; } + /// Gets or sets a value indicating whether mac address migration is enabled. + public bool? IsMacMigrationEnabled { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.Serialization.cs new file mode 100644 index 000000000000..f50eab8f2b5b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciPlannedFailoverCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciPlannedFailoverCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("shutdownSourceVM"u8); + writer.WriteBooleanValue(ShutdownSourceVm); + } + + VMwareToAzStackHciPlannedFailoverCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciPlannedFailoverCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciPlannedFailoverCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciPlannedFailoverCustomProperties DeserializeVMwareToAzStackHciPlannedFailoverCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool shutdownSourceVm = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("shutdownSourceVM"u8)) + { + shutdownSourceVm = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciPlannedFailoverCustomProperties(instanceType, serializedAdditionalRawData, shutdownSourceVm); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciPlannedFailoverCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciPlannedFailoverCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciPlannedFailoverCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciPlannedFailoverCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.cs new file mode 100644 index 000000000000..1e8806865740 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPlannedFailoverCustomProperties.cs @@ -0,0 +1,42 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI planned failover model custom properties. + public partial class VMwareToAzStackHciPlannedFailoverCustomProperties : PlannedFailoverCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets a value indicating whether VM needs to be shut down. + public VMwareToAzStackHciPlannedFailoverCustomProperties(bool shutdownSourceVm) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for PlannedFailoverCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets a value indicating whether VM needs to be shut down. + internal VMwareToAzStackHciPlannedFailoverCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, bool shutdownSourceVm) : base(instanceType, serializedAdditionalRawData) + { + ShutdownSourceVm = shutdownSourceVm; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHciPlannedFailoverCustomProperties() + { + } + + /// Gets or sets a value indicating whether VM needs to be shut down. + public bool ShutdownSourceVm { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.Serialization.cs new file mode 100644 index 000000000000..d23c47f80a33 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.Serialization.cs @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciPolicyCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciPolicyCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("recoveryPointHistoryInMinutes"u8); + writer.WriteNumberValue(RecoveryPointHistoryInMinutes); + writer.WritePropertyName("crashConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(CrashConsistentFrequencyInMinutes); + writer.WritePropertyName("appConsistentFrequencyInMinutes"u8); + writer.WriteNumberValue(AppConsistentFrequencyInMinutes); + } + + VMwareToAzStackHciPolicyCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciPolicyCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciPolicyCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciPolicyCustomProperties DeserializeVMwareToAzStackHciPolicyCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + int recoveryPointHistoryInMinutes = default; + int crashConsistentFrequencyInMinutes = default; + int appConsistentFrequencyInMinutes = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recoveryPointHistoryInMinutes"u8)) + { + recoveryPointHistoryInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("crashConsistentFrequencyInMinutes"u8)) + { + crashConsistentFrequencyInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("appConsistentFrequencyInMinutes"u8)) + { + appConsistentFrequencyInMinutes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciPolicyCustomProperties(instanceType, serializedAdditionalRawData, recoveryPointHistoryInMinutes, crashConsistentFrequencyInMinutes, appConsistentFrequencyInMinutes); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciPolicyCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciPolicyCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciPolicyCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciPolicyCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.cs new file mode 100644 index 000000000000..8291589dda12 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciPolicyCustomProperties.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware To AzStackHCI Policy model custom properties. + public partial class VMwareToAzStackHciPolicyCustomProperties : DataReplicationPolicyCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the duration in minutes until which the recovery points need to be stored. + /// Gets or sets the crash consistent snapshot frequency (in minutes). + /// Gets or sets the app consistent snapshot frequency (in minutes). + public VMwareToAzStackHciPolicyCustomProperties(int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationPolicyCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the duration in minutes until which the recovery points need to be stored. + /// Gets or sets the crash consistent snapshot frequency (in minutes). + /// Gets or sets the app consistent snapshot frequency (in minutes). + internal VMwareToAzStackHciPolicyCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, int recoveryPointHistoryInMinutes, int crashConsistentFrequencyInMinutes, int appConsistentFrequencyInMinutes) : base(instanceType, serializedAdditionalRawData) + { + RecoveryPointHistoryInMinutes = recoveryPointHistoryInMinutes; + CrashConsistentFrequencyInMinutes = crashConsistentFrequencyInMinutes; + AppConsistentFrequencyInMinutes = appConsistentFrequencyInMinutes; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHciPolicyCustomProperties() + { + } + + /// Gets or sets the duration in minutes until which the recovery points need to be stored. + public int RecoveryPointHistoryInMinutes { get; set; } + /// Gets or sets the crash consistent snapshot frequency (in minutes). + public int CrashConsistentFrequencyInMinutes { get; set; } + /// Gets or sets the app consistent snapshot frequency (in minutes). + public int AppConsistentFrequencyInMinutes { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedDiskProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedDiskProperties.Serialization.cs new file mode 100644 index 000000000000..887056f2944b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedDiskProperties.Serialization.cs @@ -0,0 +1,315 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciProtectedDiskProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedDiskProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(StorageContainerId)) + { + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + } + if (options.Format != "W" && Optional.IsDefined(StorageContainerLocalPath)) + { + writer.WritePropertyName("storageContainerLocalPath"u8); + writer.WriteStringValue(StorageContainerLocalPath); + } + if (options.Format != "W" && Optional.IsDefined(SourceDiskId)) + { + writer.WritePropertyName("sourceDiskId"u8); + writer.WriteStringValue(SourceDiskId); + } + if (options.Format != "W" && Optional.IsDefined(SourceDiskName)) + { + writer.WritePropertyName("sourceDiskName"u8); + writer.WriteStringValue(SourceDiskName); + } + if (options.Format != "W" && Optional.IsDefined(SeedDiskName)) + { + writer.WritePropertyName("seedDiskName"u8); + writer.WriteStringValue(SeedDiskName); + } + if (options.Format != "W" && Optional.IsDefined(TestMigrateDiskName)) + { + writer.WritePropertyName("testMigrateDiskName"u8); + writer.WriteStringValue(TestMigrateDiskName); + } + if (options.Format != "W" && Optional.IsDefined(MigrateDiskName)) + { + writer.WritePropertyName("migrateDiskName"u8); + writer.WriteStringValue(MigrateDiskName); + } + if (options.Format != "W" && Optional.IsDefined(IsOSDisk)) + { + writer.WritePropertyName("isOsDisk"u8); + writer.WriteBooleanValue(IsOSDisk.Value); + } + if (options.Format != "W" && Optional.IsDefined(CapacityInBytes)) + { + writer.WritePropertyName("capacityInBytes"u8); + writer.WriteNumberValue(CapacityInBytes.Value); + } + if (options.Format != "W" && Optional.IsDefined(IsDynamic)) + { + writer.WritePropertyName("isDynamic"u8); + writer.WriteBooleanValue(IsDynamic.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskType)) + { + writer.WritePropertyName("diskType"u8); + writer.WriteStringValue(DiskType); + } + if (options.Format != "W" && Optional.IsDefined(DiskBlockSize)) + { + writer.WritePropertyName("diskBlockSize"u8); + writer.WriteNumberValue(DiskBlockSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskLogicalSectorSize)) + { + writer.WritePropertyName("diskLogicalSectorSize"u8); + writer.WriteNumberValue(DiskLogicalSectorSize.Value); + } + if (options.Format != "W" && Optional.IsDefined(DiskPhysicalSectorSize)) + { + writer.WritePropertyName("diskPhysicalSectorSize"u8); + writer.WriteNumberValue(DiskPhysicalSectorSize.Value); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMwareToAzStackHciProtectedDiskProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedDiskProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciProtectedDiskProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciProtectedDiskProperties DeserializeVMwareToAzStackHciProtectedDiskProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier storageContainerId = default; + string storageContainerLocalPath = default; + string sourceDiskId = default; + string sourceDiskName = default; + string seedDiskName = default; + string testMigrateDiskName = default; + string migrateDiskName = default; + bool? isOSDisk = default; + long? capacityInBytes = default; + bool? isDynamic = default; + string diskType = default; + long? diskBlockSize = default; + long? diskLogicalSectorSize = default; + long? diskPhysicalSectorSize = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("storageContainerId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageContainerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageContainerLocalPath"u8)) + { + storageContainerLocalPath = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDiskId"u8)) + { + sourceDiskId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceDiskName"u8)) + { + sourceDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("seedDiskName"u8)) + { + seedDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("testMigrateDiskName"u8)) + { + testMigrateDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("migrateDiskName"u8)) + { + migrateDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("isOsDisk"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isOSDisk = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("capacityInBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + capacityInBytes = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("isDynamic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("diskType"u8)) + { + diskType = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskBlockSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskBlockSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskLogicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskLogicalSectorSize = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskPhysicalSectorSize"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskPhysicalSectorSize = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciProtectedDiskProperties( + storageContainerId, + storageContainerLocalPath, + sourceDiskId, + sourceDiskName, + seedDiskName, + testMigrateDiskName, + migrateDiskName, + isOSDisk, + capacityInBytes, + isDynamic, + diskType, + diskBlockSize, + diskLogicalSectorSize, + diskPhysicalSectorSize, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedDiskProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciProtectedDiskProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciProtectedDiskProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedDiskProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedDiskProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedDiskProperties.cs new file mode 100644 index 000000000000..ed12b6b3e604 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedDiskProperties.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMwareToAzStackHCI protected disk properties. + public partial class VMwareToAzStackHciProtectedDiskProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal VMwareToAzStackHciProtectedDiskProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the storage container. + /// Gets or sets the local path of the storage container. + /// Gets or sets the source disk Id. + /// Gets or sets the source disk Name. + /// Gets or sets the seed disk name. + /// Gets or sets the test failover clone disk. + /// Gets or sets the failover clone disk. + /// Gets or sets a value indicating whether the disk is the OS disk. + /// Gets or sets the disk capacity in bytes. + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + /// Gets or sets the disk type. + /// Gets or sets a value of disk block size. + /// Gets or sets a value of disk logical sector size. + /// Gets or sets a value of disk physical sector size. + /// Keeps track of any properties unknown to the library. + internal VMwareToAzStackHciProtectedDiskProperties(ResourceIdentifier storageContainerId, string storageContainerLocalPath, string sourceDiskId, string sourceDiskName, string seedDiskName, string testMigrateDiskName, string migrateDiskName, bool? isOSDisk, long? capacityInBytes, bool? isDynamic, string diskType, long? diskBlockSize, long? diskLogicalSectorSize, long? diskPhysicalSectorSize, IDictionary serializedAdditionalRawData) + { + StorageContainerId = storageContainerId; + StorageContainerLocalPath = storageContainerLocalPath; + SourceDiskId = sourceDiskId; + SourceDiskName = sourceDiskName; + SeedDiskName = seedDiskName; + TestMigrateDiskName = testMigrateDiskName; + MigrateDiskName = migrateDiskName; + IsOSDisk = isOSDisk; + CapacityInBytes = capacityInBytes; + IsDynamic = isDynamic; + DiskType = diskType; + DiskBlockSize = diskBlockSize; + DiskLogicalSectorSize = diskLogicalSectorSize; + DiskPhysicalSectorSize = diskPhysicalSectorSize; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the ARM Id of the storage container. + public ResourceIdentifier StorageContainerId { get; } + /// Gets or sets the local path of the storage container. + public string StorageContainerLocalPath { get; } + /// Gets or sets the source disk Id. + public string SourceDiskId { get; } + /// Gets or sets the source disk Name. + public string SourceDiskName { get; } + /// Gets or sets the seed disk name. + public string SeedDiskName { get; } + /// Gets or sets the test failover clone disk. + public string TestMigrateDiskName { get; } + /// Gets or sets the failover clone disk. + public string MigrateDiskName { get; } + /// Gets or sets a value indicating whether the disk is the OS disk. + public bool? IsOSDisk { get; } + /// Gets or sets the disk capacity in bytes. + public long? CapacityInBytes { get; } + /// Gets or sets a value indicating whether dynamic sizing is enabled on the virtual hard disk. + public bool? IsDynamic { get; } + /// Gets or sets the disk type. + public string DiskType { get; } + /// Gets or sets a value of disk block size. + public long? DiskBlockSize { get; } + /// Gets or sets a value of disk logical sector size. + public long? DiskLogicalSectorSize { get; } + /// Gets or sets a value of disk physical sector size. + public long? DiskPhysicalSectorSize { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.Serialization.cs new file mode 100644 index 000000000000..e29532c75179 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.Serialization.cs @@ -0,0 +1,748 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciProtectedItemCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsDefined(ActiveLocation)) + { + writer.WritePropertyName("activeLocation"u8); + writer.WriteStringValue(ActiveLocation.Value.ToString()); + } + writer.WritePropertyName("targetHciClusterId"u8); + writer.WriteStringValue(TargetHciClusterId); + writer.WritePropertyName("targetArcClusterCustomLocationId"u8); + writer.WriteStringValue(TargetArcClusterCustomLocationId); + if (options.Format != "W" && Optional.IsDefined(TargetAzStackHciClusterName)) + { + writer.WritePropertyName("targetAzStackHciClusterName"u8); + writer.WriteStringValue(TargetAzStackHciClusterName); + } + writer.WritePropertyName("storageContainerId"u8); + writer.WriteStringValue(StorageContainerId); + writer.WritePropertyName("targetResourceGroupId"u8); + writer.WriteStringValue(TargetResourceGroupId); + if (options.Format != "W" && Optional.IsDefined(TargetLocation)) + { + writer.WritePropertyName("targetLocation"u8); + writer.WriteStringValue(TargetLocation); + } + writer.WritePropertyName("customLocationRegion"u8); + writer.WriteStringValue(CustomLocationRegion); + writer.WritePropertyName("disksToInclude"u8); + writer.WriteStartArray(); + foreach (var item in DisksToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedDisks)) + { + writer.WritePropertyName("protectedDisks"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedDisks) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsCollectionDefined(ProtectedNics)) + { + writer.WritePropertyName("protectedNics"u8); + writer.WriteStartArray(); + foreach (var item in ProtectedNics) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(TargetVmBiosId)) + { + writer.WritePropertyName("targetVmBiosId"u8); + writer.WriteStringValue(TargetVmBiosId); + } + if (Optional.IsDefined(TargetVmName)) + { + writer.WritePropertyName("targetVmName"u8); + writer.WriteStringValue(TargetVmName); + } + writer.WritePropertyName("hyperVGeneration"u8); + writer.WriteStringValue(HyperVGeneration); + if (Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + if (Optional.IsDefined(TargetCpuCores)) + { + writer.WritePropertyName("targetCpuCores"u8); + writer.WriteNumberValue(TargetCpuCores.Value); + } + if (Optional.IsDefined(IsDynamicRam)) + { + writer.WritePropertyName("isDynamicRam"u8); + writer.WriteBooleanValue(IsDynamicRam.Value); + } + if (Optional.IsDefined(DynamicMemoryConfig)) + { + writer.WritePropertyName("dynamicMemoryConfig"u8); + writer.WriteObjectValue(DynamicMemoryConfig, options); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + if (options.Format != "W" && Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType); + } + if (options.Format != "W" && Optional.IsDefined(OSName)) + { + writer.WritePropertyName("osName"u8); + writer.WriteStringValue(OSName); + } + if (options.Format != "W" && Optional.IsDefined(FirmwareType)) + { + writer.WritePropertyName("firmwareType"u8); + writer.WriteStringValue(FirmwareType); + } + writer.WritePropertyName("fabricDiscoveryMachineId"u8); + writer.WriteStringValue(FabricDiscoveryMachineId); + if (options.Format != "W" && Optional.IsDefined(SourceVmName)) + { + writer.WritePropertyName("sourceVmName"u8); + writer.WriteStringValue(SourceVmName); + } + if (options.Format != "W" && Optional.IsDefined(SourceCpuCores)) + { + writer.WritePropertyName("sourceCpuCores"u8); + writer.WriteNumberValue(SourceCpuCores.Value); + } + if (options.Format != "W" && Optional.IsDefined(SourceMemoryInMegaBytes)) + { + writer.WritePropertyName("sourceMemoryInMegaBytes"u8); + writer.WriteNumberValue(SourceMemoryInMegaBytes.Value); + } + writer.WritePropertyName("runAsAccountId"u8); + writer.WriteStringValue(RunAsAccountId); + writer.WritePropertyName("sourceFabricAgentName"u8); + writer.WriteStringValue(SourceFabricAgentName); + writer.WritePropertyName("targetFabricAgentName"u8); + writer.WriteStringValue(TargetFabricAgentName); + if (options.Format != "W" && Optional.IsDefined(SourceApplianceName)) + { + writer.WritePropertyName("sourceApplianceName"u8); + writer.WriteStringValue(SourceApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(TargetApplianceName)) + { + writer.WritePropertyName("targetApplianceName"u8); + writer.WriteStringValue(TargetApplianceName); + } + if (options.Format != "W" && Optional.IsDefined(FailoverRecoveryPointId)) + { + writer.WritePropertyName("failoverRecoveryPointId"u8); + writer.WriteStringValue(FailoverRecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(LastRecoveryPointReceivedOn)) + { + writer.WritePropertyName("lastRecoveryPointReceived"u8); + writer.WriteStringValue(LastRecoveryPointReceivedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(LastRecoveryPointId)) + { + writer.WritePropertyName("lastRecoveryPointId"u8); + writer.WriteStringValue(LastRecoveryPointId); + } + if (options.Format != "W" && Optional.IsDefined(InitialReplicationProgressPercentage)) + { + writer.WritePropertyName("initialReplicationProgressPercentage"u8); + writer.WriteNumberValue(InitialReplicationProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(MigrationProgressPercentage)) + { + writer.WritePropertyName("migrationProgressPercentage"u8); + writer.WriteNumberValue(MigrationProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResumeProgressPercentage)) + { + writer.WritePropertyName("resumeProgressPercentage"u8); + writer.WriteNumberValue(ResumeProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncProgressPercentage)) + { + writer.WritePropertyName("resyncProgressPercentage"u8); + writer.WriteNumberValue(ResyncProgressPercentage.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncRetryCount)) + { + writer.WritePropertyName("resyncRetryCount"u8); + writer.WriteNumberValue(ResyncRetryCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncRequired)) + { + writer.WritePropertyName("resyncRequired"u8); + writer.WriteBooleanValue(ResyncRequired.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResyncState)) + { + writer.WritePropertyName("resyncState"u8); + writer.WriteStringValue(ResyncState.Value.ToString()); + } + if (Optional.IsDefined(PerformAutoResync)) + { + writer.WritePropertyName("performAutoResync"u8); + writer.WriteBooleanValue(PerformAutoResync.Value); + } + if (options.Format != "W" && Optional.IsDefined(ResumeRetryCount)) + { + writer.WritePropertyName("resumeRetryCount"u8); + writer.WriteNumberValue(ResumeRetryCount.Value); + } + if (options.Format != "W" && Optional.IsDefined(LastReplicationUpdateOn)) + { + writer.WritePropertyName("lastReplicationUpdateTime"u8); + writer.WriteStringValue(LastReplicationUpdateOn.Value, "O"); + } + } + + VMwareToAzStackHciProtectedItemCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciProtectedItemCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciProtectedItemCustomProperties DeserializeVMwareToAzStackHciProtectedItemCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ProtectedItemActiveLocation? activeLocation = default; + ResourceIdentifier targetHciClusterId = default; + ResourceIdentifier targetArcClusterCustomLocationId = default; + string targetAzStackHciClusterName = default; + ResourceIdentifier storageContainerId = default; + ResourceIdentifier targetResourceGroupId = default; + string targetLocation = default; + string customLocationRegion = default; + IList disksToInclude = default; + IList nicsToInclude = default; + IReadOnlyList protectedDisks = default; + IReadOnlyList protectedNics = default; + string targetVmBiosId = default; + string targetVmName = default; + string hyperVGeneration = default; + string targetNetworkId = default; + string testNetworkId = default; + int? targetCpuCores = default; + bool? isDynamicRam = default; + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = default; + int? targetMemoryInMegaBytes = default; + string osType = default; + string osName = default; + string firmwareType = default; + ResourceIdentifier fabricDiscoveryMachineId = default; + string sourceVmName = default; + int? sourceCpuCores = default; + double? sourceMemoryInMegaBytes = default; + string runAsAccountId = default; + string sourceFabricAgentName = default; + string targetFabricAgentName = default; + string sourceApplianceName = default; + string targetApplianceName = default; + string failoverRecoveryPointId = default; + DateTimeOffset? lastRecoveryPointReceived = default; + string lastRecoveryPointId = default; + int? initialReplicationProgressPercentage = default; + int? migrationProgressPercentage = default; + int? resumeProgressPercentage = default; + int? resyncProgressPercentage = default; + long? resyncRetryCount = default; + bool? resyncRequired = default; + VMwareToAzureMigrateResyncState? resyncState = default; + bool? performAutoResync = default; + long? resumeRetryCount = default; + DateTimeOffset? lastReplicationUpdateTime = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("activeLocation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + activeLocation = new ProtectedItemActiveLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetHciClusterId"u8)) + { + targetHciClusterId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetArcClusterCustomLocationId"u8)) + { + targetArcClusterCustomLocationId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetAzStackHciClusterName"u8)) + { + targetAzStackHciClusterName = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageContainerId"u8)) + { + storageContainerId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetResourceGroupId"u8)) + { + targetResourceGroupId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("targetLocation"u8)) + { + targetLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("customLocationRegion"u8)) + { + customLocationRegion = property.Value.GetString(); + continue; + } + if (property.NameEquals("disksToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHciDiskInput.DeserializeVMwareToAzStackHciDiskInput(item, options)); + } + disksToInclude = array; + continue; + } + if (property.NameEquals("nicsToInclude"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHciNicInput.DeserializeVMwareToAzStackHciNicInput(item, options)); + } + nicsToInclude = array; + continue; + } + if (property.NameEquals("protectedDisks"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHciProtectedDiskProperties.DeserializeVMwareToAzStackHciProtectedDiskProperties(item, options)); + } + protectedDisks = array; + continue; + } + if (property.NameEquals("protectedNics"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHciProtectedNicProperties.DeserializeVMwareToAzStackHciProtectedNicProperties(item, options)); + } + protectedNics = array; + continue; + } + if (property.NameEquals("targetVmBiosId"u8)) + { + targetVmBiosId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetVmName"u8)) + { + targetVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("hyperVGeneration"u8)) + { + hyperVGeneration = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isDynamicRam"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamicRam = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dynamicMemoryConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicMemoryConfig = ProtectedItemDynamicMemoryConfig.DeserializeProtectedItemDynamicMemoryConfig(property.Value, options); + continue; + } + if (property.NameEquals("targetMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetMemoryInMegaBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("osType"u8)) + { + osType = property.Value.GetString(); + continue; + } + if (property.NameEquals("osName"u8)) + { + osName = property.Value.GetString(); + continue; + } + if (property.NameEquals("firmwareType"u8)) + { + firmwareType = property.Value.GetString(); + continue; + } + if (property.NameEquals("fabricDiscoveryMachineId"u8)) + { + fabricDiscoveryMachineId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceVmName"u8)) + { + sourceVmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sourceMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sourceMemoryInMegaBytes = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("runAsAccountId"u8)) + { + runAsAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceFabricAgentName"u8)) + { + sourceFabricAgentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetFabricAgentName"u8)) + { + targetFabricAgentName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceApplianceName"u8)) + { + sourceApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetApplianceName"u8)) + { + targetApplianceName = property.Value.GetString(); + continue; + } + if (property.NameEquals("failoverRecoveryPointId"u8)) + { + failoverRecoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("lastRecoveryPointReceived"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastRecoveryPointReceived = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("lastRecoveryPointId"u8)) + { + lastRecoveryPointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("initialReplicationProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + initialReplicationProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("migrationProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + migrationProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resumeProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resumeProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resyncProgressPercentage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncProgressPercentage = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("resyncRetryCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncRetryCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("resyncRequired"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncRequired = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("resyncState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resyncState = new VMwareToAzureMigrateResyncState(property.Value.GetString()); + continue; + } + if (property.NameEquals("performAutoResync"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + performAutoResync = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("resumeRetryCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + resumeRetryCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("lastReplicationUpdateTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + lastReplicationUpdateTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciProtectedItemCustomProperties( + instanceType, + serializedAdditionalRawData, + activeLocation, + targetHciClusterId, + targetArcClusterCustomLocationId, + targetAzStackHciClusterName, + storageContainerId, + targetResourceGroupId, + targetLocation, + customLocationRegion, + disksToInclude, + nicsToInclude, + protectedDisks ?? new ChangeTrackingList(), + protectedNics ?? new ChangeTrackingList(), + targetVmBiosId, + targetVmName, + hyperVGeneration, + targetNetworkId, + testNetworkId, + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + osType, + osName, + firmwareType, + fabricDiscoveryMachineId, + sourceVmName, + sourceCpuCores, + sourceMemoryInMegaBytes, + runAsAccountId, + sourceFabricAgentName, + targetFabricAgentName, + sourceApplianceName, + targetApplianceName, + failoverRecoveryPointId, + lastRecoveryPointReceived, + lastRecoveryPointId, + initialReplicationProgressPercentage, + migrationProgressPercentage, + resumeProgressPercentage, + resyncProgressPercentage, + resyncRetryCount, + resyncRequired, + resyncState, + performAutoResync, + resumeRetryCount, + lastReplicationUpdateTime); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciProtectedItemCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciProtectedItemCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.cs new file mode 100644 index 000000000000..9dbfacd40210 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomProperties.cs @@ -0,0 +1,262 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI Protected item model custom properties. + public partial class VMwareToAzStackHciProtectedItemCustomProperties : DataReplicationProtectedItemCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the hypervisor generation of the virtual machine possible values are 1,2. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the run as account Id. + /// Gets or sets the source fabric agent name. + /// Gets or sets the target fabric agent name. + /// , , , , , , , , , , or is null. + public VMwareToAzStackHciProtectedItemCustomProperties(ResourceIdentifier targetHciClusterId, ResourceIdentifier targetArcClusterCustomLocationId, ResourceIdentifier storageContainerId, ResourceIdentifier targetResourceGroupId, string customLocationRegion, IEnumerable disksToInclude, IEnumerable nicsToInclude, string hyperVGeneration, ResourceIdentifier fabricDiscoveryMachineId, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName) + { + Argument.AssertNotNull(targetHciClusterId, nameof(targetHciClusterId)); + Argument.AssertNotNull(targetArcClusterCustomLocationId, nameof(targetArcClusterCustomLocationId)); + Argument.AssertNotNull(storageContainerId, nameof(storageContainerId)); + Argument.AssertNotNull(targetResourceGroupId, nameof(targetResourceGroupId)); + Argument.AssertNotNull(customLocationRegion, nameof(customLocationRegion)); + Argument.AssertNotNull(disksToInclude, nameof(disksToInclude)); + Argument.AssertNotNull(nicsToInclude, nameof(nicsToInclude)); + Argument.AssertNotNull(hyperVGeneration, nameof(hyperVGeneration)); + Argument.AssertNotNull(fabricDiscoveryMachineId, nameof(fabricDiscoveryMachineId)); + Argument.AssertNotNull(runAsAccountId, nameof(runAsAccountId)); + Argument.AssertNotNull(sourceFabricAgentName, nameof(sourceFabricAgentName)); + Argument.AssertNotNull(targetFabricAgentName, nameof(targetFabricAgentName)); + + TargetHciClusterId = targetHciClusterId; + TargetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + StorageContainerId = storageContainerId; + TargetResourceGroupId = targetResourceGroupId; + CustomLocationRegion = customLocationRegion; + DisksToInclude = disksToInclude.ToList(); + NicsToInclude = nicsToInclude.ToList(); + ProtectedDisks = new ChangeTrackingList(); + ProtectedNics = new ChangeTrackingList(); + HyperVGeneration = hyperVGeneration; + FabricDiscoveryMachineId = fabricDiscoveryMachineId; + RunAsAccountId = runAsAccountId; + SourceFabricAgentName = sourceFabricAgentName; + TargetFabricAgentName = targetFabricAgentName; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the location of the protected item. + /// Gets or sets the Target HCI Cluster ARM Id. + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + /// Gets or sets the Target AzStackHCI cluster name. + /// Gets or sets the target storage container ARM Id. + /// Gets or sets the target resource group ARM Id. + /// Gets or sets the target location. + /// Gets or sets the location of Azure Arc HCI custom location resource. + /// Gets or sets the list of disks to replicate. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the list of protected disks. + /// Gets or sets the VM NIC details. + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + /// Gets or sets the target VM display name. + /// Gets or sets the hypervisor generation of the virtual machine possible values are 1,2. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the type of the OS. + /// Gets or sets the name of the OS. + /// Gets or sets the firmware type. + /// Gets or sets the ARM Id of the discovered machine. + /// Gets or sets the source VM display name. + /// Gets or sets the source VM CPU cores. + /// Gets or sets the source VM ram memory size in megabytes. + /// Gets or sets the run as account Id. + /// Gets or sets the source fabric agent name. + /// Gets or sets the target fabric agent name. + /// Gets or sets the source appliance name. + /// Gets or sets the target appliance name. + /// Gets or sets the recovery point Id to which the VM was failed over. + /// Gets or sets the last recovery point received time. + /// Gets or sets the last recovery point Id. + /// Gets or sets the initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the migration progress percentage. + /// Gets or sets the resume progress percentage. + /// Gets or sets the resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + /// Gets or sets the resync retry count. + /// Gets or sets a value indicating whether resync is required. + /// Gets or sets the resync state. + /// Gets or sets a value indicating whether auto resync is to be done. + /// Gets or sets the resume retry count. + /// Gets or sets the latest timestamp that replication status is updated. + internal VMwareToAzStackHciProtectedItemCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ProtectedItemActiveLocation? activeLocation, ResourceIdentifier targetHciClusterId, ResourceIdentifier targetArcClusterCustomLocationId, string targetAzStackHciClusterName, ResourceIdentifier storageContainerId, ResourceIdentifier targetResourceGroupId, string targetLocation, string customLocationRegion, IList disksToInclude, IList nicsToInclude, IReadOnlyList protectedDisks, IReadOnlyList protectedNics, string targetVmBiosId, string targetVmName, string hyperVGeneration, string targetNetworkId, string testNetworkId, int? targetCpuCores, bool? isDynamicRam, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig, int? targetMemoryInMegaBytes, string osType, string osName, string firmwareType, ResourceIdentifier fabricDiscoveryMachineId, string sourceVmName, int? sourceCpuCores, double? sourceMemoryInMegaBytes, string runAsAccountId, string sourceFabricAgentName, string targetFabricAgentName, string sourceApplianceName, string targetApplianceName, string failoverRecoveryPointId, DateTimeOffset? lastRecoveryPointReceivedOn, string lastRecoveryPointId, int? initialReplicationProgressPercentage, int? migrationProgressPercentage, int? resumeProgressPercentage, int? resyncProgressPercentage, long? resyncRetryCount, bool? resyncRequired, VMwareToAzureMigrateResyncState? resyncState, bool? performAutoResync, long? resumeRetryCount, DateTimeOffset? lastReplicationUpdateOn) : base(instanceType, serializedAdditionalRawData) + { + ActiveLocation = activeLocation; + TargetHciClusterId = targetHciClusterId; + TargetArcClusterCustomLocationId = targetArcClusterCustomLocationId; + TargetAzStackHciClusterName = targetAzStackHciClusterName; + StorageContainerId = storageContainerId; + TargetResourceGroupId = targetResourceGroupId; + TargetLocation = targetLocation; + CustomLocationRegion = customLocationRegion; + DisksToInclude = disksToInclude; + NicsToInclude = nicsToInclude; + ProtectedDisks = protectedDisks; + ProtectedNics = protectedNics; + TargetVmBiosId = targetVmBiosId; + TargetVmName = targetVmName; + HyperVGeneration = hyperVGeneration; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + TargetCpuCores = targetCpuCores; + IsDynamicRam = isDynamicRam; + DynamicMemoryConfig = dynamicMemoryConfig; + TargetMemoryInMegaBytes = targetMemoryInMegaBytes; + OSType = osType; + OSName = osName; + FirmwareType = firmwareType; + FabricDiscoveryMachineId = fabricDiscoveryMachineId; + SourceVmName = sourceVmName; + SourceCpuCores = sourceCpuCores; + SourceMemoryInMegaBytes = sourceMemoryInMegaBytes; + RunAsAccountId = runAsAccountId; + SourceFabricAgentName = sourceFabricAgentName; + TargetFabricAgentName = targetFabricAgentName; + SourceApplianceName = sourceApplianceName; + TargetApplianceName = targetApplianceName; + FailoverRecoveryPointId = failoverRecoveryPointId; + LastRecoveryPointReceivedOn = lastRecoveryPointReceivedOn; + LastRecoveryPointId = lastRecoveryPointId; + InitialReplicationProgressPercentage = initialReplicationProgressPercentage; + MigrationProgressPercentage = migrationProgressPercentage; + ResumeProgressPercentage = resumeProgressPercentage; + ResyncProgressPercentage = resyncProgressPercentage; + ResyncRetryCount = resyncRetryCount; + ResyncRequired = resyncRequired; + ResyncState = resyncState; + PerformAutoResync = performAutoResync; + ResumeRetryCount = resumeRetryCount; + LastReplicationUpdateOn = lastReplicationUpdateOn; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHciProtectedItemCustomProperties() + { + } + + /// Gets or sets the location of the protected item. + public ProtectedItemActiveLocation? ActiveLocation { get; } + /// Gets or sets the Target HCI Cluster ARM Id. + public ResourceIdentifier TargetHciClusterId { get; set; } + /// Gets or sets the Target Arc Cluster Custom Location ARM Id. + public ResourceIdentifier TargetArcClusterCustomLocationId { get; set; } + /// Gets or sets the Target AzStackHCI cluster name. + public string TargetAzStackHciClusterName { get; } + /// Gets or sets the target storage container ARM Id. + public ResourceIdentifier StorageContainerId { get; set; } + /// Gets or sets the target resource group ARM Id. + public ResourceIdentifier TargetResourceGroupId { get; set; } + /// Gets or sets the target location. + public string TargetLocation { get; } + /// Gets or sets the location of Azure Arc HCI custom location resource. + public string CustomLocationRegion { get; set; } + /// Gets or sets the list of disks to replicate. + public IList DisksToInclude { get; } + /// Gets or sets the list of VM NIC to replicate. + public IList NicsToInclude { get; } + /// Gets or sets the list of protected disks. + public IReadOnlyList ProtectedDisks { get; } + /// Gets or sets the VM NIC details. + public IReadOnlyList ProtectedNics { get; } + /// Gets or sets the BIOS Id of the target AzStackHCI VM. + public string TargetVmBiosId { get; } + /// Gets or sets the target VM display name. + public string TargetVmName { get; set; } + /// Gets or sets the hypervisor generation of the virtual machine possible values are 1,2. + public string HyperVGeneration { get; set; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; set; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; set; } + /// Gets or sets the target CPU cores. + public int? TargetCpuCores { get; set; } + /// Gets or sets a value indicating whether memory is dynamical. + public bool? IsDynamicRam { get; set; } + /// Protected item dynamic memory config. + public ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get; set; } + /// Gets or sets the target memory in mega-bytes. + public int? TargetMemoryInMegaBytes { get; set; } + /// Gets or sets the type of the OS. + public string OSType { get; } + /// Gets or sets the name of the OS. + public string OSName { get; } + /// Gets or sets the firmware type. + public string FirmwareType { get; } + /// Gets or sets the ARM Id of the discovered machine. + public ResourceIdentifier FabricDiscoveryMachineId { get; set; } + /// Gets or sets the source VM display name. + public string SourceVmName { get; } + /// Gets or sets the source VM CPU cores. + public int? SourceCpuCores { get; } + /// Gets or sets the source VM ram memory size in megabytes. + public double? SourceMemoryInMegaBytes { get; } + /// Gets or sets the run as account Id. + public string RunAsAccountId { get; set; } + /// Gets or sets the source fabric agent name. + public string SourceFabricAgentName { get; set; } + /// Gets or sets the target fabric agent name. + public string TargetFabricAgentName { get; set; } + /// Gets or sets the source appliance name. + public string SourceApplianceName { get; } + /// Gets or sets the target appliance name. + public string TargetApplianceName { get; } + /// Gets or sets the recovery point Id to which the VM was failed over. + public string FailoverRecoveryPointId { get; } + /// Gets or sets the last recovery point received time. + public DateTimeOffset? LastRecoveryPointReceivedOn { get; } + /// Gets or sets the last recovery point Id. + public string LastRecoveryPointId { get; } + /// Gets or sets the initial replication progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + public int? InitialReplicationProgressPercentage { get; } + /// Gets or sets the migration progress percentage. + public int? MigrationProgressPercentage { get; } + /// Gets or sets the resume progress percentage. + public int? ResumeProgressPercentage { get; } + /// Gets or sets the resync progress percentage. This is calculated based on total bytes processed for all disks in the source VM. + public int? ResyncProgressPercentage { get; } + /// Gets or sets the resync retry count. + public long? ResyncRetryCount { get; } + /// Gets or sets a value indicating whether resync is required. + public bool? ResyncRequired { get; } + /// Gets or sets the resync state. + public VMwareToAzureMigrateResyncState? ResyncState { get; } + /// Gets or sets a value indicating whether auto resync is to be done. + public bool? PerformAutoResync { get; set; } + /// Gets or sets the resume retry count. + public long? ResumeRetryCount { get; } + /// Gets or sets the latest timestamp that replication status is updated. + public DateTimeOffset? LastReplicationUpdateOn { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs new file mode 100644 index 000000000000..a78bfa0b9f37 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciProtectedItemCustomPropertiesUpdate : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(NicsToInclude)) + { + writer.WritePropertyName("nicsToInclude"u8); + writer.WriteStartArray(); + foreach (var item in NicsToInclude) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(TargetCpuCores)) + { + writer.WritePropertyName("targetCpuCores"u8); + writer.WriteNumberValue(TargetCpuCores.Value); + } + if (Optional.IsDefined(IsDynamicRam)) + { + writer.WritePropertyName("isDynamicRam"u8); + writer.WriteBooleanValue(IsDynamicRam.Value); + } + if (Optional.IsDefined(DynamicMemoryConfig)) + { + writer.WritePropertyName("dynamicMemoryConfig"u8); + writer.WriteObjectValue(DynamicMemoryConfig, options); + } + if (Optional.IsDefined(TargetMemoryInMegaBytes)) + { + writer.WritePropertyName("targetMemoryInMegaBytes"u8); + writer.WriteNumberValue(TargetMemoryInMegaBytes.Value); + } + if (Optional.IsDefined(OSType)) + { + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType); + } + } + + VMwareToAzStackHciProtectedItemCustomPropertiesUpdate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + + internal static VMwareToAzStackHciProtectedItemCustomPropertiesUpdate DeserializeVMwareToAzStackHciProtectedItemCustomPropertiesUpdate(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList nicsToInclude = default; + int? targetCpuCores = default; + bool? isDynamicRam = default; + ProtectedItemDynamicMemoryConfig dynamicMemoryConfig = default; + int? targetMemoryInMegaBytes = default; + string osType = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicsToInclude"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VMwareToAzStackHciNicInput.DeserializeVMwareToAzStackHciNicInput(item, options)); + } + nicsToInclude = array; + continue; + } + if (property.NameEquals("targetCpuCores"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetCpuCores = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("isDynamicRam"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDynamicRam = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("dynamicMemoryConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dynamicMemoryConfig = ProtectedItemDynamicMemoryConfig.DeserializeProtectedItemDynamicMemoryConfig(property.Value, options); + continue; + } + if (property.NameEquals("targetMemoryInMegaBytes"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + targetMemoryInMegaBytes = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("osType"u8)) + { + osType = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciProtectedItemCustomPropertiesUpdate( + instanceType, + serializedAdditionalRawData, + nicsToInclude ?? new ChangeTrackingList(), + targetCpuCores, + isDynamicRam, + dynamicMemoryConfig, + targetMemoryInMegaBytes, + osType); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciProtectedItemCustomPropertiesUpdate IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciProtectedItemCustomPropertiesUpdate(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedItemCustomPropertiesUpdate)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.cs new file mode 100644 index 000000000000..12a58fef778f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedItemCustomPropertiesUpdate.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI Protected item model custom properties. + public partial class VMwareToAzStackHciProtectedItemCustomPropertiesUpdate : DataReplicationProtectedItemCustomPropertiesUpdate + { + /// Initializes a new instance of . + public VMwareToAzStackHciProtectedItemCustomPropertiesUpdate() + { + NicsToInclude = new ChangeTrackingList(); + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationProtectedItemCustomPropertiesUpdate. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the list of VM NIC to replicate. + /// Gets or sets the target CPU cores. + /// Gets or sets a value indicating whether memory is dynamical. + /// Protected item dynamic memory config. + /// Gets or sets the target memory in mega-bytes. + /// Gets or sets the type of the OS. + internal VMwareToAzStackHciProtectedItemCustomPropertiesUpdate(string instanceType, IDictionary serializedAdditionalRawData, IList nicsToInclude, int? targetCpuCores, bool? isDynamicRam, ProtectedItemDynamicMemoryConfig dynamicMemoryConfig, int? targetMemoryInMegaBytes, string osType) : base(instanceType, serializedAdditionalRawData) + { + NicsToInclude = nicsToInclude; + TargetCpuCores = targetCpuCores; + IsDynamicRam = isDynamicRam; + DynamicMemoryConfig = dynamicMemoryConfig; + TargetMemoryInMegaBytes = targetMemoryInMegaBytes; + OSType = osType; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Gets or sets the list of VM NIC to replicate. + public IList NicsToInclude { get; } + /// Gets or sets the target CPU cores. + public int? TargetCpuCores { get; set; } + /// Gets or sets a value indicating whether memory is dynamical. + public bool? IsDynamicRam { get; set; } + /// Protected item dynamic memory config. + public ProtectedItemDynamicMemoryConfig DynamicMemoryConfig { get; set; } + /// Gets or sets the target memory in mega-bytes. + public int? TargetMemoryInMegaBytes { get; set; } + /// Gets or sets the type of the OS. + public string OSType { get; set; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedNicProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedNicProperties.Serialization.cs new file mode 100644 index 000000000000..5134205e1cc8 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedNicProperties.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciProtectedNicProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedNicProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(NicId)) + { + writer.WritePropertyName("nicId"u8); + writer.WriteStringValue(NicId); + } + if (options.Format != "W" && Optional.IsDefined(MacAddress)) + { + writer.WritePropertyName("macAddress"u8); + writer.WriteStringValue(MacAddress); + } + if (options.Format != "W" && Optional.IsDefined(Label)) + { + writer.WritePropertyName("label"u8); + writer.WriteStringValue(Label); + } + if (Optional.IsDefined(IsPrimaryNic)) + { + writer.WritePropertyName("isPrimaryNic"u8); + writer.WriteBooleanValue(IsPrimaryNic.Value); + } + if (options.Format != "W" && Optional.IsDefined(NetworkName)) + { + writer.WritePropertyName("networkName"u8); + writer.WriteStringValue(NetworkName); + } + if (options.Format != "W" && Optional.IsDefined(TargetNetworkId)) + { + writer.WritePropertyName("targetNetworkId"u8); + writer.WriteStringValue(TargetNetworkId); + } + if (options.Format != "W" && Optional.IsDefined(TestNetworkId)) + { + writer.WritePropertyName("testNetworkId"u8); + writer.WriteStringValue(TestNetworkId); + } + if (options.Format != "W" && Optional.IsDefined(SelectionTypeForFailover)) + { + writer.WritePropertyName("selectionTypeForFailover"u8); + writer.WriteStringValue(SelectionTypeForFailover.Value.ToString()); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VMwareToAzStackHciProtectedNicProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedNicProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciProtectedNicProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciProtectedNicProperties DeserializeVMwareToAzStackHciProtectedNicProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nicId = default; + string macAddress = default; + string label = default; + bool? isPrimaryNic = default; + string networkName = default; + string targetNetworkId = default; + string testNetworkId = default; + VmNicSelection? selectionTypeForFailover = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nicId"u8)) + { + nicId = property.Value.GetString(); + continue; + } + if (property.NameEquals("macAddress"u8)) + { + macAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("label"u8)) + { + label = property.Value.GetString(); + continue; + } + if (property.NameEquals("isPrimaryNic"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isPrimaryNic = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("networkName"u8)) + { + networkName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetNetworkId"u8)) + { + targetNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("testNetworkId"u8)) + { + testNetworkId = property.Value.GetString(); + continue; + } + if (property.NameEquals("selectionTypeForFailover"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + selectionTypeForFailover = new VmNicSelection(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciProtectedNicProperties( + nicId, + macAddress, + label, + isPrimaryNic, + networkName, + targetNetworkId, + testNetworkId, + selectionTypeForFailover, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedNicProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciProtectedNicProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciProtectedNicProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciProtectedNicProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedNicProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedNicProperties.cs new file mode 100644 index 000000000000..c7b97818ff05 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciProtectedNicProperties.cs @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMwareToAzStackHCI NIC properties. + public partial class VMwareToAzStackHciProtectedNicProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + internal VMwareToAzStackHciProtectedNicProperties() + { + } + + /// Initializes a new instance of . + /// Gets or sets the NIC Id. + /// Gets or sets the NIC mac address. + /// Gets or sets the NIC label. + /// Gets or sets a value indicating whether this is the primary NIC. + /// Gets or sets the network name. + /// Gets or sets the target network Id within AzStackHCI Cluster. + /// Gets or sets the target test network Id within AzStackHCI Cluster. + /// Gets or sets the selection type of the NIC. + /// Keeps track of any properties unknown to the library. + internal VMwareToAzStackHciProtectedNicProperties(string nicId, string macAddress, string label, bool? isPrimaryNic, string networkName, string targetNetworkId, string testNetworkId, VmNicSelection? selectionTypeForFailover, IDictionary serializedAdditionalRawData) + { + NicId = nicId; + MacAddress = macAddress; + Label = label; + IsPrimaryNic = isPrimaryNic; + NetworkName = networkName; + TargetNetworkId = targetNetworkId; + TestNetworkId = testNetworkId; + SelectionTypeForFailover = selectionTypeForFailover; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the NIC Id. + public string NicId { get; } + /// Gets or sets the NIC mac address. + public string MacAddress { get; } + /// Gets or sets the NIC label. + public string Label { get; } + /// Gets or sets a value indicating whether this is the primary NIC. + public bool? IsPrimaryNic { get; } + /// Gets or sets the network name. + public string NetworkName { get; } + /// Gets or sets the target network Id within AzStackHCI Cluster. + public string TargetNetworkId { get; } + /// Gets or sets the target test network Id within AzStackHCI Cluster. + public string TestNetworkId { get; } + /// Gets or sets the selection type of the NIC. + public VmNicSelection? SelectionTypeForFailover { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.Serialization.cs new file mode 100644 index 000000000000..2b658fbc7747 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.Serialization.cs @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciRecoveryPointCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciRecoveryPointCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (options.Format != "W" && Optional.IsCollectionDefined(DiskIds)) + { + writer.WritePropertyName("diskIds"u8); + writer.WriteStartArray(); + foreach (var item in DiskIds) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + VMwareToAzStackHciRecoveryPointCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciRecoveryPointCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciRecoveryPointCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciRecoveryPointCustomProperties DeserializeVMwareToAzStackHciRecoveryPointCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList diskIds = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskIds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + diskIds = array; + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciRecoveryPointCustomProperties(instanceType, serializedAdditionalRawData, diskIds ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciRecoveryPointCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciRecoveryPointCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciRecoveryPointCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciRecoveryPointCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.cs new file mode 100644 index 000000000000..16ac151433bb --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciRecoveryPointCustomProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI recovery point model custom properties. + public partial class VMwareToAzStackHciRecoveryPointCustomProperties : DataReplicationRecoveryPointCustomProperties + { + /// Initializes a new instance of . + internal VMwareToAzStackHciRecoveryPointCustomProperties() + { + DiskIds = new ChangeTrackingList(); + InstanceType = "VMwareToAzStackHCIRecoveryPointModelCustomProperties"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationRecoveryPointCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the list of the disk Ids. + internal VMwareToAzStackHciRecoveryPointCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, IReadOnlyList diskIds) : base(instanceType, serializedAdditionalRawData) + { + DiskIds = diskIds; + InstanceType = instanceType ?? "VMwareToAzStackHCIRecoveryPointModelCustomProperties"; + } + + /// Gets or sets the list of the disk Ids. + public IReadOnlyList DiskIds { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.Serialization.cs new file mode 100644 index 000000000000..66a6bda48142 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.Serialization.cs @@ -0,0 +1,318 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + public partial class VMwareToAzStackHciReplicationExtensionCustomProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciReplicationExtensionCustomProperties)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("vmwareFabricArmId"u8); + writer.WriteStringValue(VmwareFabricArmId); + if (options.Format != "W" && Optional.IsDefined(VmwareSiteId)) + { + writer.WritePropertyName("vmwareSiteId"u8); + writer.WriteStringValue(VmwareSiteId); + } + writer.WritePropertyName("azStackHciFabricArmId"u8); + writer.WriteStringValue(AzStackHciFabricArmId); + if (options.Format != "W" && Optional.IsDefined(AzStackHciSiteId)) + { + writer.WritePropertyName("azStackHciSiteId"u8); + writer.WriteStringValue(AzStackHciSiteId); + } + if (Optional.IsDefined(StorageAccountId)) + { + writer.WritePropertyName("storageAccountId"u8); + writer.WriteStringValue(StorageAccountId); + } + if (Optional.IsDefined(StorageAccountSasSecretName)) + { + writer.WritePropertyName("storageAccountSasSecretName"u8); + writer.WriteStringValue(StorageAccountSasSecretName); + } + if (options.Format != "W" && Optional.IsDefined(AsrServiceUri)) + { + writer.WritePropertyName("asrServiceUri"u8); + writer.WriteStringValue(AsrServiceUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(RcmServiceUri)) + { + writer.WritePropertyName("rcmServiceUri"u8); + writer.WriteStringValue(RcmServiceUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(GatewayServiceUri)) + { + writer.WritePropertyName("gatewayServiceUri"u8); + writer.WriteStringValue(GatewayServiceUri.AbsoluteUri); + } + if (options.Format != "W" && Optional.IsDefined(SourceGatewayServiceId)) + { + writer.WritePropertyName("sourceGatewayServiceId"u8); + writer.WriteStringValue(SourceGatewayServiceId); + } + if (options.Format != "W" && Optional.IsDefined(TargetGatewayServiceId)) + { + writer.WritePropertyName("targetGatewayServiceId"u8); + writer.WriteStringValue(TargetGatewayServiceId); + } + if (options.Format != "W" && Optional.IsDefined(SourceStorageContainerName)) + { + writer.WritePropertyName("sourceStorageContainerName"u8); + writer.WriteStringValue(SourceStorageContainerName); + } + if (options.Format != "W" && Optional.IsDefined(TargetStorageContainerName)) + { + writer.WritePropertyName("targetStorageContainerName"u8); + writer.WriteStringValue(TargetStorageContainerName); + } + if (options.Format != "W" && Optional.IsDefined(ResourceLocation)) + { + writer.WritePropertyName("resourceLocation"u8); + writer.WriteStringValue(ResourceLocation); + } + if (options.Format != "W" && Optional.IsDefined(SubscriptionId)) + { + writer.WritePropertyName("subscriptionId"u8); + writer.WriteStringValue(SubscriptionId); + } + if (options.Format != "W" && Optional.IsDefined(ResourceGroup)) + { + writer.WritePropertyName("resourceGroup"u8); + writer.WriteStringValue(ResourceGroup); + } + } + + VMwareToAzStackHciReplicationExtensionCustomProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VMwareToAzStackHciReplicationExtensionCustomProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVMwareToAzStackHciReplicationExtensionCustomProperties(document.RootElement, options); + } + + internal static VMwareToAzStackHciReplicationExtensionCustomProperties DeserializeVMwareToAzStackHciReplicationExtensionCustomProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier vmwareFabricArmId = default; + ResourceIdentifier vmwareSiteId = default; + ResourceIdentifier azStackHciFabricArmId = default; + ResourceIdentifier azStackHciSiteId = default; + string storageAccountId = default; + string storageAccountSasSecretName = default; + Uri asrServiceUri = default; + Uri rcmServiceUri = default; + Uri gatewayServiceUri = default; + string sourceGatewayServiceId = default; + string targetGatewayServiceId = default; + string sourceStorageContainerName = default; + string targetStorageContainerName = default; + string resourceLocation = default; + string subscriptionId = default; + string resourceGroup = default; + string instanceType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmwareFabricArmId"u8)) + { + vmwareFabricArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("vmwareSiteId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + vmwareSiteId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azStackHciFabricArmId"u8)) + { + azStackHciFabricArmId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("azStackHciSiteId"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + azStackHciSiteId = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageAccountId"u8)) + { + storageAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountSasSecretName"u8)) + { + storageAccountSasSecretName = property.Value.GetString(); + continue; + } + if (property.NameEquals("asrServiceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + asrServiceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("rcmServiceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + rcmServiceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("gatewayServiceUri"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gatewayServiceUri = new Uri(property.Value.GetString()); + continue; + } + if (property.NameEquals("sourceGatewayServiceId"u8)) + { + sourceGatewayServiceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetGatewayServiceId"u8)) + { + targetGatewayServiceId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceStorageContainerName"u8)) + { + sourceStorageContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("targetStorageContainerName"u8)) + { + targetStorageContainerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceLocation"u8)) + { + resourceLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("subscriptionId"u8)) + { + subscriptionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("resourceGroup"u8)) + { + resourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("instanceType"u8)) + { + instanceType = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VMwareToAzStackHciReplicationExtensionCustomProperties( + instanceType, + serializedAdditionalRawData, + vmwareFabricArmId, + vmwareSiteId, + azStackHciFabricArmId, + azStackHciSiteId, + storageAccountId, + storageAccountSasSecretName, + asrServiceUri, + rcmServiceUri, + gatewayServiceUri, + sourceGatewayServiceId, + targetGatewayServiceId, + sourceStorageContainerName, + targetStorageContainerName, + resourceLocation, + subscriptionId, + resourceGroup); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciReplicationExtensionCustomProperties)} does not support writing '{options.Format}' format."); + } + } + + VMwareToAzStackHciReplicationExtensionCustomProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVMwareToAzStackHciReplicationExtensionCustomProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VMwareToAzStackHciReplicationExtensionCustomProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.cs new file mode 100644 index 000000000000..3eb055f7b13a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzStackHciReplicationExtensionCustomProperties.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// VMware to AzStackHCI Replication extension model custom properties. + public partial class VMwareToAzStackHciReplicationExtensionCustomProperties : DataReplicationExtensionCustomProperties + { + /// Initializes a new instance of . + /// Gets or sets the ARM Id of the source VMware fabric. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// or is null. + public VMwareToAzStackHciReplicationExtensionCustomProperties(ResourceIdentifier vmwareFabricArmId, ResourceIdentifier azStackHciFabricArmId) + { + Argument.AssertNotNull(vmwareFabricArmId, nameof(vmwareFabricArmId)); + Argument.AssertNotNull(azStackHciFabricArmId, nameof(azStackHciFabricArmId)); + + VmwareFabricArmId = vmwareFabricArmId; + AzStackHciFabricArmId = azStackHciFabricArmId; + InstanceType = "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of . + /// Discriminator property for DataReplicationExtensionCustomProperties. + /// Keeps track of any properties unknown to the library. + /// Gets or sets the ARM Id of the source VMware fabric. + /// Gets or sets the ARM Id of the VMware site. + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + /// Gets or sets the ARM Id of the AzStackHCI site. + /// Gets or sets the storage account Id. + /// Gets or sets the Sas Secret of storage account. + /// Gets or sets the Uri of ASR. + /// Gets or sets the Uri of Rcm. + /// Gets or sets the Uri of Gateway. + /// Gets or sets the gateway service Id of source. + /// Gets or sets the gateway service Id of target. + /// Gets or sets the source storage container name. + /// Gets or sets the target storage container name. + /// Gets or sets the resource location. + /// Gets or sets the subscription. + /// Gets or sets the resource group. + internal VMwareToAzStackHciReplicationExtensionCustomProperties(string instanceType, IDictionary serializedAdditionalRawData, ResourceIdentifier vmwareFabricArmId, ResourceIdentifier vmwareSiteId, ResourceIdentifier azStackHciFabricArmId, ResourceIdentifier azStackHciSiteId, string storageAccountId, string storageAccountSasSecretName, Uri asrServiceUri, Uri rcmServiceUri, Uri gatewayServiceUri, string sourceGatewayServiceId, string targetGatewayServiceId, string sourceStorageContainerName, string targetStorageContainerName, string resourceLocation, string subscriptionId, string resourceGroup) : base(instanceType, serializedAdditionalRawData) + { + VmwareFabricArmId = vmwareFabricArmId; + VmwareSiteId = vmwareSiteId; + AzStackHciFabricArmId = azStackHciFabricArmId; + AzStackHciSiteId = azStackHciSiteId; + StorageAccountId = storageAccountId; + StorageAccountSasSecretName = storageAccountSasSecretName; + AsrServiceUri = asrServiceUri; + RcmServiceUri = rcmServiceUri; + GatewayServiceUri = gatewayServiceUri; + SourceGatewayServiceId = sourceGatewayServiceId; + TargetGatewayServiceId = targetGatewayServiceId; + SourceStorageContainerName = sourceStorageContainerName; + TargetStorageContainerName = targetStorageContainerName; + ResourceLocation = resourceLocation; + SubscriptionId = subscriptionId; + ResourceGroup = resourceGroup; + InstanceType = instanceType ?? "VMwareToAzStackHCI"; + } + + /// Initializes a new instance of for deserialization. + internal VMwareToAzStackHciReplicationExtensionCustomProperties() + { + } + + /// Gets or sets the ARM Id of the source VMware fabric. + public ResourceIdentifier VmwareFabricArmId { get; set; } + /// Gets or sets the ARM Id of the VMware site. + public ResourceIdentifier VmwareSiteId { get; } + /// Gets or sets the ARM Id of the target AzStackHCI fabric. + public ResourceIdentifier AzStackHciFabricArmId { get; set; } + /// Gets or sets the ARM Id of the AzStackHCI site. + public ResourceIdentifier AzStackHciSiteId { get; } + /// Gets or sets the storage account Id. + public string StorageAccountId { get; set; } + /// Gets or sets the Sas Secret of storage account. + public string StorageAccountSasSecretName { get; set; } + /// Gets or sets the Uri of ASR. + public Uri AsrServiceUri { get; } + /// Gets or sets the Uri of Rcm. + public Uri RcmServiceUri { get; } + /// Gets or sets the Uri of Gateway. + public Uri GatewayServiceUri { get; } + /// Gets or sets the gateway service Id of source. + public string SourceGatewayServiceId { get; } + /// Gets or sets the gateway service Id of target. + public string TargetGatewayServiceId { get; } + /// Gets or sets the source storage container name. + public string SourceStorageContainerName { get; } + /// Gets or sets the target storage container name. + public string TargetStorageContainerName { get; } + /// Gets or sets the resource location. + public string ResourceLocation { get; } + /// Gets or sets the subscription. + public string SubscriptionId { get; } + /// Gets or sets the resource group. + public string ResourceGroup { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzureMigrateResyncState.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzureMigrateResyncState.cs new file mode 100644 index 000000000000..86cd45ebfb00 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VMwareToAzureMigrateResyncState.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the resync state. + public readonly partial struct VMwareToAzureMigrateResyncState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VMwareToAzureMigrateResyncState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string PreparedForResynchronizationValue = "PreparedForResynchronization"; + private const string StartedResynchronizationValue = "StartedResynchronization"; + + /// None state. + public static VMwareToAzureMigrateResyncState None { get; } = new VMwareToAzureMigrateResyncState(NoneValue); + /// Prepared for resynchronization state. + public static VMwareToAzureMigrateResyncState PreparedForResynchronization { get; } = new VMwareToAzureMigrateResyncState(PreparedForResynchronizationValue); + /// Started resynchronization state. + public static VMwareToAzureMigrateResyncState StartedResynchronization { get; } = new VMwareToAzureMigrateResyncState(StartedResynchronizationValue); + /// Determines if two values are the same. + public static bool operator ==(VMwareToAzureMigrateResyncState left, VMwareToAzureMigrateResyncState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VMwareToAzureMigrateResyncState left, VMwareToAzureMigrateResyncState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VMwareToAzureMigrateResyncState(string value) => new VMwareToAzureMigrateResyncState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VMwareToAzureMigrateResyncState other && Equals(other); + /// + public bool Equals(VMwareToAzureMigrateResyncState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.Serialization.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.Serialization.cs new file mode 100644 index 000000000000..c0ebad949be1 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.Serialization.cs @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + internal partial class VaultModelListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VaultModelListResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink.AbsoluteUri); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + VaultModelListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VaultModelListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVaultModelListResult(document.RootElement, options); + } + + internal static VaultModelListResult DeserializeVaultModelListResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList value = default; + Uri nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DataReplicationVaultData.DeserializeDataReplicationVaultData(item, options)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VaultModelListResult(value, nextLink, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(VaultModelListResult)} does not support writing '{options.Format}' format."); + } + } + + VaultModelListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVaultModelListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VaultModelListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.cs new file mode 100644 index 000000000000..faf0723c4776 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VaultModelListResult.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Linq; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// The response of a VaultModel list operation. + internal partial class VaultModelListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// The VaultModel items on this page. + /// is null. + internal VaultModelListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The VaultModel items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal VaultModelListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VaultModelListResult() + { + } + + /// The VaultModel items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VmNicSelection.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VmNicSelection.cs new file mode 100644 index 000000000000..1b7b81e237db --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/Models/VmNicSelection.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Models +{ + /// Gets or sets the selection type of the NIC. + public readonly partial struct VmNicSelection : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public VmNicSelection(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NotSelectedValue = "NotSelected"; + private const string SelectedByUserValue = "SelectedByUser"; + private const string SelectedByDefaultValue = "SelectedByDefault"; + private const string SelectedByUserOverrideValue = "SelectedByUserOverride"; + + /// Not Selected. + public static VmNicSelection NotSelected { get; } = new VmNicSelection(NotSelectedValue); + /// Selected by user. + public static VmNicSelection SelectedByUser { get; } = new VmNicSelection(SelectedByUserValue); + /// Default selection by ASR. + public static VmNicSelection SelectedByDefault { get; } = new VmNicSelection(SelectedByDefaultValue); + /// NIC configuration overridden by user. Differs from SelectedByUser in the sense that the legacy SelectedByUser is used both for explicit modification by user and implicit approval of user if the settings are used for TFO/FO. SelectedByUserOverride implies user overriding at least one of the configurations. + public static VmNicSelection SelectedByUserOverride { get; } = new VmNicSelection(SelectedByUserOverrideValue); + /// Determines if two values are the same. + public static bool operator ==(VmNicSelection left, VmNicSelection right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(VmNicSelection left, VmNicSelection right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator VmNicSelection(string value) => new VmNicSelection(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is VmNicSelection other && Equals(other); + /// + public bool Equals(VmNicSelection other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value != null ? StringComparer.InvariantCultureIgnoreCase.GetHashCode(_value) : 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProviderConstants.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..c468763062c9 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/ProviderConstants.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/CheckNameAvailabilityRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/CheckNameAvailabilityRestOperations.cs new file mode 100644 index 000000000000..a5d5c901ac68 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/CheckNameAvailabilityRestOperations.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class CheckNameAvailabilityRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of CheckNameAvailabilityRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public CheckNameAvailabilityRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreatePostRequestUri(string subscriptionId, AzureLocation location, DataReplicationNameAvailabilityContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/checkNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePostRequest(string subscriptionId, AzureLocation location, DataReplicationNameAvailabilityContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/checkNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Checks the resource name availability. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> PostAsync(string subscriptionId, AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreatePostRequest(subscriptionId, location, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationNameAvailabilityResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationNameAvailabilityResult.DeserializeDataReplicationNameAvailabilityResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Checks the resource name availability. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// Resource details. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response Post(string subscriptionId, AzureLocation location, DataReplicationNameAvailabilityContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreatePostRequest(subscriptionId, location, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationNameAvailabilityResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationNameAvailabilityResult.DeserializeDataReplicationNameAvailabilityResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/DeploymentPreflightRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/DeploymentPreflightRestOperations.cs new file mode 100644 index 000000000000..de8ca70d59fe --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/DeploymentPreflightRestOperations.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class DeploymentPreflightRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of DeploymentPreflightRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public DeploymentPreflightRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreatePostRequestUri(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflight body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/preflight", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePostRequest(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflight body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/deployments/", false); + uri.AppendPath(deploymentId, true); + uri.AppendPath("/preflight", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (body != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + } + _userAgent.Apply(message); + return message; + } + + /// Performs resource deployment preflight validation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> PostAsync(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflight body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var message = CreatePostRequest(subscriptionId, resourceGroupName, deploymentId, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DeploymentPreflight value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DeploymentPreflight.DeserializeDeploymentPreflight(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs resource deployment preflight validation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Deployment Id. + /// Deployment preflight model. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Post(string subscriptionId, string resourceGroupName, string deploymentId, DeploymentPreflight body = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(deploymentId, nameof(deploymentId)); + + using var message = CreatePostRequest(subscriptionId, resourceGroupName, deploymentId, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DeploymentPreflight value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DeploymentPreflight.DeserializeDeploymentPreflight(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EmailConfigurationRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EmailConfigurationRestOperations.cs new file mode 100644 index 000000000000..e1f15eaa2bfc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EmailConfigurationRestOperations.cs @@ -0,0 +1,431 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class EmailConfigurationRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EmailConfigurationRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public EmailConfigurationRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings/", false); + uri.AppendPath(emailConfigurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings/", false); + uri.AppendPath(emailConfigurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the alert configuration setting. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The email configuration name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, emailConfigurationName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationEmailConfigurationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationEmailConfigurationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the alert configuration setting. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The email configuration name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, emailConfigurationName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationEmailConfigurationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationEmailConfigurationData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, DataReplicationEmailConfigurationData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings/", false); + uri.AppendPath(emailConfigurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, DataReplicationEmailConfigurationData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings/", false); + uri.AppendPath(emailConfigurationName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates an alert configuration setting for the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The email configuration name. + /// EmailConfiguration model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, DataReplicationEmailConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, emailConfigurationName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + DataReplicationEmailConfigurationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates an alert configuration setting for the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The email configuration name. + /// EmailConfiguration model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string vaultName, string emailConfigurationName, DataReplicationEmailConfigurationData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(emailConfigurationName, nameof(emailConfigurationName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, emailConfigurationName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + DataReplicationEmailConfigurationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationEmailConfigurationData.DeserializeDataReplicationEmailConfigurationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/alertSettings", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of alert configuration settings for the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EmailConfigurationModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EmailConfigurationModelListResult.DeserializeEmailConfigurationModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of alert configuration settings for the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EmailConfigurationModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EmailConfigurationModelListResult.DeserializeEmailConfigurationModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of alert configuration settings for the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EmailConfigurationModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EmailConfigurationModelListResult.DeserializeEmailConfigurationModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of alert configuration settings for the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EmailConfigurationModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EmailConfigurationModelListResult.DeserializeEmailConfigurationModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EventRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EventRestOperations.cs new file mode 100644 index 000000000000..88441d3676c4 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/EventRestOperations.cs @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class EventRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of EventRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public EventRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string eventName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/events/", false); + uri.AppendPath(eventName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string eventName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/events/", false); + uri.AppendPath(eventName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the event. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The event name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, eventName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationEventData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationEventData.DeserializeDataReplicationEventData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationEventData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the event. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The event name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string eventName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(eventName, nameof(eventName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, eventName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationEventData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationEventData.DeserializeDataReplicationEventData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationEventData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/events", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/events", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of events in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EventModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EventModelListResult.DeserializeEventModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of events in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EventModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EventModelListResult.DeserializeEventModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of events in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + EventModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = EventModelListResult.DeserializeEventModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of events in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + EventModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = EventModelListResult.DeserializeEventModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricAgentRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricAgentRestOperations.cs new file mode 100644 index 000000000000..5f3a4204ac74 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricAgentRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class FabricAgentRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FabricAgentRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FabricAgentRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationFabricAgentData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationFabricAgentData.DeserializeDataReplicationFabricAgentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationFabricAgentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationFabricAgentData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationFabricAgentData.DeserializeDataReplicationFabricAgentData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationFabricAgentData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, DataReplicationFabricAgentData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, DataReplicationFabricAgentData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent name. + /// Fabric agent model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, DataReplicationFabricAgentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent name. + /// Fabric agent model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, DataReplicationFabricAgentData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents/", false); + uri.AppendPath(fabricAgentName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes fabric agent. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The fabric agent name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fabricName, string fabricAgentName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNullOrEmpty(fabricAgentName, nameof(fabricAgentName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fabricName, fabricAgentName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string fabricName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string fabricName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendPath("/fabricAgents", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabric agents in the given fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, fabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricAgentModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FabricAgentModelListResult.DeserializeFabricAgentModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabric agents in the given fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, fabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricAgentModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FabricAgentModelListResult.DeserializeFabricAgentModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string fabricName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string fabricName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabric agents in the given fabric. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, fabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricAgentModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FabricAgentModelListResult.DeserializeFabricAgentModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabric agents in the given fabric. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, fabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricAgentModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FabricAgentModelListResult.DeserializeFabricAgentModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricRestOperations.cs new file mode 100644 index 000000000000..abd43c6217dc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/FabricRestOperations.cs @@ -0,0 +1,735 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class FabricRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of FabricRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public FabricRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string fabricName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string fabricName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationFabricData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationFabricData.DeserializeDataReplicationFabricData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationFabricData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, fabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationFabricData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationFabricData.DeserializeDataReplicationFabricData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationFabricData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string fabricName, DataReplicationFabricData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string fabricName, DataReplicationFabricData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// Fabric properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string fabricName, DataReplicationFabricData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fabricName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// Fabric properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string fabricName, DataReplicationFabricData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, fabricName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string fabricName, DataReplicationFabricPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string fabricName, DataReplicationFabricPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Performs update on the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// Fabric properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string fabricName, DataReplicationFabricPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fabricName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs update on the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// Fabric properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string fabricName, DataReplicationFabricPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, fabricName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string fabricName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string fabricName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics/", false); + uri.AppendPath(fabricName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Removes the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fabricName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Removes the fabric. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The fabric name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string fabricName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(fabricName, nameof(fabricName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, fabricName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string continuationToken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string continuationToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabrics in the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabrics in the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationFabrics", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabrics in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabrics in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabrics in the given subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabrics in the given subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of fabrics in the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of fabrics in the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FabricModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FabricModelListResult.DeserializeFabricModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/JobRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/JobRestOperations.cs new file mode 100644 index 000000000000..f053e81f3639 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/JobRestOperations.cs @@ -0,0 +1,357 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class JobRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of JobRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public JobRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string jobName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string jobName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/jobs/", false); + uri.AppendPath(jobName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The job name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, jobName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationJobData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationJobData.DeserializeDataReplicationJobData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationJobData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the job. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The job name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string jobName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(jobName, nameof(jobName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, jobName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationJobData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationJobData.DeserializeDataReplicationJobData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationJobData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/jobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/jobs", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of jobs in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + JobModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = JobModelListResult.DeserializeJobModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of jobs in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + JobModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = JobModelListResult.DeserializeJobModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of jobs in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + JobModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = JobModelListResult.DeserializeJobModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of jobs in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + JobModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = JobModelListResult.DeserializeJobModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PolicyRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PolicyRestOperations.cs new file mode 100644 index 000000000000..d0226a05de63 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PolicyRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class PolicyRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PolicyRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public PolicyRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, policyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPolicyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPolicyData.DeserializeDataReplicationPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPolicyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, policyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPolicyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPolicyData.DeserializeDataReplicationPolicyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPolicyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string policyName, DataReplicationPolicyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string policyName, DataReplicationPolicyData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// Policy model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string vaultName, string policyName, DataReplicationPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, policyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// Policy model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string vaultName, string policyName, DataReplicationPolicyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, policyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string policyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies/", false); + uri.AppendPath(policyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Removes the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, policyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Removes the policy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The policy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, string policyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(policyName, nameof(policyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, policyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationPolicies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of policies in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PolicyModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PolicyModelListResult.DeserializePolicyModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of policies in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PolicyModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PolicyModelListResult.DeserializePolicyModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of policies in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PolicyModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PolicyModelListResult.DeserializePolicyModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of policies in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PolicyModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PolicyModelListResult.DeserializePolicyModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionProxiesRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionProxiesRestOperations.cs new file mode 100644 index 000000000000..dc659b812480 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionProxiesRestOperations.cs @@ -0,0 +1,633 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class PrivateEndpointConnectionProxiesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateEndpointConnectionProxiesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public PrivateEndpointConnectionProxiesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the private endpoint connection proxy details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateEndpointConnectionProxyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPrivateEndpointConnectionProxyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the private endpoint connection proxy details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateEndpointConnectionProxyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPrivateEndpointConnectionProxyData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> CreateAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + DataReplicationPrivateEndpointConnectionProxyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create a new private endpoint connection proxy which includes both auto and manual approval types. Creating the proxy resource will also create a private endpoint connection resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// Private endpoint connection creation input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + DataReplicationPrivateEndpointConnectionProxyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Returns the operation to track the deletion of private endpoint connection proxy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns the operation to track the deletion of private endpoint connection proxy. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the all private endpoint connections proxies. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionProxyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionProxyListResult.DeserializePrivateEndpointConnectionProxyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the all private endpoint connections proxies. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionProxyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PrivateEndpointConnectionProxyListResult.DeserializePrivateEndpointConnectionProxyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateValidateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendPath("/validate", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateValidateRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnectionProxies/", false); + uri.AppendPath(privateEndpointConnectionProxyName, true); + uri.AppendPath("/validate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Returns remote private endpoint connection information after validation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// The private endpoint connection proxy input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ValidateAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateValidateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateEndpointConnectionProxyData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Returns remote private endpoint connection information after validation. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection proxy name. + /// The private endpoint connection proxy input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Validate(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionProxyName, DataReplicationPrivateEndpointConnectionProxyData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionProxyName, nameof(privateEndpointConnectionProxyName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateValidateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionProxyName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateEndpointConnectionProxyData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPrivateEndpointConnectionProxyData.DeserializeDataReplicationPrivateEndpointConnectionProxyData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the all private endpoint connections proxies. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionProxyListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = PrivateEndpointConnectionProxyListResult.DeserializePrivateEndpointConnectionProxyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the all private endpoint connections proxies. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + PrivateEndpointConnectionProxyListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = PrivateEndpointConnectionProxyListResult.DeserializePrivateEndpointConnectionProxyListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs new file mode 100644 index 000000000000..2b77aee4c22f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -0,0 +1,523 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class PrivateEndpointConnectionsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateEndpointConnectionsRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the private endpoint connection details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateEndpointConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the private endpoint connection details. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateEndpointConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPrivateEndpointConnectionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, DataReplicationPrivateEndpointConnectionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, DataReplicationPrivateEndpointConnectionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection name. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, DataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + { + DataReplicationPrivateEndpointConnectionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updated the private endpoint connection status (Approval/Rejected). This gets invoked by resource admin. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection name. + /// Private endpoint connection update input. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, DataReplicationPrivateEndpointConnectionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + { + DataReplicationPrivateEndpointConnectionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPrivateEndpointConnectionData.DeserializeDataReplicationPrivateEndpointConnectionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections/", false); + uri.AppendPath(privateEndpointConnectionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the private endpoint connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the private endpoint connection. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private endpoint connection name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, string privateEndpointConnectionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateEndpointConnectionName, nameof(privateEndpointConnectionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, privateEndpointConnectionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateEndpointConnections", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the all private endpoint connections configured on the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the all private endpoint connections configured on the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the all private endpoint connections configured on the vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the all private endpoint connections configured on the vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateEndpointConnectionListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = RecoveryServicesDataReplicationPrivateEndpointConnectionListResult.DeserializeRecoveryServicesDataReplicationPrivateEndpointConnectionListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs new file mode 100644 index 000000000000..2cdfcae8a289 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -0,0 +1,321 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class PrivateLinkResourcesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of PrivateLinkResourcesRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateLinkResources/", false); + uri.AppendPath(privateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateLinkResources/", false); + uri.AppendPath(privateLinkResourceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of site recovery private link resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private link name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateLinkResourceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateLinkResourceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationPrivateLinkResourceData.DeserializeDataReplicationPrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPrivateLinkResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of site recovery private link resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The private link name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string privateLinkResourceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(privateLinkResourceName, nameof(privateLinkResourceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, privateLinkResourceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationPrivateLinkResourceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationPrivateLinkResourceData.DeserializeDataReplicationPrivateLinkResourceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationPrivateLinkResourceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/privateLinkResources", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of private link resources. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateLinkResourceListResult.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of private link resources. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = RecoveryServicesDataReplicationPrivateLinkResourceListResult.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of private link resources. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateLinkResourceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = RecoveryServicesDataReplicationPrivateLinkResourceListResult.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of private link resources. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryServicesDataReplicationPrivateLinkResourceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = RecoveryServicesDataReplicationPrivateLinkResourceListResult.DeserializeRecoveryServicesDataReplicationPrivateLinkResourceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ProtectedItemRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ProtectedItemRestOperations.cs new file mode 100644 index 000000000000..fd421d719985 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ProtectedItemRestOperations.cs @@ -0,0 +1,761 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class ProtectedItemRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ProtectedItemRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public ProtectedItemRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationProtectedItemData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationProtectedItemData.DeserializeDataReplicationProtectedItemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationProtectedItemData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationProtectedItemData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationProtectedItemData.DeserializeDataReplicationProtectedItemData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationProtectedItemData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Protected item model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Protected item model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Performs update on the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Protected item model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs update on the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Protected item model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, DataReplicationProtectedItemPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, bool? forceDelete) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (forceDelete != null) + { + uri.AppendQuery("forceDelete", forceDelete.Value, true); + } + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, bool? forceDelete) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendQuery("api-version", _apiVersion, true); + if (forceDelete != null) + { + uri.AppendQuery("forceDelete", forceDelete.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Removes the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// A flag indicating whether to do force delete or not. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, forceDelete); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Removes the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// A flag indicating whether to do force delete or not. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, bool? forceDelete = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, forceDelete); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (odataOptions != null) + { + uri.AppendQuery("odataOptions", odataOptions, true); + } + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + if (pageSize != null) + { + uri.AppendQuery("pageSize", pageSize.Value, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of protected items in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProtectedItemModelListResult.DeserializeProtectedItemModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of protected items in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProtectedItemModelListResult.DeserializeProtectedItemModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreatePlannedFailoverRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, PlannedFailover body) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/plannedFailover", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreatePlannedFailoverRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, PlannedFailover body) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/plannedFailover", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(body, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Performs the planned failover on the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Planned failover model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task PlannedFailoverAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, PlannedFailover body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePlannedFailoverRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, body); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs the planned failover on the protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// Planned failover model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response PlannedFailover(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, PlannedFailover body, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNull(body, nameof(body)); + + using var message = CreatePlannedFailoverRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, body); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions, string continuationToken, int? pageSize) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of protected items in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ProtectedItemModelListResult.DeserializeProtectedItemModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of protected items in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// OData options. + /// Continuation token. + /// Page size. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string odataOptions = null, string continuationToken = null, int? pageSize = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, odataOptions, continuationToken, pageSize); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ProtectedItemModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ProtectedItemModelListResult.DeserializeProtectedItemModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/RecoveryPointRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/RecoveryPointRestOperations.cs new file mode 100644 index 000000000000..f11dd146eb66 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/RecoveryPointRestOperations.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class RecoveryPointRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of RecoveryPointRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public RecoveryPointRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/recoveryPoints/", false); + uri.AppendPath(recoveryPointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/recoveryPoints/", false); + uri.AppendPath(recoveryPointName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the recovery point of a protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The recovery point name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, recoveryPointName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationRecoveryPointData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationRecoveryPointData.DeserializeDataReplicationRecoveryPointData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationRecoveryPointData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the recovery point of a protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The recovery point name. + /// The cancellation token to use. + /// , , , or is null. + /// , , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, string recoveryPointName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + Argument.AssertNotNullOrEmpty(recoveryPointName, nameof(recoveryPointName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName, recoveryPointName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationRecoveryPointData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationRecoveryPointData.DeserializeDataReplicationRecoveryPointData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationRecoveryPointData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/recoveryPoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/protectedItems/", false); + uri.AppendPath(protectedItemName, true); + uri.AppendPath("/recoveryPoints", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of recovery points of the given protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryPointModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = RecoveryPointModelListResult.DeserializeRecoveryPointModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of recovery points of the given protected item. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName, protectedItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryPointModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = RecoveryPointModelListResult.DeserializeRecoveryPointModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of recovery points of the given protected item. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, protectedItemName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + RecoveryPointModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = RecoveryPointModelListResult.DeserializeRecoveryPointModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of recovery points of the given protected item. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The protected item name. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, string protectedItemName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(protectedItemName, nameof(protectedItemName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName, protectedItemName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + RecoveryPointModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = RecoveryPointModelListResult.DeserializeRecoveryPointModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ReplicationExtensionRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ReplicationExtensionRestOperations.cs new file mode 100644 index 000000000000..24cec8e1fd6a --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/ReplicationExtensionRestOperations.cs @@ -0,0 +1,513 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class ReplicationExtensionRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of ReplicationExtensionRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public ReplicationExtensionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the replication extension. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationExtensionData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationExtensionData.DeserializeDataReplicationExtensionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationExtensionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the replication extension. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationExtensionData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationExtensionData.DeserializeDataReplicationExtensionData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationExtensionData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, DataReplicationExtensionData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, DataReplicationExtensionData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the replication extension in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// Replication extension model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, DataReplicationExtensionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the replication extension in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// Replication extension model. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, DataReplicationExtensionData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions/", false); + uri.AppendPath(replicationExtensionName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the replication extension in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the replication extension in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The replication extension name. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, string replicationExtensionName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNullOrEmpty(replicationExtensionName, nameof(replicationExtensionName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName, replicationExtensionName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendPath("/replicationExtensions", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of replication extensions in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicationExtensionModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReplicationExtensionModelListResult.DeserializeReplicationExtensionModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of replication extensions in the given vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicationExtensionModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReplicationExtensionModelListResult.DeserializeReplicationExtensionModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of replication extensions in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ReplicationExtensionModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ReplicationExtensionModelListResult.DeserializeReplicationExtensionModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of replication extensions in the given vault. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ReplicationExtensionModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ReplicationExtensionModelListResult.DeserializeReplicationExtensionModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/VaultRestOperations.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/VaultRestOperations.cs new file mode 100644 index 000000000000..d372fe55b069 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Generated/RestOperations/VaultRestOperations.cs @@ -0,0 +1,735 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.RecoveryServicesDataReplication.Models; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication +{ + internal partial class VaultRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of VaultRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// Service host. + /// The API version to use for this operation. + /// or is null. + public VaultRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the details of the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + DataReplicationVaultData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = DataReplicationVaultData.DeserializeDataReplicationVaultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationVaultData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the details of the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + DataReplicationVaultData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = DataReplicationVaultData.DeserializeDataReplicationVaultData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((DataReplicationVaultData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, DataReplicationVaultData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string vaultName, DataReplicationVaultData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Vault properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateAsync(string subscriptionId, string resourceGroupName, string vaultName, DataReplicationVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Vault properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Create(string subscriptionId, string resourceGroupName, string vaultName, DataReplicationVaultData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, vaultName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string vaultName, DataReplicationVaultPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string vaultName, DataReplicationVaultPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Performs update on the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Vault properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string vaultName, DataReplicationVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Performs update on the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// Vault properties. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string vaultName, DataReplicationVaultPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, vaultName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string vaultName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string vaultName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults/", false); + uri.AppendPath(vaultName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Removes the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Removes the vault. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The vault name. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string vaultName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(vaultName, nameof(vaultName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, vaultName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string continuationToken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string continuationToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + if (continuationToken != null) + { + uri.AppendQuery("continuationToken", continuationToken, true); + } + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of vaults in the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of vaults in the given subscription and resource group. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DataReplication/replicationVaults", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of vaults in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of vaults in the given subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of vaults in the given subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, continuationToken); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of vaults in the given subscription and resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// Continuation token from the previous call. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string continuationToken = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, continuationToken); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of vaults in the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of vaults in the given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + VaultModelListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = VaultModelListResult.DeserializeVaultModelListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Properties/AssemblyInfo.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..f3484b477c5e --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/src/Properties/AssemblyInfo.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Azure.ResourceManager.RecoveryServicesDataReplication.Tests, PublicKey = 0024000004800000940000000602000000240000525341310004000001000100d15ddcb29688295338af4b7686603fe614abd555e09efba8fb88ee09e1f7b1ccaeed2e8f823fa9eef3fdd60217fc012ea67d2479751a0b8c087a4185541b851bd8b16f8d91b840e51b1cb0ba6fe647997e57429265e85ef62d565db50a69ae1647d54d7bd855e4db3d8a91510e5bcbd0edfbbecaa20a7bd9ae74593daa7b11b4")] + +// Replace Microsoft.Test with the correct resource provider namepace for your service and uncomment. +// See https://docs.microsoft.com/en-us/azure/azure-resource-manager/management/azure-services-resource-providers +// for the list of possible values. +[assembly: Azure.Core.AzureResourceProviderNamespace("RecoveryServicesDataReplication")] diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/Azure.ResourceManager.RecoveryServicesDataReplication.Tests.csproj b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/Azure.ResourceManager.RecoveryServicesDataReplication.Tests.csproj new file mode 100644 index 000000000000..28b8be380881 --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/Azure.ResourceManager.RecoveryServicesDataReplication.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestBase.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestBase.cs new file mode 100644 index 000000000000..c22207cd3bbc --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestBase.cs @@ -0,0 +1,45 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; +using Azure.ResourceManager.TestFramework; +using NUnit.Framework; +using System.Threading.Tasks; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Tests +{ + public class RecoveryServicesDataReplicationManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected RecoveryServicesDataReplicationManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected RecoveryServicesDataReplicationManagementTestBase(bool isAsync) + : base(isAsync) + { + } + + [SetUp] + public async Task CreateCommonClient() + { + Client = GetArmClient(); + DefaultSubscription = await Client.GetDefaultSubscriptionAsync().ConfigureAwait(false); + } + + protected async Task CreateResourceGroup(SubscriptionResource subscription, string rgNamePrefix, AzureLocation location) + { + string rgName = Recording.GenerateAssetName(rgNamePrefix); + ResourceGroupData input = new ResourceGroupData(location); + var lro = await subscription.GetResourceGroups().CreateOrUpdateAsync(WaitUntil.Completed, rgName, input); + return lro.Value; + } + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestEnvironment.cs b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestEnvironment.cs new file mode 100644 index 000000000000..f82e1be89d2f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tests/RecoveryServicesDataReplicationManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.RecoveryServicesDataReplication.Tests +{ + public class RecoveryServicesDataReplicationManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tsp-location.yaml b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tsp-location.yaml new file mode 100644 index 000000000000..b34a0cbe778f --- /dev/null +++ b/sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/recoveryservicesdatareplication/DataReplication.Management +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/recoveryservicesdatareplication/ci.mgmt.yml b/sdk/recoveryservicesdatareplication/ci.mgmt.yml new file mode 100644 index 000000000000..cdff4215bc6b --- /dev/null +++ b/sdk/recoveryservicesdatareplication/ci.mgmt.yml @@ -0,0 +1,26 @@ +# NOTE: Please refer to https://aka.ms/azsdk/engsys/ci-yaml before editing this file. + +trigger: none + +pr: + branches: + include: + - main + - feature/* + - hotfix/* + - release/* + paths: + include: + - sdk/recoveryservicesdatareplication /ci.mgmt.yml + - sdk/recoveryservicesdatareplication /Azure.ResourceManager.RecoveryServicesDataReplication / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: recoveryservicesdatareplication + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.RecoveryServicesDataReplication + safeName: AzureResourceManagerRecoveryServicesDataReplication diff --git a/sdk/resourcemanager/ci.mgmt.yml b/sdk/resourcemanager/ci.mgmt.yml index 1c0fe85cd2f6..b52568d1642c 100644 --- a/sdk/resourcemanager/ci.mgmt.yml +++ b/sdk/resourcemanager/ci.mgmt.yml @@ -58,6 +58,7 @@ trigger: - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql - sdk/costmanagement/Azure.ResourceManager.CostManagement - sdk/customer-insights/Azure.ResourceManager.CustomerInsights + - sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager - sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher - sdk/databox/Azure.ResourceManager.DataBox - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge @@ -131,6 +132,7 @@ trigger: - sdk/marketplace/Azure.ResourceManager.Marketplace - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering - sdk/mediaservices/Azure.ResourceManager.Media + - sdk/migrate/Azure.ResourceManager.Migrate - sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap - sdk/mixedreality/Azure.ResourceManager.MixedReality @@ -150,6 +152,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 @@ -169,6 +172,7 @@ trigger: - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery + - sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication - sdk/redis/Azure.ResourceManager.Redis - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise - sdk/relay/Azure.ResourceManager.Relay @@ -213,6 +217,7 @@ trigger: - sdk/weightsandbiases/Azure.ResourceManager.WeightsAndBiases - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor - sdk/workloads/Azure.ResourceManager.Workloads + - sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances pr: branches: @@ -273,6 +278,7 @@ pr: - sdk/cosmosdbforpostgresql/Azure.ResourceManager.CosmosDBForPostgreSql - sdk/costmanagement/Azure.ResourceManager.CostManagement - sdk/customer-insights/Azure.ResourceManager.CustomerInsights + - sdk/databasefleetmanager/Azure.ResourceManager.DatabaseFleetManager - sdk/databasewatcher/Azure.ResourceManager.DatabaseWatcher - sdk/databox/Azure.ResourceManager.DataBox - sdk/databoxedge/Azure.ResourceManager.DataBoxEdge @@ -346,6 +352,7 @@ pr: - sdk/marketplace/Azure.ResourceManager.Marketplace - sdk/marketplaceordering/Azure.ResourceManager.MarketplaceOrdering - sdk/mediaservices/Azure.ResourceManager.Media + - sdk/migrate/Azure.ResourceManager.Migrate - sdk/migrationassessment/Azure.ResourceManager.Migration.Assessment - sdk/migrationdiscoverysap/Azure.ResourceManager.MigrationDiscoverySap - sdk/mixedreality/Azure.ResourceManager.MixedReality @@ -365,6 +372,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 @@ -384,6 +392,7 @@ pr: - sdk/recoveryservices-backup/Azure.ResourceManager.RecoveryServicesBackup - sdk/recoveryservices-datareplication/Azure.ResourceManager.RecoveryServicesDataReplication - sdk/recoveryservices-siterecovery/Azure.ResourceManager.RecoveryServicesSiteRecovery + - sdk/recoveryservicesdatareplication/Azure.ResourceManager.RecoveryServicesDataReplication - sdk/redis/Azure.ResourceManager.Redis - sdk/redisenterprise/Azure.ResourceManager.RedisEnterprise - sdk/relay/Azure.ResourceManager.Relay @@ -428,6 +437,7 @@ pr: - sdk/weightsandbiases/Azure.ResourceManager.WeightsAndBiases - sdk/workloadmonitor/Azure.ResourceManager.WorkloadMonitor - sdk/workloads/Azure.ResourceManager.Workloads + - sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances extends: template: /eng/pipelines/templates/stages/archetype-sdk-client.yml diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationCollection.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationCollection.cs index f93bc022e2e0..84b9e5db92e0 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationCollection.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationCollection.cs @@ -7,10 +7,8 @@ using System; using System.Threading.Tasks; -using System.Xml; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.ServiceFabricManagedClusters.Models; using NUnit.Framework; namespace Azure.ResourceManager.ServiceFabricManagedClusters.Samples @@ -21,8 +19,8 @@ public partial class Sample_ServiceFabricManagedApplicationCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutAnApplicationWithMaximumParameters() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationPutOperation_example_max.json - // this example is just showing the usage of "Applications_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationPutOperation_example_max.json + // this example is just showing the usage of "ApplicationResource_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(); @@ -42,41 +40,7 @@ public async Task CreateOrUpdate_PutAnApplicationWithMaximumParameters() // invoke the operation string applicationName = "myApp"; - ServiceFabricManagedApplicationData data = new ServiceFabricManagedApplicationData(new AzureLocation("eastus")) - { - Version = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0", - Parameters = -{ -["param1"] = "value1" -}, - UpgradePolicy = new ApplicationUpgradePolicy - { - ApplicationHealthPolicy = new ApplicationHealthPolicy(true, 0) - { - DefaultServiceTypeHealthPolicy = new ServiceTypeHealthPolicy(0, 0, 0), - ServiceTypeHealthPolicyMap = -{ -["service1"] = new ServiceTypeHealthPolicy(30, 30, 30) -}, - }, - ForceRestart = false, - RollingUpgradeMonitoringPolicy = new RollingUpgradeMonitoringPolicy( - PolicyViolationCompensationAction.Rollback, - XmlConvert.ToTimeSpan("00:02:00"), - XmlConvert.ToTimeSpan("00:05:00"), - XmlConvert.ToTimeSpan("00:10:00"), - XmlConvert.ToTimeSpan("01:00:00"), - XmlConvert.ToTimeSpan("00:15:00")), - InstanceCloseDelayDurationInSeconds = 600L, - UpgradeMode = RollingUpgradeMode.UnmonitoredAuto, - UpgradeReplicaSetCheckTimeout = 3600L, - RecreateApplication = false, - }, - Tags = -{ -["a"] = "b" -}, - }; + ServiceFabricManagedApplicationData data = new ServiceFabricManagedApplicationData(default); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, applicationName, data); ServiceFabricManagedApplicationResource result = lro.Value; @@ -91,8 +55,8 @@ public async Task CreateOrUpdate_PutAnApplicationWithMaximumParameters() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutAnApplicationWithMinimumParameters() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationPutOperation_example_min.json - // this example is just showing the usage of "Applications_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationPutOperation_example_min.json + // this example is just showing the usage of "ApplicationResource_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(); @@ -112,10 +76,7 @@ public async Task CreateOrUpdate_PutAnApplicationWithMinimumParameters() // invoke the operation string applicationName = "myApp"; - ServiceFabricManagedApplicationData data = new ServiceFabricManagedApplicationData(new AzureLocation("eastus")) - { - Version = "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applicationTypes/myAppType/versions/1.0", - }; + ServiceFabricManagedApplicationData data = new ServiceFabricManagedApplicationData(default); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, applicationName, data); ServiceFabricManagedApplicationResource result = lro.Value; @@ -130,8 +91,8 @@ public async Task CreateOrUpdate_PutAnApplicationWithMinimumParameters() [Ignore("Only validating compilation of examples")] public async Task Get_GetAnApplication() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationGetOperation_example.json - // this example is just showing the usage of "Applications_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationGetOperation_example.json + // this example is just showing the usage of "ApplicationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -164,8 +125,8 @@ public async Task Get_GetAnApplication() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetAListOfApplicationResources() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationListOperation_example.json - // this example is just showing the usage of "Applications_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationListOperation_example.json + // this example is just showing the usage of "ApplicationResource_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -200,8 +161,8 @@ public async Task GetAll_GetAListOfApplicationResources() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAnApplication() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationGetOperation_example.json - // this example is just showing the usage of "Applications_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationGetOperation_example.json + // this example is just showing the usage of "ApplicationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -230,8 +191,8 @@ public async Task Exists_GetAnApplication() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAnApplication() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationGetOperation_example.json - // this example is just showing the usage of "Applications_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationGetOperation_example.json + // this example is just showing the usage of "ApplicationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationResource.cs index 984161f5498b..1d336c0f4fa5 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationResource.cs @@ -20,8 +20,8 @@ public partial class Sample_ServiceFabricManagedApplicationResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAnApplication() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationGetOperation_example.json - // this example is just showing the usage of "Applications_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationGetOperation_example.json + // this example is just showing the usage of "ApplicationResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -51,8 +51,8 @@ public async Task Get_GetAnApplication() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAnApplication() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationDeleteOperation_example.json - // this example is just showing the usage of "Applications_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationDeleteOperation_example.json + // this example is just showing the usage of "ApplicationResource_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(); @@ -78,8 +78,8 @@ public async Task Delete_DeleteAnApplication() [Ignore("Only validating compilation of examples")] public async Task Update_PatchAnApplication() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationPatchOperation_example.json - // this example is just showing the usage of "Applications_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationPatchOperation_example.json + // this example is just showing the usage of "ApplicationResource_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(); @@ -96,13 +96,7 @@ public async Task Update_PatchAnApplication() ServiceFabricManagedApplicationResource serviceFabricManagedApplication = client.GetServiceFabricManagedApplicationResource(serviceFabricManagedApplicationResourceId); // invoke the operation - ServiceFabricManagedApplicationPatch patch = new ServiceFabricManagedApplicationPatch - { - Tags = -{ -["a"] = "b" -}, - }; + ServiceFabricManagedApplicationPatch patch = new ServiceFabricManagedApplicationPatch(); ServiceFabricManagedApplicationResource result = await serviceFabricManagedApplication.UpdateAsync(patch); // the variable result is a resource, you could call other operations on this instance as well @@ -116,7 +110,7 @@ public async Task Update_PatchAnApplication() [Ignore("Only validating compilation of examples")] public async Task ReadUpgrade_GetAnApplicationUpgrade() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationActionGetUpgrade_example.json + // Generated from example definition: 2025-03-01-preview/ApplicationActionGetUpgrade_example.json // this example is just showing the usage of "Applications_ReadUpgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -141,10 +135,10 @@ public async Task ReadUpgrade_GetAnApplicationUpgrade() [Test] [Ignore("Only validating compilation of examples")] - public async Task StartRollback_StartAnApplicationUpgradeRollback() + public async Task ResumeUpgrade_ResumeUpgrade() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationActionStartRollback_example.json - // this example is just showing the usage of "Applications_StartRollback" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationActionResumeUpgrade_example.json + // this example is just showing the usage of "Applications_ResumeUpgrade" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -161,17 +155,18 @@ public async Task StartRollback_StartAnApplicationUpgradeRollback() ServiceFabricManagedApplicationResource serviceFabricManagedApplication = client.GetServiceFabricManagedApplicationResource(serviceFabricManagedApplicationResourceId); // invoke the operation - await serviceFabricManagedApplication.StartRollbackAsync(WaitUntil.Completed); + RuntimeResumeApplicationUpgradeContent content = new RuntimeResumeApplicationUpgradeContent(); + await serviceFabricManagedApplication.ResumeUpgradeAsync(WaitUntil.Completed, content); Console.WriteLine("Succeeded"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task ResumeUpgrade_ResumeUpgrade() + public async Task StartRollback_StartAnApplicationUpgradeRollback() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationActionResumeUpgrade_example.json - // this example is just showing the usage of "Applications_ResumeUpgrade" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationActionStartRollback_example.json + // this example is just showing the usage of "Applications_StartRollback" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -188,11 +183,7 @@ public async Task ResumeUpgrade_ResumeUpgrade() ServiceFabricManagedApplicationResource serviceFabricManagedApplication = client.GetServiceFabricManagedApplicationResource(serviceFabricManagedApplicationResourceId); // invoke the operation - RuntimeResumeApplicationUpgradeContent content = new RuntimeResumeApplicationUpgradeContent - { - UpgradeDomainName = "UD1", - }; - await serviceFabricManagedApplication.ResumeUpgradeAsync(WaitUntil.Completed, content); + await serviceFabricManagedApplication.StartRollbackAsync(WaitUntil.Completed); Console.WriteLine("Succeeded"); } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeCollection.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeCollection.cs index 44dcc5178039..f89ba3d5db81 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeCollection.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeCollection.cs @@ -19,8 +19,8 @@ public partial class Sample_ServiceFabricManagedApplicationTypeCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutAnApplicationType() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeNamePutOperation_example.json - // this example is just showing the usage of "ApplicationTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeNamePutOperation_example.json + // this example is just showing the usage of "ApplicationTypeResource_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(); @@ -40,7 +40,7 @@ public async Task CreateOrUpdate_PutAnApplicationType() // invoke the operation string applicationTypeName = "myAppType"; - ServiceFabricManagedApplicationTypeData data = new ServiceFabricManagedApplicationTypeData(new AzureLocation("eastus")); + ServiceFabricManagedApplicationTypeData data = new ServiceFabricManagedApplicationTypeData(default); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, applicationTypeName, data); ServiceFabricManagedApplicationTypeResource result = lro.Value; @@ -55,8 +55,8 @@ public async Task CreateOrUpdate_PutAnApplicationType() [Ignore("Only validating compilation of examples")] public async Task Get_GetAnApplicationType() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeNameGetOperation_example.json - // this example is just showing the usage of "ApplicationTypes_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeNameGetOperation_example.json + // this example is just showing the usage of "ApplicationTypeResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK 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,8 +89,8 @@ public async Task Get_GetAnApplicationType() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetAListOfApplicationTypeNameResources() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeNameListOperation_example.json - // this example is just showing the usage of "ApplicationTypes_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeNameListOperation_example.json + // this example is just showing the usage of "ApplicationTypeResource_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -125,8 +125,8 @@ public async Task GetAll_GetAListOfApplicationTypeNameResources() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAnApplicationType() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeNameGetOperation_example.json - // this example is just showing the usage of "ApplicationTypes_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeNameGetOperation_example.json + // this example is just showing the usage of "ApplicationTypeResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -155,8 +155,8 @@ public async Task Exists_GetAnApplicationType() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAnApplicationType() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeNameGetOperation_example.json - // this example is just showing the usage of "ApplicationTypes_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeNameGetOperation_example.json + // this example is just showing the usage of "ApplicationTypeResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeResource.cs index cc07507171b4..572b52eff874 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeResource.cs @@ -20,8 +20,8 @@ public partial class Sample_ServiceFabricManagedApplicationTypeResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAnApplicationType() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeNameGetOperation_example.json - // this example is just showing the usage of "ApplicationTypes_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeNameGetOperation_example.json + // this example is just showing the usage of "ApplicationTypeResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -51,8 +51,8 @@ public async Task Get_GetAnApplicationType() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAnApplicationType() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeNameDeleteOperation_example.json - // this example is just showing the usage of "ApplicationTypes_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeNameDeleteOperation_example.json + // this example is just showing the usage of "ApplicationTypeResource_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(); @@ -78,8 +78,8 @@ public async Task Delete_DeleteAnApplicationType() [Ignore("Only validating compilation of examples")] public async Task Update_PatchAnApplicationType() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeNamePatchOperation_example.json - // this example is just showing the usage of "ApplicationTypes_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeNamePatchOperation_example.json + // this example is just showing the usage of "ApplicationTypeResource_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(); @@ -96,13 +96,7 @@ public async Task Update_PatchAnApplicationType() ServiceFabricManagedApplicationTypeResource serviceFabricManagedApplicationType = client.GetServiceFabricManagedApplicationTypeResource(serviceFabricManagedApplicationTypeResourceId); // invoke the operation - ServiceFabricManagedApplicationTypePatch patch = new ServiceFabricManagedApplicationTypePatch - { - Tags = -{ -["a"] = "b" -}, - }; + ServiceFabricManagedApplicationTypePatch patch = new ServiceFabricManagedApplicationTypePatch(); ServiceFabricManagedApplicationTypeResource result = await serviceFabricManagedApplicationType.UpdateAsync(patch); // the variable result is a resource, you could call other operations on this instance as well diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeVersionCollection.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeVersionCollection.cs index 2c05e6979767..a13e71f11c4d 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeVersionCollection.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeVersionCollection.cs @@ -19,8 +19,8 @@ public partial class Sample_ServiceFabricManagedApplicationTypeVersionCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutAnApplicationTypeVersion() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeVersionPutOperation_example.json - // this example is just showing the usage of "ApplicationTypeVersions_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeVersionPutOperation_example.json + // this example is just showing the usage of "ApplicationTypeVersionResource_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(); @@ -41,10 +41,7 @@ public async Task CreateOrUpdate_PutAnApplicationTypeVersion() // invoke the operation string version = "1.0"; - ServiceFabricManagedApplicationTypeVersionData data = new ServiceFabricManagedApplicationTypeVersionData(new AzureLocation("eastus")) - { - AppPackageUri = new Uri("http://fakelink.test.com/MyAppType"), - }; + ServiceFabricManagedApplicationTypeVersionData data = new ServiceFabricManagedApplicationTypeVersionData(default); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, version, data); ServiceFabricManagedApplicationTypeVersionResource result = lro.Value; @@ -59,8 +56,8 @@ public async Task CreateOrUpdate_PutAnApplicationTypeVersion() [Ignore("Only validating compilation of examples")] public async Task Get_GetAnApplicationTypeVersion() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeVersionGetOperation_example.json - // this example is just showing the usage of "ApplicationTypeVersions_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeVersionGetOperation_example.json + // this example is just showing the usage of "ApplicationTypeVersionResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -94,8 +91,8 @@ public async Task Get_GetAnApplicationTypeVersion() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetAListOfApplicationTypeVersionResources() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeVersionListOperation_example.json - // this example is just showing the usage of "ApplicationTypeVersions_ListByApplicationTypes" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeVersionListOperation_example.json + // this example is just showing the usage of "ApplicationTypeVersionResource_ListByApplicationTypes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -131,8 +128,8 @@ public async Task GetAll_GetAListOfApplicationTypeVersionResources() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAnApplicationTypeVersion() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeVersionGetOperation_example.json - // this example is just showing the usage of "ApplicationTypeVersions_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeVersionGetOperation_example.json + // this example is just showing the usage of "ApplicationTypeVersionResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -162,8 +159,8 @@ public async Task Exists_GetAnApplicationTypeVersion() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAnApplicationTypeVersion() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeVersionGetOperation_example.json - // this example is just showing the usage of "ApplicationTypeVersions_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeVersionGetOperation_example.json + // this example is just showing the usage of "ApplicationTypeVersionResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeVersionResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeVersionResource.cs index 3e6d04f5d223..754e61f68d13 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeVersionResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedApplicationTypeVersionResource.cs @@ -20,8 +20,8 @@ public partial class Sample_ServiceFabricManagedApplicationTypeVersionResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAnApplicationTypeVersion() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeVersionGetOperation_example.json - // this example is just showing the usage of "ApplicationTypeVersions_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeVersionGetOperation_example.json + // this example is just showing the usage of "ApplicationTypeVersionResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -52,8 +52,8 @@ public async Task Get_GetAnApplicationTypeVersion() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAnApplicationTypeVersion() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeVersionDeleteOperation_example.json - // this example is just showing the usage of "ApplicationTypeVersions_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeVersionDeleteOperation_example.json + // this example is just showing the usage of "ApplicationTypeVersionResource_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(); @@ -80,8 +80,8 @@ public async Task Delete_DeleteAnApplicationTypeVersion() [Ignore("Only validating compilation of examples")] public async Task Update_PatchAnApplicationTypeVersion() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ApplicationTypeVersionPatchOperation_example.json - // this example is just showing the usage of "ApplicationTypeVersions_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ApplicationTypeVersionPatchOperation_example.json + // this example is just showing the usage of "ApplicationTypeVersionResource_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(); @@ -99,13 +99,7 @@ public async Task Update_PatchAnApplicationTypeVersion() ServiceFabricManagedApplicationTypeVersionResource serviceFabricManagedApplicationTypeVersion = client.GetServiceFabricManagedApplicationTypeVersionResource(serviceFabricManagedApplicationTypeVersionResourceId); // invoke the operation - ServiceFabricManagedApplicationTypeVersionPatch patch = new ServiceFabricManagedApplicationTypeVersionPatch - { - Tags = -{ -["a"] = "b" -}, - }; + ServiceFabricManagedApplicationTypeVersionPatch patch = new ServiceFabricManagedApplicationTypeVersionPatch(); ServiceFabricManagedApplicationTypeVersionResource result = await serviceFabricManagedApplicationTypeVersion.UpdateAsync(patch); // the variable result is a resource, you could call other operations on this instance as well diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedClusterCollection.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedClusterCollection.cs index 0836901ac378..2e9969295105 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedClusterCollection.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedClusterCollection.cs @@ -7,7 +7,6 @@ using System; using System.Threading.Tasks; -using System.Xml; using Azure.Core; using Azure.Identity; using Azure.ResourceManager.Resources; @@ -22,8 +21,8 @@ public partial class Sample_ServiceFabricManagedClusterCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutAClusterWithMaximumParameters() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterPutOperation_example_max.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterPutOperation_example_max.json + // this example is just showing the usage of "ManagedCluster_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(); @@ -42,84 +41,7 @@ public async Task CreateOrUpdate_PutAClusterWithMaximumParameters() // invoke the operation string clusterName = "mycluster"; - ServiceFabricManagedClusterData data = new ServiceFabricManagedClusterData(new AzureLocation("eastus"), new ServiceFabricManagedClustersSku(ServiceFabricManagedClustersSkuName.Basic)) - { - DnsName = "mycluster", - ClientConnectionPort = 19000, - HttpGatewayConnectionPort = 19080, - AdminUserName = "vmadmin", - AdminPassword = "{vm-password}", - LoadBalancingRules = {new ManagedClusterLoadBalancingRule(80, 80, new ManagedClusterLoadBalancingRuleTransportProtocol("http"), ManagedClusterLoadBalanceProbeProtocol.Http) -{ -ProbePort = 80, -}, new ManagedClusterLoadBalancingRule(443, 443, new ManagedClusterLoadBalancingRuleTransportProtocol("http"), ManagedClusterLoadBalanceProbeProtocol.Http) -{ -ProbePort = 443, -}, new ManagedClusterLoadBalancingRule(10000, 10000, ManagedClusterLoadBalancingRuleTransportProtocol.Tcp, ManagedClusterLoadBalanceProbeProtocol.Http) -{ -ProbePort = 10000, -LoadDistribution = "Default", -}}, - IsRdpAccessAllowed = true, - NetworkSecurityRules = {new ServiceFabricManagedNetworkSecurityRule("TestName", ServiceFabricManagedNsgProtocol.Tcp, ServiceFabricManagedNetworkTrafficAccess.Allow, 1010, ServiceFabricManagedNetworkSecurityRuleDirection.Inbound) -{ -Description = "Test description", -SourceAddressPrefixes = {"*"}, -DestinationAddressPrefixes = {"*"}, -SourcePortRanges = {"*"}, -DestinationPortRanges = {"*"}, -}, new ServiceFabricManagedNetworkSecurityRule("AllowARM", new ServiceFabricManagedNsgProtocol("*"), ServiceFabricManagedNetworkTrafficAccess.Allow, 2002, ServiceFabricManagedNetworkSecurityRuleDirection.Inbound) -{ -SourceAddressPrefix = "AzureResourceManager", -DestinationAddressPrefix = "*", -SourcePortRange = "*", -DestinationPortRange = "33500-33699", -}}, - FabricSettings = {new ClusterFabricSettingsSection("ManagedIdentityTokenService", new ClusterFabricSettingsParameterDescription[] -{ -new ClusterFabricSettingsParameterDescription("IsEnabled", "true") -})}, - ClusterCodeVersion = "7.1.168.9494", - ClusterUpgradeMode = ManagedClusterUpgradeMode.Manual, - AddOnFeatures = { ManagedClusterAddOnFeature.DnsService, ManagedClusterAddOnFeature.BackupRestoreService, ManagedClusterAddOnFeature.ResourceMonitorService }, - IsAutoOSUpgradeEnabled = true, - HasZoneResiliency = true, - MaxUnusedVersionsToKeep = 3, - IsIPv6Enabled = true, - IPTags = { new ManagedClusterIPTag("FirstPartyUsage", "SQL") }, - AuxiliarySubnets = {new ManagedClusterSubnet("testSubnet1") -{ -IsIPv6Enabled = true, -PrivateEndpointNetworkPolicies = ManagedClusterSubnetPrivateEndpointNetworkPoliciesState.Enabled, -PrivateLinkServiceNetworkPolicies = ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState.Enabled, -NetworkSecurityGroupId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/networkSecurityGroups/sn1"), -}}, - ServiceEndpoints = {new ManagedClusterServiceEndpoint("Microsoft.Storage") -{ -Locations = {new AzureLocation("eastus2"), new AzureLocation("usnorth")}, -}}, - ZonalUpdateMode = ZonalUpdateMode.Fast, - UseCustomVnet = true, - PublicIPPrefixId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPPrefix"), - PublicIPv6PrefixId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.Network/publicIPPrefixes/myPublicIPv6Prefix"), - DdosProtectionPlanId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/ddosProtectionPlans/myDDoSProtectionPlan"), - UpgradeDescription = new ManagedClusterUpgradePolicy - { - ForceRestart = false, - HealthPolicy = new ManagedClusterHealthPolicy(10, 30), - DeltaHealthPolicy = new ManagedClusterUpgradeDeltaHealthPolicy(20) - { - MaxPercentUpgradeDomainDeltaUnhealthyNodes = 40, - MaxPercentDeltaUnhealthyApplications = 40, - }, - MonitoringPolicy = new ManagedClusterMonitoringPolicy(XmlConvert.ToTimeSpan("00:05:00"), XmlConvert.ToTimeSpan("00:45:00"), "00:55:00", "12:00:00", "03:00:00"), - }, - HttpGatewayTokenAuthConnectionPort = 19081, - IsHttpGatewayExclusiveAuthModeEnabled = true, - AutoGeneratedDomainNameLabelScope = AutoGeneratedDomainNameLabelScope.SubscriptionReuse, - AllocatedOutboundPorts = 0, - Tags = { }, - }; + ServiceFabricManagedClusterData data = new ServiceFabricManagedClusterData(default, null); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, clusterName, data); ServiceFabricManagedClusterResource result = lro.Value; @@ -134,8 +56,8 @@ public async Task CreateOrUpdate_PutAClusterWithMaximumParameters() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutAClusterWithMinimumParameters() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterPutOperation_example_min.json - // this example is just showing the usage of "ManagedClusters_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterPutOperation_example_min.json + // this example is just showing the usage of "ManagedCluster_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(); @@ -154,18 +76,7 @@ public async Task CreateOrUpdate_PutAClusterWithMinimumParameters() // invoke the operation string clusterName = "myCluster"; - ServiceFabricManagedClusterData data = new ServiceFabricManagedClusterData(new AzureLocation("eastus"), new ServiceFabricManagedClustersSku(ServiceFabricManagedClustersSkuName.Basic)) - { - DnsName = "myCluster", - AdminUserName = "vmadmin", - AdminPassword = "{vm-password}", - FabricSettings = {new ClusterFabricSettingsSection("ManagedIdentityTokenService", new ClusterFabricSettingsParameterDescription[] -{ -new ClusterFabricSettingsParameterDescription("IsEnabled", "true") -})}, - ClusterUpgradeMode = ManagedClusterUpgradeMode.Automatic, - ClusterUpgradeCadence = ManagedClusterUpgradeCadence.Wave1, - }; + ServiceFabricManagedClusterData data = new ServiceFabricManagedClusterData(default, null); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, clusterName, data); ServiceFabricManagedClusterResource result = lro.Value; @@ -180,8 +91,8 @@ public async Task CreateOrUpdate_PutAClusterWithMinimumParameters() [Ignore("Only validating compilation of examples")] public async Task Get_GetACluster() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterGetOperation_example.json - // this example is just showing the usage of "ManagedClusters_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterGetOperation_example.json + // this example is just showing the usage of "ManagedCluster_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -213,8 +124,8 @@ public async Task Get_GetACluster() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListClusterByResourceGroup() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterListByResourceGroupOperation_example.json - // this example is just showing the usage of "ManagedClusters_ListByResourceGroup" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterListByResourceGroupOperation_example.json + // this example is just showing the usage of "ManagedCluster_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(); @@ -248,8 +159,8 @@ public async Task GetAll_ListClusterByResourceGroup() [Ignore("Only validating compilation of examples")] public async Task Exists_GetACluster() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterGetOperation_example.json - // this example is just showing the usage of "ManagedClusters_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterGetOperation_example.json + // this example is just showing the usage of "ManagedCluster_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -277,8 +188,8 @@ public async Task Exists_GetACluster() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetACluster() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterGetOperation_example.json - // this example is just showing the usage of "ManagedClusters_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterGetOperation_example.json + // this example is just showing the usage of "ManagedCluster_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedClusterResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedClusterResource.cs index 0bd17f608f82..f11f0cd9fc89 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedClusterResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedClusterResource.cs @@ -20,8 +20,8 @@ public partial class Sample_ServiceFabricManagedClusterResource [Ignore("Only validating compilation of examples")] public async Task Get_GetACluster() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterGetOperation_example.json - // this example is just showing the usage of "ManagedClusters_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterGetOperation_example.json + // this example is just showing the usage of "ManagedCluster_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -50,8 +50,8 @@ public async Task Get_GetACluster() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteACluster() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterDeleteOperation_example.json - // this example is just showing the usage of "ManagedClusters_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterDeleteOperation_example.json + // this example is just showing the usage of "ManagedCluster_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(); @@ -76,8 +76,8 @@ public async Task Delete_DeleteACluster() [Ignore("Only validating compilation of examples")] public async Task Update_PatchAManagedCluster() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterPatchOperation_example.json - // this example is just showing the usage of "ManagedClusters_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterPatchOperation_example.json + // this example is just showing the usage of "ManagedCluster_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(); @@ -93,13 +93,7 @@ public async Task Update_PatchAManagedCluster() ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId); // invoke the operation - ServiceFabricManagedClusterPatch patch = new ServiceFabricManagedClusterPatch - { - Tags = -{ -["a"] = "b" -}, - }; + ServiceFabricManagedClusterPatch patch = new ServiceFabricManagedClusterPatch(); ServiceFabricManagedClusterResource result = await serviceFabricManagedCluster.UpdateAsync(patch); // the variable result is a resource, you could call other operations on this instance as well @@ -113,8 +107,8 @@ public async Task Update_PatchAManagedCluster() [Ignore("Only validating compilation of examples")] public async Task GetManagedAzResiliencyStatus_AzResiliencyStatusOfBaseResources() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/managedAzResiliencyStatusGet_example.json - // this example is just showing the usage of "managedAzResiliencyStatus_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/managedAzResiliencyStatusGet_example.json + // this example is just showing the usage of "ManagedAzResiliencyStatus_GetManagedAzResiliencyStatus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -137,10 +131,10 @@ public async Task GetManagedAzResiliencyStatus_AzResiliencyStatusOfBaseResources [Test] [Ignore("Only validating compilation of examples")] - public async Task GetManagedMaintenanceWindowStatu_MaintenanceWindowStatus() + public async Task PostManagedApplyMaintenanceWindow_ApplyMaintenanceWindowStatus() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedMaintenanceWindowStatusGet_example.json - // this example is just showing the usage of "managedMaintenanceWindowStatus_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedApplyMaintenanceWindowPost_example.json + // this example is just showing the usage of "ManagedApplyMaintenanceWindow_Post" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -156,17 +150,17 @@ public async Task GetManagedMaintenanceWindowStatu_MaintenanceWindowStatus() ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId); // invoke the operation - ManagedMaintenanceWindowStatus result = await serviceFabricManagedCluster.GetManagedMaintenanceWindowStatuAsync(); + await serviceFabricManagedCluster.PostManagedApplyMaintenanceWindowAsync(); - Console.WriteLine($"Succeeded: {result}"); + Console.WriteLine("Succeeded"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task PostManagedApplyMaintenanceWindow_MaintenanceWindowStatus() + public async Task GetManagedMaintenanceWindowStatu_GetMaintenanceWindowStatus() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedApplyMaintenanceWindowPost_example.json - // this example is just showing the usage of "managedApplyMaintenanceWindow_Post" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedMaintenanceWindowStatusGet_example.json + // this example is just showing the usage of "ManagedMaintenanceWindowStatus_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -182,9 +176,9 @@ public async Task PostManagedApplyMaintenanceWindow_MaintenanceWindowStatus() ServiceFabricManagedClusterResource serviceFabricManagedCluster = client.GetServiceFabricManagedClusterResource(serviceFabricManagedClusterResourceId); // invoke the operation - await serviceFabricManagedCluster.PostManagedApplyMaintenanceWindowAsync(); + ManagedMaintenanceWindowStatus result = await serviceFabricManagedCluster.GetManagedMaintenanceWindowStatuAsync(); - Console.WriteLine("Succeeded"); + Console.WriteLine($"Succeeded: {result}"); } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedNodeTypeCollection.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedNodeTypeCollection.cs index c26b9a8525cc..ccf71141da5b 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedNodeTypeCollection.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedNodeTypeCollection.cs @@ -9,8 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.Resources.Models; -using Azure.ResourceManager.ServiceFabricManagedClusters.Models; using NUnit.Framework; namespace Azure.ResourceManager.ServiceFabricManagedClusters.Samples @@ -21,8 +19,8 @@ public partial class Sample_ServiceFabricManagedNodeTypeCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutANodeTypeWithAutoScaleParameters() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationAutoScale_example.json - // this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypePutOperationAutoScale_example.json + // this example is just showing the usage of "NodeType_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(); @@ -42,43 +40,7 @@ public async Task CreateOrUpdate_PutANodeTypeWithAutoScaleParameters() // invoke the operation string nodeTypeName = "BE"; - ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData - { - IsPrimary = false, - VmInstanceCount = -1, - DataDiskSizeInGB = 200, - DataDiskType = ServiceFabricManagedDataDiskType.PremiumLrs, - PlacementProperties = -{ -["HasSSD"] = "true", -["NodeColor"] = "green", -["SomeProperty"] = "5" -}, - Capacities = -{ -["ClientConnections"] = "65536" -}, - VmSize = "Standard_DS3", - VmImagePublisher = "MicrosoftWindowsServer", - VmImageOffer = "WindowsServer", - VmImageSku = "2016-Datacenter-Server-Core", - VmImageVersion = "latest", - VmSecrets = {new NodeTypeVaultSecretGroup(new WritableSubResource -{ -Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"), -}, new NodeTypeVaultCertificate[] -{ -new NodeTypeVaultCertificate(new Uri("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), "My") -})}, - VmExtensions = {new NodeTypeVmssExtension("Microsoft.Azure.Geneva.GenevaMonitoring", "Microsoft.Azure.Geneva", "GenevaMonitoring", "2.0") -{ -AutoUpgradeMinorVersion = true, -Settings = BinaryData.FromObjectAsJson(new object()), -}}, - UserAssignedIdentities = { new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2") }, - IsStateless = true, - HasMultiplePlacementGroups = true, - }; + ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData(); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data); ServiceFabricManagedNodeTypeResource result = lro.Value; @@ -91,10 +53,10 @@ public async Task CreateOrUpdate_PutANodeTypeWithAutoScaleParameters() [Test] [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_PutANodeTypeWithMaximumParameters() + public async Task CreateOrUpdate_PutNodeTypeWithCustomVmImage() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperation_example_max.json - // this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypePutOperationCustomImage_example.json + // this example is just showing the usage of "NodeType_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(); @@ -113,110 +75,8 @@ public async Task CreateOrUpdate_PutANodeTypeWithMaximumParameters() ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes(); // invoke the operation - string nodeTypeName = "BE-testResourceGroup-testRegion-test"; - ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData - { - IsPrimary = false, - VmInstanceCount = 10, - DataDiskSizeInGB = 200, - DataDiskType = ServiceFabricManagedDataDiskType.PremiumLrs, - DataDiskLetter = "S", - PlacementProperties = -{ -["HasSSD"] = "true", -["NodeColor"] = "green", -["SomeProperty"] = "5" -}, - Capacities = -{ -["ClientConnections"] = "65536" -}, - VmSize = "Standard_DS3", - VmImagePublisher = "MicrosoftWindowsServer", - VmImageOffer = "WindowsServer", - VmImageSku = "2016-Datacenter-Server-Core", - VmImageVersion = "latest", - VmSecrets = {new NodeTypeVaultSecretGroup(new WritableSubResource -{ -Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.KeyVault/vaults/myVault"), -}, new NodeTypeVaultCertificate[] -{ -new NodeTypeVaultCertificate(new Uri("https://myVault.vault.azure.net:443/secrets/myCert/ef1a31d39e1f46bca33def54b6cda54c"), "My") -})}, - VmExtensions = {new NodeTypeVmssExtension("Microsoft.Azure.Geneva.GenevaMonitoring", "Microsoft.Azure.Geneva", "GenevaMonitoring", "2.0") -{ -AutoUpgradeMinorVersion = true, -Settings = BinaryData.FromObjectAsJson(new object()), -ForceUpdateTag = "v.1.0", -IsAutomaticUpgradeEnabled = true, -SetupOrder = {VmssExtensionSetupOrder.BeforeSFRuntime}, -}}, - UserAssignedIdentities = { new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity"), new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myIdentity2") }, - IsStateless = true, - HasMultiplePlacementGroups = true, - FrontendConfigurations = {new NodeTypeFrontendConfiguration -{ -LoadBalancerBackendAddressPoolId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"), -LoadBalancerInboundNatPoolId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"), -ApplicationGatewayBackendAddressPoolId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"), -}}, - AdditionalDataDisks = { new NodeTypeVmssDataDisk(1, 256, ServiceFabricManagedDataDiskType.StandardSsdLrs, "F"), new NodeTypeVmssDataDisk(2, 150, ServiceFabricManagedDataDiskType.PremiumLrs, "G") }, - IsEncryptionAtHostEnabled = true, - IsAcceleratedNetworkingEnabled = true, - UseDefaultPublicLoadBalancer = true, - IsOverProvisioningEnabled = false, - IsSpotVm = true, - UseEphemeralOSDisk = true, - SpotRestoreTimeout = "PT30M", - EvictionPolicy = SpotNodeVmEvictionPolicyType.Deallocate, - SubnetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), - VmSetupActions = { VmSetupAction.EnableContainers, VmSetupAction.EnableHyperV }, - SecurityType = ServiceFabricManagedClusterSecurityType.TrustedLaunch, - IsSecureBootEnabled = true, - IsNodePublicIPEnabled = true, - IsNodePublicIPv6Enabled = true, - NatGatewayId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/natGateways/myNatGateway"), - ServiceArtifactReferenceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/serviceArtifacts/myServiceArtifact/vmArtifactsProfiles/myVmArtifactProfile"), - DscpConfigurationId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"), - AdditionalNetworkInterfaceConfigurations = {new AdditionalNetworkInterfaceConfiguration("nic-1", new ServiceFabricManagedClusterIPConfiguration[] -{ -new ServiceFabricManagedClusterIPConfiguration("ipconfig-1") -{ -ApplicationGatewayBackendAddressPools = {new WritableSubResource -{ -Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/applicationGateways/appgw-test/backendAddressPools/appgwBepoolTest"), -}}, -LoadBalancerBackendAddressPools = {new WritableSubResource -{ -Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/backendAddressPools/LoadBalancerBEAddressPool"), -}}, -LoadBalancerInboundNatPools = {new WritableSubResource -{ -Id = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/loadBalancers/test-LB/inboundNatPools/LoadBalancerNATPool"), -}}, -SubnetId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"), -PrivateIPAddressVersion = ServiceFabricManagedClusterPrivateIPAddressVersion.IPv4, -PublicIPAddressConfiguration = new ServiceFabricManagedClusterPublicIPAddressConfiguration("publicip-1") -{ -IPTags = {new ManagedClusterIPTag("RoutingPreference", "Internet")}, -PublicIPAddressVersion = ServiceFabricManagedClusterPublicIPAddressVersion.IPv4, -}, -} -}) -{ -EnableAcceleratedNetworking = true, -DscpConfigurationId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Network/dscpConfigurations/myDscpConfig"), -}}, - ComputerNamePrefix = "BE", - VmApplications = {new ServiceFabricManagedVmApplication(new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resRg/providers/Microsoft.Compute/galleries/myGallery/applications/myApplication/versions/1.0.0")) -{ -ConfigurationReference = new Uri("https://mystorageaccount.blob.core.windows.net/containername/blobname"), -EnableAutomaticUpgrade = true, -Order = 1, -VmGalleryTags = "{\"Tag1\":\"Value1\",\"Tag2\":\"Value2\"}", -TreatFailureAsDeploymentFailure = false, -}}, - }; + string nodeTypeName = "BE"; + ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData(); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data); ServiceFabricManagedNodeTypeResource result = lro.Value; @@ -229,10 +89,10 @@ public async Task CreateOrUpdate_PutANodeTypeWithMaximumParameters() [Test] [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_PutANodeTypeWithMinimumParameters() + public async Task CreateOrUpdate_PutNodeTypeWithSharedGalleriesCustomVmImage() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperation_example_min.json - // this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypePutOperationCustomSharedGalleriesImage_example.json + // this example is just showing the usage of "NodeType_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(); @@ -252,17 +112,7 @@ public async Task CreateOrUpdate_PutANodeTypeWithMinimumParameters() // invoke the operation string nodeTypeName = "BE"; - ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData - { - IsPrimary = false, - VmInstanceCount = 10, - DataDiskSizeInGB = 200, - VmSize = "Standard_D3", - VmImagePublisher = "MicrosoftWindowsServer", - VmImageOffer = "WindowsServer", - VmImageSku = "2016-Datacenter-Server-Core", - VmImageVersion = "latest", - }; + ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData(); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data); ServiceFabricManagedNodeTypeResource result = lro.Value; @@ -275,10 +125,10 @@ public async Task CreateOrUpdate_PutANodeTypeWithMinimumParameters() [Test] [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_PutAnStatelessNodeTypeWithTemporaryDiskForServiceFabric() + public async Task CreateOrUpdate_PutNodeTypeWithDedicatedHosts() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationStateless_example.json - // this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypePutOperationDedicatedHost_example.json + // this example is just showing the usage of "NodeType_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(); @@ -298,25 +148,7 @@ public async Task CreateOrUpdate_PutAnStatelessNodeTypeWithTemporaryDiskForServi // invoke the operation string nodeTypeName = "BE"; - ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData - { - IsPrimary = false, - VmInstanceCount = 10, - VmSize = "Standard_DS3", - VmImagePublisher = "MicrosoftWindowsServer", - VmImageOffer = "WindowsServer", - VmImageSku = "2016-Datacenter-Server-Core", - VmImageVersion = "latest", - VmExtensions = {new NodeTypeVmssExtension("Microsoft.Azure.Geneva.GenevaMonitoring", "Microsoft.Azure.Geneva", "GenevaMonitoring", "2.0") -{ -AutoUpgradeMinorVersion = true, -Settings = BinaryData.FromObjectAsJson(new object()), -}}, - IsStateless = true, - HasMultiplePlacementGroups = true, - IsEncryptionAtHostEnabled = true, - UseTempDataDisk = true, - }; + ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData(); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data); ServiceFabricManagedNodeTypeResource result = lro.Value; @@ -329,10 +161,10 @@ public async Task CreateOrUpdate_PutAnStatelessNodeTypeWithTemporaryDiskForServi [Test] [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_PutNodeTypeWithCustomVmImage() + public async Task CreateOrUpdate_PutAnStatelessNodeTypeWithTemporaryDiskForServiceFabric() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationCustomImage_example.json - // this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypePutOperationStateless_example.json + // this example is just showing the usage of "NodeType_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(); @@ -352,14 +184,7 @@ public async Task CreateOrUpdate_PutNodeTypeWithCustomVmImage() // invoke the operation string nodeTypeName = "BE"; - ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData - { - IsPrimary = false, - VmInstanceCount = 10, - DataDiskSizeInGB = 200, - VmSize = "Standard_D3", - VmImageResourceId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/galleries/myCustomImages/images/Win2019DC"), - }; + ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData(); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data); ServiceFabricManagedNodeTypeResource result = lro.Value; @@ -372,10 +197,10 @@ public async Task CreateOrUpdate_PutNodeTypeWithCustomVmImage() [Test] [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_PutNodeTypeWithDedicatedHosts() + public async Task CreateOrUpdate_PutNodeTypeWithVmImagePlan() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationDedicatedHost_example.json - // this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypePutOperationVmImagePlan_example.json + // this example is just showing the usage of "NodeType_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(); @@ -395,22 +220,7 @@ public async Task CreateOrUpdate_PutNodeTypeWithDedicatedHosts() // invoke the operation string nodeTypeName = "BE"; - ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData - { - IsPrimary = false, - VmInstanceCount = 10, - DataDiskSizeInGB = 200, - DataDiskType = ServiceFabricManagedDataDiskType.StandardSsdLrs, - PlacementProperties = { }, - Capacities = { }, - VmSize = "Standard_D8s_v3", - VmImagePublisher = "MicrosoftWindowsServer", - VmImageOffer = "WindowsServer", - VmImageSku = "2019-Datacenter", - VmImageVersion = "latest", - Zones = { "1" }, - HostGroupId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/testhostgroupRG/providers/Microsoft.Compute/hostGroups/testHostGroup", - }; + ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData(); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data); ServiceFabricManagedNodeTypeResource result = lro.Value; @@ -423,10 +233,10 @@ public async Task CreateOrUpdate_PutNodeTypeWithDedicatedHosts() [Test] [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_PutNodeTypeWithSharedGalleriesCustomVmImage() + public async Task CreateOrUpdate_PutANodeTypeWithMaximumParameters() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationCustomSharedGalleriesImage_example.json - // this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypePutOperation_example_max.json + // this example is just showing the usage of "NodeType_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(); @@ -445,15 +255,8 @@ public async Task CreateOrUpdate_PutNodeTypeWithSharedGalleriesCustomVmImage() ServiceFabricManagedNodeTypeCollection collection = serviceFabricManagedCluster.GetServiceFabricManagedNodeTypes(); // invoke the operation - string nodeTypeName = "BE"; - ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData - { - IsPrimary = false, - VmInstanceCount = 10, - DataDiskSizeInGB = 200, - VmSize = "Standard_D3", - VmSharedGalleryImageId = new ResourceIdentifier("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/test-custom-image/providers/Microsoft.Compute/sharedGalleries/35349201-a0b3-405e-8a23-9f1450984307-SFSHAREDGALLERY/images/TestNoProdContainerDImage/versions/latest"), - }; + string nodeTypeName = "BE-testResourceGroup-testRegion-test"; + ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData(); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data); ServiceFabricManagedNodeTypeResource result = lro.Value; @@ -466,10 +269,10 @@ public async Task CreateOrUpdate_PutNodeTypeWithSharedGalleriesCustomVmImage() [Test] [Ignore("Only validating compilation of examples")] - public async Task CreateOrUpdate_PutNodeTypeWithVmImagePlan() + public async Task CreateOrUpdate_PutANodeTypeWithMinimumParameters() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePutOperationVmImagePlan_example.json - // this example is just showing the usage of "NodeTypes_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypePutOperation_example_min.json + // this example is just showing the usage of "NodeType_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(); @@ -489,23 +292,7 @@ public async Task CreateOrUpdate_PutNodeTypeWithVmImagePlan() // invoke the operation string nodeTypeName = "BE"; - ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData - { - IsPrimary = false, - VmInstanceCount = 10, - DataDiskSizeInGB = 200, - VmSize = "Standard_D3", - VmImagePublisher = "testpublisher", - VmImageOffer = "windows_2022_test", - VmImageSku = "win_2022_test_20_10_gen2", - VmImageVersion = "latest", - VmImagePlan = new VmImagePlan - { - Name = "win_2022_test_20_10_gen2", - Product = "windows_2022_test", - Publisher = "testpublisher", - }, - }; + ServiceFabricManagedNodeTypeData data = new ServiceFabricManagedNodeTypeData(); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, nodeTypeName, data); ServiceFabricManagedNodeTypeResource result = lro.Value; @@ -520,8 +307,8 @@ public async Task CreateOrUpdate_PutNodeTypeWithVmImagePlan() [Ignore("Only validating compilation of examples")] public async Task Get_GetANodeType() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypeGetOperation_example.json - // this example is just showing the usage of "NodeTypes_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypeGetOperation_example.json + // this example is just showing the usage of "NodeType_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -554,8 +341,8 @@ public async Task Get_GetANodeType() [Ignore("Only validating compilation of examples")] public async Task GetAll_ListNodeTypeOfTheSpecifiedManagedCluster() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypeListOperation_example.json - // this example is just showing the usage of "NodeTypes_ListByManagedClusters" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypeListOperation_example.json + // this example is just showing the usage of "NodeType_ListByManagedClusters" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -590,8 +377,8 @@ public async Task GetAll_ListNodeTypeOfTheSpecifiedManagedCluster() [Ignore("Only validating compilation of examples")] public async Task Exists_GetANodeType() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypeGetOperation_example.json - // this example is just showing the usage of "NodeTypes_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypeGetOperation_example.json + // this example is just showing the usage of "NodeType_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -620,8 +407,8 @@ public async Task Exists_GetANodeType() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetANodeType() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypeGetOperation_example.json - // this example is just showing the usage of "NodeTypes_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypeGetOperation_example.json + // this example is just showing the usage of "NodeType_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedNodeTypeResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedNodeTypeResource.cs index d2d06d2fa684..a43aea0d4ab0 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedNodeTypeResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedNodeTypeResource.cs @@ -20,8 +20,8 @@ public partial class Sample_ServiceFabricManagedNodeTypeResource [Ignore("Only validating compilation of examples")] public async Task Get_GetANodeType() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypeGetOperation_example.json - // this example is just showing the usage of "NodeTypes_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypeGetOperation_example.json + // this example is just showing the usage of "NodeType_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -51,8 +51,8 @@ public async Task Get_GetANodeType() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteANodeType() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypeDeleteOperation_example.json - // this example is just showing the usage of "NodeTypes_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypeDeleteOperation_example.json + // this example is just showing the usage of "NodeType_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(); @@ -76,10 +76,10 @@ public async Task Delete_DeleteANodeType() [Test] [Ignore("Only validating compilation of examples")] - public async Task Update_PatchANodeType() + public async Task Update_PatchANodeTypeWhileAutoScaling() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePatchOperation_example.json - // this example is just showing the usage of "NodeTypes_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypePatchOperationAutoScale_example.json + // this example is just showing the usage of "NodeType_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(); @@ -96,13 +96,7 @@ public async Task Update_PatchANodeType() ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId); // invoke the operation - ServiceFabricManagedNodeTypePatch patch = new ServiceFabricManagedNodeTypePatch - { - Tags = -{ -["a"] = "b" -}, - }; + ServiceFabricManagedNodeTypePatch patch = new ServiceFabricManagedNodeTypePatch(); ArmOperation lro = await serviceFabricManagedNodeType.UpdateAsync(WaitUntil.Completed, patch); ServiceFabricManagedNodeTypeResource result = lro.Value; @@ -115,10 +109,10 @@ public async Task Update_PatchANodeType() [Test] [Ignore("Only validating compilation of examples")] - public async Task Update_PatchANodeTypeWhileAutoScaling() + public async Task Update_PatchANodeType() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypePatchOperationAutoScale_example.json - // this example is just showing the usage of "NodeTypes_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypePatchOperation_example.json + // this example is just showing the usage of "NodeType_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(); @@ -135,18 +129,7 @@ public async Task Update_PatchANodeTypeWhileAutoScaling() ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId); // invoke the operation - ServiceFabricManagedNodeTypePatch patch = new ServiceFabricManagedNodeTypePatch - { - Tags = -{ -["a"] = "b" -}, - Sku = new NodeTypeSku(10) - { - Name = "Standard_S0", - Tier = "Standard", - }, - }; + ServiceFabricManagedNodeTypePatch patch = new ServiceFabricManagedNodeTypePatch(); ArmOperation lro = await serviceFabricManagedNodeType.UpdateAsync(WaitUntil.Completed, patch); ServiceFabricManagedNodeTypeResource result = lro.Value; @@ -159,10 +142,10 @@ public async Task Update_PatchANodeTypeWhileAutoScaling() [Test] [Ignore("Only validating compilation of examples")] - public async Task Restart_RestartNodes() + public async Task Deallocate_DeallocateNodes() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/RestartNodes_example.json - // this example is just showing the usage of "NodeTypes_Restart" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/DeallocateNodes_example.json + // this example is just showing the usage of "NodeTypes_Deallocate" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -179,11 +162,92 @@ public async Task Restart_RestartNodes() ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId); // invoke the operation - NodeTypeActionContent content = new NodeTypeActionContent - { - Nodes = { "BE_0", "BE_3" }, - }; - await serviceFabricManagedNodeType.RestartAsync(WaitUntil.Completed, content); + NodeTypeActionContent content = new NodeTypeActionContent(); + await serviceFabricManagedNodeType.DeallocateAsync(WaitUntil.Completed, content); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task DeleteNode_DeleteNodes() + { + // Generated from example definition: 2025-03-01-preview/DeleteNodes_example.json + // this example is just showing the usage of "NodeTypes_DeleteNode" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceFabricManagedNodeTypeResource created on azure + // for more information of creating ServiceFabricManagedNodeTypeResource, please refer to the document of ServiceFabricManagedNodeTypeResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "resRg"; + string clusterName = "myCluster"; + string nodeTypeName = "BE"; + ResourceIdentifier serviceFabricManagedNodeTypeResourceId = ServiceFabricManagedNodeTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, nodeTypeName); + ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId); + + // invoke the operation + NodeTypeActionContent content = new NodeTypeActionContent(); + await serviceFabricManagedNodeType.DeleteNodeAsync(WaitUntil.Completed, content); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Redeploy_RedeployAllNodesByUpgradeDomain() + { + // Generated from example definition: 2025-03-01-preview/RedeployNodes_UD_example.json + // this example is just showing the usage of "NodeTypes_Redeploy" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceFabricManagedNodeTypeResource created on azure + // for more information of creating ServiceFabricManagedNodeTypeResource, please refer to the document of ServiceFabricManagedNodeTypeResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "resRg"; + string clusterName = "myCluster"; + string nodeTypeName = "BE"; + ResourceIdentifier serviceFabricManagedNodeTypeResourceId = ServiceFabricManagedNodeTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, nodeTypeName); + ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId); + + // invoke the operation + NodeTypeActionContent content = new NodeTypeActionContent(); + await serviceFabricManagedNodeType.RedeployAsync(WaitUntil.Completed, content); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Redeploy_RedeployNodes() + { + // Generated from example definition: 2025-03-01-preview/RedeployNodes_example.json + // this example is just showing the usage of "NodeTypes_Redeploy" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceFabricManagedNodeTypeResource created on azure + // for more information of creating ServiceFabricManagedNodeTypeResource, please refer to the document of ServiceFabricManagedNodeTypeResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "resRg"; + string clusterName = "myCluster"; + string nodeTypeName = "BE"; + ResourceIdentifier serviceFabricManagedNodeTypeResourceId = ServiceFabricManagedNodeTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, nodeTypeName); + ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId); + + // invoke the operation + NodeTypeActionContent content = new NodeTypeActionContent(); + await serviceFabricManagedNodeType.RedeployAsync(WaitUntil.Completed, content); Console.WriteLine("Succeeded"); } @@ -192,7 +256,7 @@ public async Task Restart_RestartNodes() [Ignore("Only validating compilation of examples")] public async Task Reimage_ReimageAllNodesByUpgradeDomain() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ReimageNodes_UD_example.json + // Generated from example definition: 2025-03-01-preview/ReimageNodes_UD_example.json // this example is just showing the usage of "NodeTypes_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -210,10 +274,7 @@ public async Task Reimage_ReimageAllNodesByUpgradeDomain() ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId); // invoke the operation - NodeTypeActionContent content = new NodeTypeActionContent - { - UpdateType = ServiceFabricManagedClusterUpdateType.ByUpgradeDomain, - }; + NodeTypeActionContent content = new NodeTypeActionContent(); await serviceFabricManagedNodeType.ReimageAsync(WaitUntil.Completed, content); Console.WriteLine("Succeeded"); @@ -223,7 +284,7 @@ public async Task Reimage_ReimageAllNodesByUpgradeDomain() [Ignore("Only validating compilation of examples")] public async Task Reimage_ReimageNodes() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ReimageNodes_example.json + // Generated from example definition: 2025-03-01-preview/ReimageNodes_example.json // this example is just showing the usage of "NodeTypes_Reimage" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line @@ -241,10 +302,7 @@ public async Task Reimage_ReimageNodes() ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId); // invoke the operation - NodeTypeActionContent content = new NodeTypeActionContent - { - Nodes = { "BE_0", "BE_3" }, - }; + NodeTypeActionContent content = new NodeTypeActionContent(); await serviceFabricManagedNodeType.ReimageAsync(WaitUntil.Completed, content); Console.WriteLine("Succeeded"); @@ -252,10 +310,10 @@ public async Task Reimage_ReimageNodes() [Test] [Ignore("Only validating compilation of examples")] - public async Task DeleteNode_DeleteNodes() + public async Task Restart_RestartNodes() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/DeleteNodes_example.json - // this example is just showing the usage of "NodeTypes_DeleteNode" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/RestartNodes_example.json + // this example is just showing the usage of "NodeTypes_Restart" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -272,11 +330,36 @@ public async Task DeleteNode_DeleteNodes() ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId); // invoke the operation - NodeTypeActionContent content = new NodeTypeActionContent - { - Nodes = { "BE_0", "BE_3" }, - }; - await serviceFabricManagedNodeType.DeleteNodeAsync(WaitUntil.Completed, content); + NodeTypeActionContent content = new NodeTypeActionContent(); + await serviceFabricManagedNodeType.RestartAsync(WaitUntil.Completed, content); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Start_StartNodes() + { + // Generated from example definition: 2025-03-01-preview/StartNodes_example.json + // this example is just showing the usage of "NodeTypes_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this ServiceFabricManagedNodeTypeResource created on azure + // for more information of creating ServiceFabricManagedNodeTypeResource, please refer to the document of ServiceFabricManagedNodeTypeResource + string subscriptionId = "00000000-0000-0000-0000-000000000000"; + string resourceGroupName = "resRg"; + string clusterName = "myCluster"; + string nodeTypeName = "BE"; + ResourceIdentifier serviceFabricManagedNodeTypeResourceId = ServiceFabricManagedNodeTypeResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, clusterName, nodeTypeName); + ServiceFabricManagedNodeTypeResource serviceFabricManagedNodeType = client.GetServiceFabricManagedNodeTypeResource(serviceFabricManagedNodeTypeResourceId); + + // invoke the operation + NodeTypeActionContent content = new NodeTypeActionContent(); + await serviceFabricManagedNodeType.StartAsync(WaitUntil.Completed, content); Console.WriteLine("Succeeded"); } @@ -285,8 +368,8 @@ public async Task DeleteNode_DeleteNodes() [Ignore("Only validating compilation of examples")] public async Task GetAvailableSkus_ListANodeTypeSKUs() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/NodeTypeSkusListOperation_example.json - // this example is just showing the usage of "NodeTypeSkus_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/NodeTypeSkusListOperation_example.json + // this example is just showing the usage of "NodeTypeSkus_GetAvailableSkus" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedServiceCollection.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedServiceCollection.cs index 040de985dfa1..e5ba908b63cd 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedServiceCollection.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedServiceCollection.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; using Azure.Core; using Azure.Identity; -using Azure.ResourceManager.ServiceFabricManagedClusters.Models; using NUnit.Framework; namespace Azure.ResourceManager.ServiceFabricManagedClusters.Samples @@ -20,8 +19,8 @@ public partial class Sample_ServiceFabricManagedServiceCollection [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutAServiceWithMaximumParameters() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServicePutOperation_example_max.json - // this example is just showing the usage of "Services_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ServicePutOperation_example_max.json + // this example is just showing the usage of "ServiceResource_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(); @@ -42,30 +41,7 @@ public async Task CreateOrUpdate_PutAServiceWithMaximumParameters() // invoke the operation string serviceName = "myService"; - ServiceFabricManagedServiceData data = new ServiceFabricManagedServiceData(new AzureLocation("eastus")) - { - Properties = new StatelessServiceProperties("myServiceType", new SingletonPartitionScheme(), 5) - { - MinInstanceCount = 3, - MinInstancePercentage = 30, - ServicePackageActivationMode = ManagedServicePackageActivationMode.SharedProcess, - ServiceDnsName = "myservicednsname.myApp", - PlacementConstraints = "NodeType==frontend", - CorrelationScheme = { new ManagedServiceCorrelation(ManagedServiceCorrelationScheme.AlignedAffinity, "/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/resRg/providers/Microsoft.ServiceFabric/managedclusters/myCluster/applications/myApp/services/myService1") }, - ServiceLoadMetrics = {new ManagedServiceLoadMetric("metric1") -{ -Weight = ManagedServiceLoadMetricWeight.Low, -DefaultLoad = 3, -}}, - ServicePlacementPolicies = { new ServicePlacementNonPartiallyPlaceServicePolicy() }, - DefaultMoveCost = ServiceFabricManagedServiceMoveCost.Medium, - ScalingPolicies = { new ManagedServiceScalingPolicy(new PartitionInstanceCountScalingMechanism(3, 9, 2), new AveragePartitionLoadScalingTrigger("metricName", 2, 8, "00:01:00")) }, - }, - Tags = -{ -["a"] = "b" -}, - }; + ServiceFabricManagedServiceData data = new ServiceFabricManagedServiceData(default); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data); ServiceFabricManagedServiceResource result = lro.Value; @@ -80,8 +56,8 @@ public async Task CreateOrUpdate_PutAServiceWithMaximumParameters() [Ignore("Only validating compilation of examples")] public async Task CreateOrUpdate_PutAServiceWithMinimumParameters() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServicePutOperation_example_min.json - // this example is just showing the usage of "Services_CreateOrUpdate" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ServicePutOperation_example_min.json + // this example is just showing the usage of "ServiceResource_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(); @@ -102,10 +78,7 @@ public async Task CreateOrUpdate_PutAServiceWithMinimumParameters() // invoke the operation string serviceName = "myService"; - ServiceFabricManagedServiceData data = new ServiceFabricManagedServiceData(new AzureLocation("eastus")) - { - Properties = new StatelessServiceProperties("myServiceType", new SingletonPartitionScheme(), 1), - }; + ServiceFabricManagedServiceData data = new ServiceFabricManagedServiceData(default); ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, serviceName, data); ServiceFabricManagedServiceResource result = lro.Value; @@ -120,8 +93,8 @@ public async Task CreateOrUpdate_PutAServiceWithMinimumParameters() [Ignore("Only validating compilation of examples")] public async Task Get_GetAService() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServiceGetOperation_example.json - // this example is just showing the usage of "Services_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ServiceGetOperation_example.json + // this example is just showing the usage of "ServiceResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -155,8 +128,8 @@ public async Task Get_GetAService() [Ignore("Only validating compilation of examples")] public async Task GetAll_GetAListOfServiceResources() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServiceListOperation_example.json - // this example is just showing the usage of "Services_ListByApplications" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ServiceListOperation_example.json + // this example is just showing the usage of "ServiceResource_ListByApplications" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -192,8 +165,8 @@ public async Task GetAll_GetAListOfServiceResources() [Ignore("Only validating compilation of examples")] public async Task Exists_GetAService() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServiceGetOperation_example.json - // this example is just showing the usage of "Services_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ServiceGetOperation_example.json + // this example is just showing the usage of "ServiceResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -223,8 +196,8 @@ public async Task Exists_GetAService() [Ignore("Only validating compilation of examples")] public async Task GetIfExists_GetAService() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServiceGetOperation_example.json - // this example is just showing the usage of "Services_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ServiceGetOperation_example.json + // this example is just showing the usage of "ServiceResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedServiceResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedServiceResource.cs index 9a829cfa3055..5759f07d68e2 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedServiceResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_ServiceFabricManagedServiceResource.cs @@ -20,8 +20,8 @@ public partial class Sample_ServiceFabricManagedServiceResource [Ignore("Only validating compilation of examples")] public async Task Get_GetAService() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServiceGetOperation_example.json - // this example is just showing the usage of "Services_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ServiceGetOperation_example.json + // this example is just showing the usage of "ServiceResource_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -52,8 +52,8 @@ public async Task Get_GetAService() [Ignore("Only validating compilation of examples")] public async Task Delete_DeleteAService() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServiceDeleteOperation_example.json - // this example is just showing the usage of "Services_Delete" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ServiceDeleteOperation_example.json + // this example is just showing the usage of "ServiceResource_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(); @@ -80,8 +80,8 @@ public async Task Delete_DeleteAService() [Ignore("Only validating compilation of examples")] public async Task Update_PatchAService() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ServicePatchOperation_example.json - // this example is just showing the usage of "Services_Update" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ServicePatchOperation_example.json + // this example is just showing the usage of "ServiceResource_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(); @@ -99,13 +99,7 @@ public async Task Update_PatchAService() ServiceFabricManagedServiceResource serviceFabricManagedService = client.GetServiceFabricManagedServiceResource(serviceFabricManagedServiceResourceId); // invoke the operation - ServiceFabricManagedServicePatch patch = new ServiceFabricManagedServicePatch - { - Tags = -{ -["a"] = "b" -}, - }; + ServiceFabricManagedServicePatch patch = new ServiceFabricManagedServicePatch(); ServiceFabricManagedServiceResource result = await serviceFabricManagedService.UpdateAsync(patch); // the variable result is a resource, you could call other operations on this instance as well diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs index 180082f38b89..41307a2d1792 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -19,10 +19,10 @@ public partial class Sample_SubscriptionResourceExtensions { [Test] [Ignore("Only validating compilation of examples")] - public async Task GetServiceFabricManagedClusters_ListManagedClusters() + public async Task GetManagedClusterVersion_GetClusterVersion() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterListBySubscriptionOperation_example.json - // this example is just showing the usage of "ManagedClusters_ListBySubscription" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterVersionGet_example.json + // this example is just showing the usage of "ManagedClusterVersion_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -35,25 +35,20 @@ public async Task GetServiceFabricManagedClusters_ListManagedClusters() ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - // invoke the operation and iterate over the result - await foreach (ServiceFabricManagedClusterResource item in subscriptionResource.GetServiceFabricManagedClustersAsync()) - { - // 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 - ServiceFabricManagedClusterData resourceData = item.Data; - // for demo we just print out the id - Console.WriteLine($"Succeeded on id: {resourceData.Id}"); - } + // invoke the operation + string location = "eastus"; + string clusterVersion = "7.2.477.9590"; + ServiceFabricManagedClusterVersion result = await subscriptionResource.GetManagedClusterVersionAsync(location, clusterVersion); - Console.WriteLine("Succeeded"); + Console.WriteLine($"Succeeded: {result}"); } [Test] [Ignore("Only validating compilation of examples")] - public async Task GetManagedClusterVersion_GetClusterVersion() + public async Task GetManagedClusterVersions_ListClusterVersions() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterVersionGet_example.json - // this example is just showing the usage of "ManagedClusterVersion_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterVersionList_example.json + // this example is just showing the usage of "ManagedClusterVersion_List" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -66,20 +61,22 @@ public async Task GetManagedClusterVersion_GetClusterVersion() ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); - // invoke the operation - AzureLocation location = new AzureLocation("eastus"); - string clusterVersion = "7.2.477.9590"; - ServiceFabricManagedClusterVersion result = await subscriptionResource.GetManagedClusterVersionAsync(location, clusterVersion); + // invoke the operation and iterate over the result + string location = "eastus"; + await foreach (ServiceFabricManagedClusterVersion item in subscriptionResource.GetManagedClusterVersionsAsync(location)) + { + Console.WriteLine($"Succeeded: {item}"); + } - Console.WriteLine($"Succeeded: {result}"); + Console.WriteLine("Succeeded"); } [Test] [Ignore("Only validating compilation of examples")] public async Task GetManagedClusterVersionByEnvironment_GetClusterVersionByEnvironment() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterVersionGetByEnvironment_example.json - // this example is just showing the usage of "ManagedClusterVersion_GetByEnvironment" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterVersionGetByEnvironment_example.json + // this example is just showing the usage of "ManagedClusterVersion_GetManagedClusterVersionByEnvironment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -93,7 +90,7 @@ public async Task GetManagedClusterVersionByEnvironment_GetClusterVersionByEnvir SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation - AzureLocation location = new AzureLocation("eastus"); + string location = "eastus"; ManagedClusterVersionEnvironment environment = ManagedClusterVersionEnvironment.Windows; string clusterVersion = "7.2.477.9590"; ServiceFabricManagedClusterVersion result = await subscriptionResource.GetManagedClusterVersionByEnvironmentAsync(location, environment, clusterVersion); @@ -103,10 +100,10 @@ public async Task GetManagedClusterVersionByEnvironment_GetClusterVersionByEnvir [Test] [Ignore("Only validating compilation of examples")] - public async Task GetManagedClusterVersions_ListClusterVersions() + public async Task GetManagedClusterVersionsByEnvironment_ListClusterVersionsByEnvironment() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterVersionList_example.json - // this example is just showing the usage of "ManagedClusterVersion_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterVersionListByEnvironment.json + // this example is just showing the usage of "ManagedClusterVersion_ListByEnvironment" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -120,8 +117,9 @@ public async Task GetManagedClusterVersions_ListClusterVersions() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - AzureLocation location = new AzureLocation("eastus"); - await foreach (ServiceFabricManagedClusterVersion item in subscriptionResource.GetManagedClusterVersionsAsync(location)) + string location = "eastus"; + ManagedClusterVersionEnvironment environment = ManagedClusterVersionEnvironment.Windows; + await foreach (ServiceFabricManagedClusterVersion item in subscriptionResource.GetManagedClusterVersionsByEnvironmentAsync(location, environment)) { Console.WriteLine($"Succeeded: {item}"); } @@ -131,10 +129,36 @@ public async Task GetManagedClusterVersions_ListClusterVersions() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetManagedClusterVersionsByEnvironment_ListClusterVersionsByEnvironment() + public async Task GetManagedUnsupportedVmSize_GetUnsupportedVmSizes() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/ManagedClusterVersionListByEnvironment.json - // this example is just showing the usage of "ManagedClusterVersion_ListByEnvironment" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/managedUnsupportedVMSizesGet_example.json + // this example is just showing the usage of "ManagedUnsupportedVMSizes_GetManagedUnsupportedVmSize" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 + string location = "eastus"; + string vmSize = "Standard_B1ls1"; + ServiceFabricManagedUnsupportedVmSize result = await subscriptionResource.GetManagedUnsupportedVmSizeAsync(location, vmSize); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetManagedUnsupportedVmSizes_ListUnsupportedVmSizes() + { + // Generated from example definition: 2025-03-01-preview/managedUnsupportedVMSizesList_example.json + // this example is just showing the usage of "ManagedUnsupportedVMSizes_GetManagedUnsupportedVmSizes" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -148,9 +172,8 @@ public async Task GetManagedClusterVersionsByEnvironment_ListClusterVersionsByEn SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - AzureLocation location = new AzureLocation("eastus"); - ManagedClusterVersionEnvironment environment = ManagedClusterVersionEnvironment.Windows; - await foreach (ServiceFabricManagedClusterVersion item in subscriptionResource.GetManagedClusterVersionsByEnvironmentAsync(location, environment)) + string location = "eastus"; + await foreach (ServiceFabricManagedUnsupportedVmSize item in subscriptionResource.GetManagedUnsupportedVmSizesAsync(location)) { Console.WriteLine($"Succeeded: {item}"); } @@ -160,10 +183,10 @@ public async Task GetManagedClusterVersionsByEnvironment_ListClusterVersionsByEn [Test] [Ignore("Only validating compilation of examples")] - public async Task GetManagedUnsupportedVmSizes_ListUnsupportedVmSizes() + public async Task GetServiceFabricManagedClusters_ListManagedClusters() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/managedUnsupportedVMSizesList_example.json - // this example is just showing the usage of "managedUnsupportedVMSizes_List" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/ManagedClusterListBySubscriptionOperation_example.json + // this example is just showing the usage of "ManagedCluster_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(); @@ -177,10 +200,13 @@ public async Task GetManagedUnsupportedVmSizes_ListUnsupportedVmSizes() SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); // invoke the operation and iterate over the result - AzureLocation location = new AzureLocation("eastus"); - await foreach (ServiceFabricManagedUnsupportedVmSize item in subscriptionResource.GetManagedUnsupportedVmSizesAsync(location)) + await foreach (ServiceFabricManagedClusterResource item in subscriptionResource.GetServiceFabricManagedClustersAsync()) { - Console.WriteLine($"Succeeded: {item}"); + // 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 + ServiceFabricManagedClusterData resourceData = item.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); } Console.WriteLine("Succeeded"); @@ -188,10 +214,10 @@ public async Task GetManagedUnsupportedVmSizes_ListUnsupportedVmSizes() [Test] [Ignore("Only validating compilation of examples")] - public async Task GetManagedUnsupportedVmSize_GetUnsupportedVmSizes() + public async Task GetOperationResult_GetLongRunningOperationResult() { - // Generated from example definition: specification/servicefabricmanagedclusters/resource-manager/Microsoft.ServiceFabric/preview/2024-09-01-preview/examples/managedUnsupportedVMSizesGet_example.json - // this example is just showing the usage of "managedUnsupportedVMSizes_Get" operation, for the dependent resources, they will have to be created separately. + // Generated from example definition: 2025-03-01-preview/OperationResultsGet_example.json + // this example is just showing the usage of "OperationResults_Get" operation, for the dependent resources, they will have to be created separately. // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line TokenCredential cred = new DefaultAzureCredential(); @@ -206,8 +232,60 @@ public async Task GetManagedUnsupportedVmSize_GetUnsupportedVmSizes() // invoke the operation AzureLocation location = new AzureLocation("eastus"); - string vmSize = "Standard_B1ls1"; - ServiceFabricManagedUnsupportedVmSize result = await subscriptionResource.GetManagedUnsupportedVmSizeAsync(location, vmSize); + string operationId = "00000000-0000-0000-0000-000000001234"; + await subscriptionResource.GetOperationResultAsync(WaitUntil.Completed, location, operationId); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetOperationStatu_ErrorResponseDescribingWhyTheOperationFailed() + { + // Generated from example definition: 2025-03-01-preview/OperationStatusFailed_example.json + // this example is just showing the usage of "OperationStatus_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 + AzureLocation location = new AzureLocation("eastus"); + string operationId = "00000000-0000-0000-0000-000000001234"; + LongRunningOperationResult result = await subscriptionResource.GetOperationStatuAsync(location, operationId); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetOperationStatu_OKTheRequestHasSucceeded() + { + // Generated from example definition: 2025-03-01-preview/OperationStatusSucceeded_example.json + // this example is just showing the usage of "OperationStatus_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 + AzureLocation location = new AzureLocation("eastus"); + string operationId = "00000000-0000-0000-0000-000000001234"; + LongRunningOperationResult result = await subscriptionResource.GetOperationStatuAsync(location, operationId); Console.WriteLine($"Succeeded: {result}"); } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_TenantResourceExtensions.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_TenantResourceExtensions.cs new file mode 100644 index 000000000000..09f73e427457 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/samples/Generated/Samples/Sample_TenantResourceExtensions.cs @@ -0,0 +1,43 @@ +// 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 Azure.ResourceManager.ServiceFabricManagedClusters.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Samples +{ + public partial class Sample_TenantResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetOperations_ListTheOperationsForTheProvider() + { + // Generated from example definition: 2025-03-01-preview/OperationsList_example.json + // this example is just showing the usage of "Operations_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + TenantResource tenantResource = client.GetTenants().GetAllAsync().GetAsyncEnumerator().Current; + + // invoke the operation and iterate over the result + await foreach (OperationResult item in tenantResource.GetOperationsAsync()) + { + Console.WriteLine($"Succeeded: {item}"); + } + + Console.WriteLine("Succeeded"); + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ArmServiceFabricManagedClustersModelFactory.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ArmServiceFabricManagedClustersModelFactory.cs index 7e369b07153d..19900c0c486e 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ArmServiceFabricManagedClustersModelFactory.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ArmServiceFabricManagedClustersModelFactory.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Linq; using System.Net; using Azure.Core; @@ -18,7 +17,36 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models /// Model factory for models. public static partial class ArmServiceFabricManagedClustersModelFactory { - /// Initializes a new instance of . + /// Initializes a new instance of . + /// The name of the operation. + /// Indicates whether the operation is a data action. + /// The object that represents the operation. + /// Origin result. + /// The URL to use for getting the next set of results. + /// A new instance for mocking. + public static OperationResult OperationResult(string name = null, bool? isDataAction = null, AvailableOperationDisplay display = null, string origin = null, string nextLink = null) + { + return new OperationResult( + name, + isDataAction, + display, + origin, + nextLink, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The name of the provider. + /// The resource on which the operation is performed. + /// The operation that can be performed. + /// Operation description. + /// A new instance for mocking. + public static AvailableOperationDisplay AvailableOperationDisplay(string provider = null, string resource = null, string operation = null, string description = null) + { + return new AvailableOperationDisplay(provider, resource, operation, description, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -26,12 +54,22 @@ public static partial class ArmServiceFabricManagedClustersModelFactory /// The tags. /// The location. /// The current deployment or provisioning state, which only appears in the response. - /// A new instance for mocking. - public static ServiceFabricManagedApplicationTypeData ServiceFabricManagedApplicationTypeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string provisioningState = null) + /// + /// The version of the application type as defined in the application manifest. + /// This name must be the full Arm Resource ID for the referenced application type version. + /// + /// List of application parameters with overridden values from their default values specified in the application manifest. + /// Describes the policy for a monitored application upgrade. + /// List of user assigned identities for the application, each mapped to a friendly name. + /// Describes the managed identities for an Azure resource. + /// A new instance for mocking. + public static ServiceFabricManagedApplicationData ServiceFabricManagedApplicationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string provisioningState = null, string version = null, IDictionary parameters = null, ApplicationUpgradePolicy upgradePolicy = null, IEnumerable managedIdentities = null, ManagedServiceIdentity identity = null) { tags ??= new Dictionary(); + parameters ??= new Dictionary(); + managedIdentities ??= new List(); - return new ServiceFabricManagedApplicationTypeData( + return new ServiceFabricManagedApplicationData( id, name, resourceType, @@ -39,10 +77,15 @@ public static ServiceFabricManagedApplicationTypeData ServiceFabricManagedApplic tags, location, provisioningState, + version, + parameters, + upgradePolicy, + managedIdentities?.ToList(), + identity, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. @@ -50,13 +93,12 @@ public static ServiceFabricManagedApplicationTypeData ServiceFabricManagedApplic /// The tags. /// The location. /// The current deployment or provisioning state, which only appears in the response. - /// The URL to the application package. - /// A new instance for mocking. - public static ServiceFabricManagedApplicationTypeVersionData ServiceFabricManagedApplicationTypeVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string provisioningState = null, Uri appPackageUri = null) + /// A new instance for mocking. + public static ServiceFabricManagedApplicationTypeData ServiceFabricManagedApplicationTypeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string provisioningState = null) { tags ??= new Dictionary(); - return new ServiceFabricManagedApplicationTypeVersionData( + return new ServiceFabricManagedApplicationTypeData( id, name, resourceType, @@ -64,47 +106,32 @@ public static ServiceFabricManagedApplicationTypeVersionData ServiceFabricManage tags, location, provisioningState, - appPackageUri, serializedAdditionalRawData: null); } - /// Initializes a new instance of . + /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. /// The tags. /// The location. - /// Describes the managed identities for an Azure resource. /// The current deployment or provisioning state, which only appears in the response. - /// - /// The version of the application type as defined in the application manifest. - /// This name must be the full Arm Resource ID for the referenced application type version. - /// - /// - /// List of application parameters with overridden values from their default values specified in the application manifest. - /// Describes the policy for a monitored application upgrade. - /// List of user assigned identities for the application, each mapped to a friendly name. - /// A new instance for mocking. - public static ServiceFabricManagedApplicationData ServiceFabricManagedApplicationData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ManagedServiceIdentity identity = null, string provisioningState = null, string version = null, IDictionary parameters = null, ApplicationUpgradePolicy upgradePolicy = null, IEnumerable managedIdentities = null) + /// The URL to the application package. + /// A new instance for mocking. + public static ServiceFabricManagedApplicationTypeVersionData ServiceFabricManagedApplicationTypeVersionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string provisioningState = null, Uri appPackageUri = null) { tags ??= new Dictionary(); - parameters ??= new Dictionary(); - managedIdentities ??= new List(); - return new ServiceFabricManagedApplicationData( + return new ServiceFabricManagedApplicationTypeVersionData( id, name, resourceType, systemData, tags, location, - identity, provisioningState, - version, - parameters, - upgradePolicy, - managedIdentities?.ToList(), + appPackageUri, serializedAdditionalRawData: null); } @@ -160,7 +187,6 @@ public static ServiceFabricManagedServiceData ServiceFabricManagedServiceData(Re /// Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP). /// When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. /// When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable. - /// /// /// A new instance for mocking. public static ManagedServiceProperties ManagedServiceProperties(string placementConstraints = null, IEnumerable correlationScheme = null, IEnumerable serviceLoadMetrics = null, IEnumerable servicePlacementPolicies = null, ServiceFabricManagedServiceMoveCost? defaultMoveCost = null, IEnumerable scalingPolicies = null, string provisioningState = null, string serviceKind = null, string serviceTypeName = null, ManagedServicePartitionScheme partitionDescription = null, ManagedServicePackageActivationMode? servicePackageActivationMode = null, string serviceDnsName = null) @@ -170,7 +196,7 @@ public static ManagedServiceProperties ManagedServiceProperties(string placement servicePlacementPolicies ??= new List(); scalingPolicies ??= new List(); - return new ManagedServiceProperties( + return new UnknownManagedServiceProperties( placementConstraints, correlationScheme?.ToList(), serviceLoadMetrics?.ToList(), @@ -186,6 +212,162 @@ public static ManagedServiceProperties ManagedServiceProperties(string placement serviceDnsName); } + /// Initializes a new instance of . + /// The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + /// A list that describes the correlation of the service with other services. + /// The service load metrics is given as an array of ServiceLoadMetric objects. + /// + /// A list that describes the correlation of the service with other services. + /// 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 . + /// + /// Specifies the move cost for the service. + /// Scaling policies for this service. + /// The current deployment or provisioning state, which only appears in the response. + /// The name of the service type. + /// + /// Describes how the service is partitioned. + /// 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 activation Mode of the service package. + /// + /// Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP). + /// When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. + /// When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable. + /// + /// A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. + /// The target replica set size as a number. + /// The minimum replica set size as a number. + /// The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format "hh:mm:ss". + /// The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format "hh:mm:ss". + /// The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format "hh:mm:ss". + /// The duration for which replicas can stay InBuild before reporting that build is stuck, represented in ISO 8601 format "hh:mm:ss". + /// A new instance for mocking. + public static StatefulServiceProperties StatefulServiceProperties(string placementConstraints = null, IEnumerable correlationScheme = null, IEnumerable serviceLoadMetrics = null, IEnumerable servicePlacementPolicies = null, ServiceFabricManagedServiceMoveCost? defaultMoveCost = null, IEnumerable scalingPolicies = null, string provisioningState = null, string serviceTypeName = null, ManagedServicePartitionScheme partitionDescription = null, ManagedServicePackageActivationMode? servicePackageActivationMode = null, string serviceDnsName = null, bool? hasPersistedState = null, int? targetReplicaSetSize = null, int? minReplicaSetSize = null, string replicaRestartWaitDuration = null, string quorumLossWaitDuration = null, string standByReplicaKeepDuration = null, string servicePlacementTimeLimit = null) + { + correlationScheme ??= new List(); + serviceLoadMetrics ??= new List(); + servicePlacementPolicies ??= new List(); + scalingPolicies ??= new List(); + + return new StatefulServiceProperties( + placementConstraints, + correlationScheme?.ToList(), + serviceLoadMetrics?.ToList(), + servicePlacementPolicies?.ToList(), + defaultMoveCost, + scalingPolicies?.ToList(), + serializedAdditionalRawData: null, + provisioningState, + ServiceKind.Stateful, + serviceTypeName, + partitionDescription, + servicePackageActivationMode, + serviceDnsName, + hasPersistedState, + targetReplicaSetSize, + minReplicaSetSize, + replicaRestartWaitDuration, + quorumLossWaitDuration, + standByReplicaKeepDuration, + servicePlacementTimeLimit); + } + + /// Initializes a new instance of . + /// The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". + /// A list that describes the correlation of the service with other services. + /// The service load metrics is given as an array of ServiceLoadMetric objects. + /// + /// A list that describes the correlation of the service with other services. + /// 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 . + /// + /// Specifies the move cost for the service. + /// Scaling policies for this service. + /// The current deployment or provisioning state, which only appears in the response. + /// The name of the service type. + /// + /// Describes how the service is partitioned. + /// 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 activation Mode of the service package. + /// + /// Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP). + /// When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. + /// When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable. + /// + /// The instance count. + /// MinInstanceCount is the minimum number of instances that must be up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstanceCount computation -1 is first converted into the number of nodes on which the instances are allowed to be placed according to the placement constraints on the service. + /// MinInstancePercentage is the minimum percentage of InstanceCount that must be up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstancePercentage computation, -1 is first converted into the number of nodes on which the instances are allowed to be placed according to the placement constraints on the service. + /// A new instance for mocking. + public static StatelessServiceProperties StatelessServiceProperties(string placementConstraints = null, IEnumerable correlationScheme = null, IEnumerable serviceLoadMetrics = null, IEnumerable servicePlacementPolicies = null, ServiceFabricManagedServiceMoveCost? defaultMoveCost = null, IEnumerable scalingPolicies = null, string provisioningState = null, string serviceTypeName = null, ManagedServicePartitionScheme partitionDescription = null, ManagedServicePackageActivationMode? servicePackageActivationMode = null, string serviceDnsName = null, int instanceCount = default, int? minInstanceCount = null, int? minInstancePercentage = null) + { + correlationScheme ??= new List(); + serviceLoadMetrics ??= new List(); + servicePlacementPolicies ??= new List(); + scalingPolicies ??= new List(); + + return new StatelessServiceProperties( + placementConstraints, + correlationScheme?.ToList(), + serviceLoadMetrics?.ToList(), + servicePlacementPolicies?.ToList(), + defaultMoveCost, + scalingPolicies?.ToList(), + serializedAdditionalRawData: null, + provisioningState, + ServiceKind.Stateless, + serviceTypeName, + partitionDescription, + servicePackageActivationMode, + serviceDnsName, + instanceCount, + minInstanceCount, + minInstancePercentage); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The Service Fabric runtime version of the cluster. + /// The date of expiry of support of the version. + /// Cluster operating system, the default will be Windows. + /// A new instance for mocking. + public static ServiceFabricManagedClusterVersion ServiceFabricManagedClusterVersion(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string clusterCodeVersion = null, DateTimeOffset? versionSupportExpireOn = null, ServiceFabricManagedClusterOSType? osType = null) + { + return new ServiceFabricManagedClusterVersion( + id, + name, + resourceType, + systemData, + clusterCodeVersion, + versionSupportExpireOn, + osType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// VM Size properties. + /// A new instance for mocking. + public static ServiceFabricManagedUnsupportedVmSize ServiceFabricManagedUnsupportedVmSize(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string vmSize = null) + { + return new ServiceFabricManagedUnsupportedVmSize( + id, + name, + resourceType, + systemData, + vmSize != null ? new VmSize(vmSize, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// The id. /// The name. @@ -193,13 +375,12 @@ public static ManagedServiceProperties ManagedServiceProperties(string placement /// The systemData. /// The tags. /// The location. - /// The sku of the managed cluster. /// The cluster dns name. /// The fully qualified domain name associated with the public load balancer of the cluster. /// The IPv4 address associated with the public load balancer of the cluster. - /// A service generated unique identifier for the cluster resource. + /// A service generated unique identifier for the cluster resource. /// The current state of the cluster. - /// List of thumbprints of the cluster certificates. + /// List of thumbprints of the cluster certificates. /// The port used for client connections to the cluster. /// The port used for HTTP connections to the cluster. /// VM admin user name. @@ -212,10 +393,7 @@ public static ManagedServiceProperties ManagedServiceProperties(string placement /// The list of custom fabric settings to configure the cluster. /// The provisioning state of the managed cluster resource. /// The Service Fabric runtime version of the cluster. This property is required when **clusterUpgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. - /// - /// The upgrade mode of the cluster when new Service Fabric runtime version is available. - /// - /// + /// The upgrade mode of the cluster when new Service Fabric runtime version is available. /// Indicates when new cluster runtime version upgrades will be applied after they are released. By default is Wave0. Only applies when **clusterUpgradeMode** is set to 'Automatic'. /// List of add-on features to enable on the cluster. /// Enables automatic OS upgrade for node types created using OS images with version 'latest'. The default value for this setting is false. @@ -238,12 +416,14 @@ public static ManagedServiceProperties ManagedServiceProperties(string placement /// If true, token-based authentication is not allowed on the HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based authentication is used, HttpGatewayTokenAuthConnectionPort must be defined. /// This property is the entry point to using a public CA cert for your cluster cert. It specifies the level of reuse allowed for the custom FQDN created, matching the subject of the public CA cert. /// The number of outbound ports allocated for SNAT for each node in the backend pool of the default load balancer. The default value is 0 which provides dynamic port allocation based on pool size. - /// Azure resource etag. + /// The VM image the node types are configured with. This property controls the Service Fabric component packages to be used for the cluster. Allowed values are: 'Windows'. The default value is 'Windows'. + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.",. + /// The sku of the managed cluster. /// A new instance for mocking. - public static ServiceFabricManagedClusterData ServiceFabricManagedClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, ServiceFabricManagedClustersSkuName? skuName = null, string dnsName = null, string fqdn = null, IPAddress ipv4Address = null, Guid? clusterId = null, ServiceFabricManagedClusterState? clusterState = null, IEnumerable clusterCertificateThumbprints = null, int? clientConnectionPort = null, int? httpGatewayConnectionPort = null, string adminUserName = null, string adminPassword = null, IEnumerable loadBalancingRules = null, bool? isRdpAccessAllowed = null, IEnumerable networkSecurityRules = null, IEnumerable clients = null, ManagedClusterAzureActiveDirectory azureActiveDirectory = null, IEnumerable fabricSettings = null, ServiceFabricManagedResourceProvisioningState? provisioningState = null, string clusterCodeVersion = null, ManagedClusterUpgradeMode? clusterUpgradeMode = null, ManagedClusterUpgradeCadence? clusterUpgradeCadence = null, IEnumerable addOnFeatures = null, bool? isAutoOSUpgradeEnabled = null, bool? hasZoneResiliency = null, int? maxUnusedVersionsToKeep = null, bool? isIPv6Enabled = null, string subnetId = null, IEnumerable ipTags = null, IPAddress ipv6Address = null, bool? isServicePublicIPEnabled = null, IEnumerable auxiliarySubnets = null, IEnumerable serviceEndpoints = null, ZonalUpdateMode? zonalUpdateMode = null, bool? useCustomVnet = null, ResourceIdentifier publicIPPrefixId = null, ResourceIdentifier publicIPv6PrefixId = null, ResourceIdentifier ddosProtectionPlanId = null, ManagedClusterUpgradePolicy upgradeDescription = null, int? httpGatewayTokenAuthConnectionPort = null, bool? isHttpGatewayExclusiveAuthModeEnabled = null, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = null, int? allocatedOutboundPorts = null, ETag? etag = null) + public static ServiceFabricManagedClusterData ServiceFabricManagedClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, string dnsName = null, string fqdn = null, IPAddress ipv4Address = null, Guid? uuid = null, ServiceFabricManagedClusterState? clusterState = null, IEnumerable any = null, int? clientConnectionPort = null, int? httpGatewayConnectionPort = null, string adminUserName = null, string adminPassword = null, IEnumerable loadBalancingRules = null, bool? isRdpAccessAllowed = null, IEnumerable networkSecurityRules = null, IEnumerable clients = null, ManagedClusterAzureActiveDirectory azureActiveDirectory = null, IEnumerable fabricSettings = null, ServiceFabricManagedResourceProvisioningState? provisioningState = null, string clusterCodeVersion = null, ManagedClusterUpgradeMode? clusterUpgradeMode = null, ManagedClusterUpgradeCadence? clusterUpgradeCadence = null, IEnumerable addOnFeatures = null, bool? isAutoOSUpgradeEnabled = null, bool? hasZoneResiliency = null, int? maxUnusedVersionsToKeep = null, bool? isIPv6Enabled = null, string subnetId = null, IEnumerable ipTags = null, IPAddress ipv6Address = null, bool? isServicePublicIPEnabled = null, IEnumerable auxiliarySubnets = null, IEnumerable serviceEndpoints = null, ZonalUpdateMode? zonalUpdateMode = null, bool? useCustomVnet = null, ResourceIdentifier publicIPPrefixId = null, ResourceIdentifier publicIPv6PrefixId = null, ResourceIdentifier ddosProtectionPlanId = null, ManagedClusterUpgradePolicy upgradeDescription = null, int? httpGatewayTokenAuthConnectionPort = null, bool? isHttpGatewayExclusiveAuthModeEnabled = null, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = null, int? allocatedOutboundPorts = null, string vmImage = null, string etag = null, ServiceFabricManagedClustersSkuName? skuName = null) { tags ??= new Dictionary(); - clusterCertificateThumbprints ??= new List(); + any ??= new List(); loadBalancingRules ??= new List(); networkSecurityRules ??= new List(); clients ??= new List(); @@ -260,13 +440,12 @@ public static ServiceFabricManagedClusterData ServiceFabricManagedClusterData(Re systemData, tags, location, - skuName.HasValue ? new ServiceFabricManagedClustersSku(skuName.Value, serializedAdditionalRawData: null) : null, dnsName, fqdn, ipv4Address, - clusterId, + uuid, clusterState, - clusterCertificateThumbprints?.ToList(), + any?.ToList(), clientConnectionPort, httpGatewayConnectionPort, adminUserName, @@ -302,10 +481,58 @@ public static ServiceFabricManagedClusterData ServiceFabricManagedClusterData(Re isHttpGatewayExclusiveAuthModeEnabled, autoGeneratedDomainNameLabelScope, allocatedOutboundPorts, + vmImage, etag, + skuName.HasValue ? new ServiceFabricManagedClustersSku(skuName.Value, serializedAdditionalRawData: null) : null, serializedAdditionalRawData: null); } + /// Initializes a new instance of . + /// unique identifier for the fault simulation. + /// Fault simulation status. + /// The start time of the fault simulation. + /// The end time of the fault simulation. + /// Fault simulation details. + /// A new instance for mocking. + public static FaultSimulation FaultSimulation(string simulationId = null, FaultSimulationStatus? status = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, FaultSimulationDetails details = null) + { + return new FaultSimulation( + simulationId, + status, + startOn, + endOn, + details, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// unique identifier for the cluster resource. + /// unique identifier for the operation associated with the fault simulation. + /// List of node type simulations associated with the cluster fault simulation. + /// + /// Fault simulation parameters. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// A new instance for mocking. + public static FaultSimulationDetails FaultSimulationDetails(string clusterId = null, string operationId = null, IEnumerable nodeTypeFaultSimulation = null, FaultSimulationContent parameters = null) + { + nodeTypeFaultSimulation ??= new List(); + + return new FaultSimulationDetails(clusterId, operationId, nodeTypeFaultSimulation?.ToList(), parameters, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Node type name. + /// Fault simulation status. + /// Current or latest asynchronous operation identifier on the node type. + /// Current or latest asynchronous operation status on the node type. + /// A new instance for mocking. + public static NodeTypeFaultSimulation NodeTypeFaultSimulation(string nodeTypeName = null, FaultSimulationStatus? status = null, string operationId = null, SfmcOperationStatus? operationStatus = null) + { + return new NodeTypeFaultSimulation(nodeTypeName, status, operationId, operationStatus, serializedAdditionalRawData: null); + } + /// Initializes a new instance of . /// List of Managed VM Sizes for Service Fabric Managed Clusters. /// URL to get the next set of Managed VM Sizes if there are any. @@ -350,54 +577,13 @@ public static ManagedMaintenanceWindowStatus ManagedMaintenanceWindowStatus(bool serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The Service Fabric runtime version of the cluster. - /// The date of expiry of support of the version. - /// Cluster operating system, the default will be Windows. - /// A new instance for mocking. - public static ServiceFabricManagedClusterVersion ServiceFabricManagedClusterVersion(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string clusterCodeVersion = null, DateTimeOffset? versionSupportExpireOn = null, ServiceFabricManagedClusterOSType? osType = null) - { - return new ServiceFabricManagedClusterVersion( - id, - name, - resourceType, - systemData, - clusterCodeVersion, - versionSupportExpireOn, - osType, - serializedAdditionalRawData: null); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// VM Size properties. - /// A new instance for mocking. - public static ServiceFabricManagedUnsupportedVmSize ServiceFabricManagedUnsupportedVmSize(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string vmSize = null) - { - return new ServiceFabricManagedUnsupportedVmSize( - id, - name, - resourceType, - systemData, - vmSize != null ? new VmSize(vmSize, serializedAdditionalRawData: null) : null, - serializedAdditionalRawData: null); - } - /// Initializes a new instance of . /// The id. /// The name. /// The resourceType. /// The systemData. - /// The node type sku. /// Indicates the Service Fabric system services for the cluster will run on this node type. This setting cannot be changed once the node type is created. - /// The number of nodes in the node type. <br /><br />**Values:** <br />-1 - Use when auto scale rules are configured or sku.capacity is defined <br /> 0 - Not supported <br /> >0 - Use for manual scale. + /// The number of nodes in the node type. **Values:** -1 - Use when auto scale rules are configured or sku.capacity is defined 0 - Not supported >0 - Use for manual scale. /// Disk size for the managed disk attached to the vms on the node type in GBs. /// Managed data disk type. Specifies the storage account type for the managed disk. /// Managed data disk letter. It can not use the reserved letter C or D and it can not change after created. @@ -412,7 +598,7 @@ public static ServiceFabricManagedUnsupportedVmSize ServiceFabricManagedUnsuppor /// The version of the Azure Virtual Machines Marketplace image. A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. /// The secrets to install in the virtual machines. /// Set of extensions that should be installed onto the virtual machines. - /// Identities to assign to the virtual machine scale set under the node type. + /// Identities to assign to the virtual machine scale set under the node type. /// Indicates if the node type can only host Stateless workloads. /// Indicates if scale set associated with the node type can be composed of multiple placement groups. /// Indicates the node type uses its own frontend configurations instead of the default one for the cluster. This setting can only be specified for non-primary node types and can not be added or removed after the node type is created. @@ -433,8 +619,9 @@ public static ServiceFabricManagedUnsupportedVmSize ServiceFabricManagedUnsuppor /// Indicates the resource id of the vm image. This parameter is used for custom vm image. /// Indicates the resource id of the subnet for the node type. /// Specifies the actions to be performed on the vms before bootstrapping the service fabric runtime. - /// Specifies the security type of the nodeType. Only Standard and TrustedLaunch are currently supported. - /// Specifies whether secure boot should be enabled on the nodeType. Can only be used with TrustedLaunch SecurityType. + /// Specifies the security type of the nodeType. Supported values include Standard, TrustedLaunch and ConfidentialVM. + /// Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob and VMGuestStateOnly for encryption of just the VMGuestState blob. Note: It can be set for only Confidential VMs. + /// Specifies whether secure boot should be enabled on the nodeType. Can only be used with TrustedLaunch and ConfidentialVM SecurityType. /// Specifies whether each node is allocated its own public IPv4 address. This is only supported on secondary node types with custom Load Balancers. /// Specifies whether each node is allocated its own public IPv6 address. This is only supported on secondary node types with custom Load Balancers. /// Indicates the resource id of the vm shared galleries image. This parameter is used for custom vm image. @@ -446,15 +633,17 @@ public static ServiceFabricManagedUnsupportedVmSize ServiceFabricManagedUnsuppor /// Specifies the settings for any additional secondary network interfaces to attach to the node type. /// Specifies the computer name prefix. Limited to 9 characters. If specified, allows for a longer name to be specified for the node type name. /// Specifies the gallery applications that should be made available to the underlying VMSS. - /// Azure resource tags. + /// Setting this to true allows stateless node types to scale out without equal distribution across zones. + /// Resource tags. + /// The node type sku. /// A new instance for mocking. - public static ServiceFabricManagedNodeTypeData ServiceFabricManagedNodeTypeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, NodeTypeSku sku = null, bool? isPrimary = null, int? vmInstanceCount = null, int? dataDiskSizeInGB = null, ServiceFabricManagedDataDiskType? dataDiskType = null, string dataDiskLetter = null, IDictionary placementProperties = null, IDictionary capacities = null, EndpointRangeDescription applicationPorts = null, EndpointRangeDescription ephemeralPorts = null, string vmSize = null, string vmImagePublisher = null, string vmImageOffer = null, string vmImageSku = null, string vmImageVersion = null, IEnumerable vmSecrets = null, IEnumerable vmExtensions = null, IEnumerable userAssignedIdentities = null, bool? isStateless = null, bool? hasMultiplePlacementGroups = null, IEnumerable frontendConfigurations = null, IEnumerable networkSecurityRules = null, IEnumerable additionalDataDisks = null, bool? isEncryptionAtHostEnabled = null, ServiceFabricManagedResourceProvisioningState? provisioningState = null, bool? isAcceleratedNetworkingEnabled = null, bool? useDefaultPublicLoadBalancer = null, bool? useTempDataDisk = null, bool? isOverProvisioningEnabled = null, IEnumerable zones = null, bool? isSpotVm = null, string hostGroupId = null, bool? useEphemeralOSDisk = null, string spotRestoreTimeout = null, SpotNodeVmEvictionPolicyType? evictionPolicy = null, ResourceIdentifier vmImageResourceId = null, ResourceIdentifier subnetId = null, IEnumerable vmSetupActions = null, ServiceFabricManagedClusterSecurityType? securityType = null, bool? isSecureBootEnabled = null, bool? isNodePublicIPEnabled = null, bool? isNodePublicIPv6Enabled = null, ResourceIdentifier vmSharedGalleryImageId = null, ResourceIdentifier natGatewayId = null, IEnumerable natConfigurations = null, VmImagePlan vmImagePlan = null, ResourceIdentifier serviceArtifactReferenceId = null, ResourceIdentifier dscpConfigurationId = null, IEnumerable additionalNetworkInterfaceConfigurations = null, string computerNamePrefix = null, IEnumerable vmApplications = null, IDictionary tags = null) + public static ServiceFabricManagedNodeTypeData ServiceFabricManagedNodeTypeData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, bool? isPrimary = null, int? vmInstanceCount = null, int? dataDiskSizeInGB = null, ServiceFabricManagedDataDiskType? dataDiskType = null, string dataDiskLetter = null, IDictionary placementProperties = null, IDictionary capacities = null, EndpointRangeDescription applicationPorts = null, EndpointRangeDescription ephemeralPorts = null, string vmSize = null, string vmImagePublisher = null, string vmImageOffer = null, string vmImageSku = null, string vmImageVersion = null, IEnumerable vmSecrets = null, IEnumerable vmExtensions = null, IEnumerable vmManagedIdentityArmId = null, bool? isStateless = null, bool? hasMultiplePlacementGroups = null, IEnumerable frontendConfigurations = null, IEnumerable networkSecurityRules = null, IEnumerable additionalDataDisks = null, bool? isEncryptionAtHostEnabled = null, ServiceFabricManagedResourceProvisioningState? provisioningState = null, bool? isAcceleratedNetworkingEnabled = null, bool? useDefaultPublicLoadBalancer = null, bool? useTempDataDisk = null, bool? isOverProvisioningEnabled = null, IEnumerable zones = null, bool? isSpotVm = null, string hostGroupId = null, bool? useEphemeralOSDisk = null, string spotRestoreTimeout = null, SpotNodeVmEvictionPolicyType? evictionPolicy = null, ResourceIdentifier vmImageResourceId = null, ResourceIdentifier subnetId = null, IEnumerable vmSetupActions = null, ServiceFabricManagedClusterSecurityType? securityType = null, SecurityEncryptionType? securityEncryptionType = null, bool? isSecureBootEnabled = null, bool? isNodePublicIPEnabled = null, bool? isNodePublicIPv6Enabled = null, ResourceIdentifier vmSharedGalleryImageId = null, ResourceIdentifier natGatewayId = null, IEnumerable natConfigurations = null, VmImagePlan vmImagePlan = null, ResourceIdentifier serviceArtifactReferenceId = null, ResourceIdentifier dscpConfigurationId = null, IEnumerable additionalNetworkInterfaceConfigurations = null, string computerNamePrefix = null, IEnumerable vmApplications = null, bool? zoneBalance = null, IDictionary tags = null, NodeTypeSku sku = null) { placementProperties ??= new Dictionary(); capacities ??= new Dictionary(); vmSecrets ??= new List(); vmExtensions ??= new List(); - userAssignedIdentities ??= new List(); + vmManagedIdentityArmId ??= new List(); frontendConfigurations ??= new List(); networkSecurityRules ??= new List(); additionalDataDisks ??= new List(); @@ -470,7 +659,6 @@ public static ServiceFabricManagedNodeTypeData ServiceFabricManagedNodeTypeData( name, resourceType, systemData, - sku, isPrimary, vmInstanceCount, dataDiskSizeInGB, @@ -487,7 +675,7 @@ public static ServiceFabricManagedNodeTypeData ServiceFabricManagedNodeTypeData( vmImageVersion, vmSecrets?.ToList(), vmExtensions?.ToList(), - userAssignedIdentities != null ? new VmManagedIdentity(userAssignedIdentities?.ToList(), serializedAdditionalRawData: null) : null, + vmManagedIdentityArmId != null ? new VmManagedIdentity(vmManagedIdentityArmId?.ToList(), serializedAdditionalRawData: null) : null, isStateless, hasMultiplePlacementGroups, frontendConfigurations?.ToList(), @@ -509,6 +697,7 @@ public static ServiceFabricManagedNodeTypeData ServiceFabricManagedNodeTypeData( subnetId, vmSetupActions?.ToList(), securityType, + securityEncryptionType, isSecureBootEnabled, isNodePublicIPEnabled, isNodePublicIPv6Enabled, @@ -521,14 +710,16 @@ public static ServiceFabricManagedNodeTypeData ServiceFabricManagedNodeTypeData( additionalNetworkInterfaceConfigurations?.ToList(), computerNamePrefix, vmApplications?.ToList(), + zoneBalance, tags, + sku, serializedAdditionalRawData: null); } /// Initializes a new instance of . /// The name of the extension. /// The name of the extension handler publisher. - /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// Specifies the type of the extension; an example is "CustomScriptExtension". /// Specifies the version of the script handler. /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. /// Json formatted public settings for the extension. @@ -539,7 +730,7 @@ public static ServiceFabricManagedNodeTypeData ServiceFabricManagedNodeTypeData( /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. /// Indicates the setup order for the extension. /// A new instance for mocking. - public static NodeTypeVmssExtension NodeTypeVmssExtension(string name = null, string publisher = null, string vmssExtensionPropertiesType = null, string typeHandlerVersion = null, bool? autoUpgradeMinorVersion = null, BinaryData settings = null, BinaryData protectedSettings = null, string forceUpdateTag = null, IEnumerable provisionAfterExtensions = null, string provisioningState = null, bool? isAutomaticUpgradeEnabled = null, IEnumerable setupOrder = null) + public static NodeTypeVmssExtension NodeTypeVmssExtension(string name = null, string publisher = null, string type = null, string typeHandlerVersion = null, bool? autoUpgradeMinorVersion = null, VmSSExtensionPropertiesSettings settings = null, VmSSExtensionPropertiesProtectedSettings protectedSettings = null, string forceUpdateTag = null, IEnumerable provisionAfterExtensions = null, string provisioningState = null, bool? isAutomaticUpgradeEnabled = null, IEnumerable setupOrder = null) { provisionAfterExtensions ??= new List(); setupOrder ??= new List(); @@ -547,7 +738,7 @@ public static NodeTypeVmssExtension NodeTypeVmssExtension(string name = null, st return new NodeTypeVmssExtension( name, publisher, - vmssExtensionPropertiesType, + type, typeHandlerVersion, autoUpgradeMinorVersion, settings, @@ -561,7 +752,7 @@ public static NodeTypeVmssExtension NodeTypeVmssExtension(string name = null, st } /// Initializes a new instance of . - /// The type of resource the sku applies to. <br /><br />Value: Microsoft.ServiceFabric/managedClusters/nodeTypes. + /// The type of resource the sku applies to. Value: Microsoft.ServiceFabric/managedClusters/nodeTypes. /// The supported SKU for a for node type. /// Provides information about how the node count can be scaled. /// A new instance for mocking. @@ -572,7 +763,7 @@ public static NodeTypeAvailableSku NodeTypeAvailableSku(ResourceType? resourceTy /// Initializes a new instance of . /// The sku name. - /// Specifies the tier of the node type. <br /><br /> Possible Values:<br /> **Standard**. + /// Specifies the tier of the node type. Possible Values: **Standard**. /// A new instance for mocking. public static NodeTypeSupportedSku NodeTypeSupportedSku(string name = null, string tier = null) { @@ -590,242 +781,33 @@ public static NodeTypeSkuCapacity NodeTypeSkuCapacity(int? minimum = null, int? return new NodeTypeSkuCapacity(minimum, maximum, @default, scaleType, serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - /// A list that describes the correlation of the service with other services. - /// The service load metrics is given as an array of ServiceLoadMetric objects. - /// - /// A list that describes the correlation of the service with other services. - /// 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 . - /// - /// Specifies the move cost for the service. - /// Scaling policies for this service. - /// The current deployment or provisioning state, which only appears in the response. - /// The name of the service type. - /// - /// Describes how the service is partitioned. - /// 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 activation Mode of the service package. - /// - /// Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP). - /// When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. - /// When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable. - /// - /// - /// A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. - /// The target replica set size as a number. - /// The minimum replica set size as a number. - /// The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format "hh:mm:ss". - /// The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format "hh:mm:ss". - /// The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format "hh:mm:ss". - /// The duration for which replicas can stay InBuild before reporting that build is stuck, represented in ISO 8601 format "hh:mm:ss". - /// A new instance for mocking. - public static StatefulServiceProperties StatefulServiceProperties(string placementConstraints = null, IEnumerable correlationScheme = null, IEnumerable serviceLoadMetrics = null, IEnumerable servicePlacementPolicies = null, ServiceFabricManagedServiceMoveCost? defaultMoveCost = null, IEnumerable scalingPolicies = null, string provisioningState = null, string serviceTypeName = null, ManagedServicePartitionScheme partitionDescription = null, ManagedServicePackageActivationMode? servicePackageActivationMode = null, string serviceDnsName = null, bool? hasPersistedState = null, int? targetReplicaSetSize = null, int? minReplicaSetSize = null, TimeSpan? replicaRestartWaitDuration = null, TimeSpan? quorumLossWaitDuration = null, TimeSpan? standByReplicaKeepDuration = null, TimeSpan? servicePlacementTimeLimit = null) + /// Initializes a new instance of . + /// The name of the operation. + /// The start time of the operation. + /// The end time of the operation. + /// The completion percentage of the operation. + /// The status of the operation. + /// The operation error. + /// A new instance for mocking. + public static LongRunningOperationResult LongRunningOperationResult(string name = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, double? percentComplete = null, string status = null, ErrorModelError error = null) { - correlationScheme ??= new List(); - serviceLoadMetrics ??= new List(); - servicePlacementPolicies ??= new List(); - scalingPolicies ??= new List(); - - return new StatefulServiceProperties( - placementConstraints, - correlationScheme?.ToList(), - serviceLoadMetrics?.ToList(), - servicePlacementPolicies?.ToList(), - defaultMoveCost, - scalingPolicies?.ToList(), - serializedAdditionalRawData: null, - provisioningState, - ServiceKind.Stateful, - serviceTypeName, - partitionDescription, - servicePackageActivationMode, - serviceDnsName, - hasPersistedState, - targetReplicaSetSize, - minReplicaSetSize, - replicaRestartWaitDuration, - quorumLossWaitDuration, - standByReplicaKeepDuration, - servicePlacementTimeLimit); - } - - /// Initializes a new instance of . - /// The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". - /// A list that describes the correlation of the service with other services. - /// The service load metrics is given as an array of ServiceLoadMetric objects. - /// - /// A list that describes the correlation of the service with other services. - /// 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 . - /// - /// Specifies the move cost for the service. - /// Scaling policies for this service. - /// The current deployment or provisioning state, which only appears in the response. - /// The name of the service type. - /// - /// Describes how the service is partitioned. - /// 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 activation Mode of the service package. - /// - /// Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP). - /// When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. - /// When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable. - /// - /// - /// The instance count. - /// MinInstanceCount is the minimum number of instances that must be up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstanceCount computation -1 is first converted into the number of nodes on which the instances are allowed to be placed according to the placement constraints on the service. - /// MinInstancePercentage is the minimum percentage of InstanceCount that must be up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstancePercentage computation, -1 is first converted into the number of nodes on which the instances are allowed to be placed according to the placement constraints on the service. - /// A new instance for mocking. - public static StatelessServiceProperties StatelessServiceProperties(string placementConstraints = null, IEnumerable correlationScheme = null, IEnumerable serviceLoadMetrics = null, IEnumerable servicePlacementPolicies = null, ServiceFabricManagedServiceMoveCost? defaultMoveCost = null, IEnumerable scalingPolicies = null, string provisioningState = null, string serviceTypeName = null, ManagedServicePartitionScheme partitionDescription = null, ManagedServicePackageActivationMode? servicePackageActivationMode = null, string serviceDnsName = null, int instanceCount = default, int? minInstanceCount = null, int? minInstancePercentage = null) - { - correlationScheme ??= new List(); - serviceLoadMetrics ??= new List(); - servicePlacementPolicies ??= new List(); - scalingPolicies ??= new List(); - - return new StatelessServiceProperties( - placementConstraints, - correlationScheme?.ToList(), - serviceLoadMetrics?.ToList(), - servicePlacementPolicies?.ToList(), - defaultMoveCost, - scalingPolicies?.ToList(), - serializedAdditionalRawData: null, - provisioningState, - ServiceKind.Stateless, - serviceTypeName, - partitionDescription, - servicePackageActivationMode, - serviceDnsName, - instanceCount, - minInstanceCount, - minInstancePercentage); - } - - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The tags. - /// The location. - /// The sku of the managed cluster. - /// The cluster dns name. - /// The fully qualified domain name associated with the public load balancer of the cluster. - /// The IPv4 address associated with the public load balancer of the cluster. - /// A service generated unique identifier for the cluster resource. - /// The current state of the cluster. - /// List of thumbprints of the cluster certificates. - /// The port used for client connections to the cluster. - /// The port used for HTTP connections to the cluster. - /// VM admin user name. - /// VM admin user password. - /// Load balancing rules that are applied to the public load balancer of the cluster. - /// Setting this to true enables RDP access to the VM. The default NSG rule opens RDP port to Internet which can be overridden with custom Network Security Rules. The default value for this setting is false. - /// Custom Network Security Rules that are applied to the Virtual Network of the cluster. - /// Client certificates that are allowed to manage the cluster. - /// The AAD authentication settings of the cluster. - /// The list of custom fabric settings to configure the cluster. - /// The provisioning state of the managed cluster resource. - /// The Service Fabric runtime version of the cluster. This property is required when **clusterUpgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. - /// - /// The upgrade mode of the cluster when new Service Fabric runtime version is available. - /// - /// Indicates when new cluster runtime version upgrades will be applied after they are released. By default is Wave0. Only applies when **clusterUpgradeMode** is set to 'Automatic'. - /// List of add-on features to enable on the cluster. - /// Setting this to true enables automatic OS upgrade for the node types that are created using any platform OS image with version 'latest'. The default value for this setting is false. - /// Indicates if the cluster has zone resiliency. - /// The policy used to clean up unused versions. - /// Setting this to true creates IPv6 address space for the default VNet used by the cluster. This setting cannot be changed once the cluster is created. The default value for this setting is false. - /// If specified, the node types for the cluster are created in this subnet instead of the default VNet. The **networkSecurityRules** specified for the cluster are also applied to this subnet. This setting cannot be changed once the cluster is created. - /// The list of IP tags associated with the default public IP address of the cluster. - /// IPv6 address for the cluster if IPv6 is enabled. - /// Setting this to true will link the IPv4 address as the ServicePublicIP of the IPv6 address. It can only be set to True if IPv6 is enabled on the cluster. - /// Auxiliary subnets for the cluster. - /// Service endpoints for subnets in the cluster. - /// Indicates the update mode for Cross Az clusters. - /// For new clusters, this parameter indicates that it uses Bring your own VNet, but the subnet is specified at node type level; and for such clusters, the subnetId property is required for node types. - /// Specify the resource id of a public IPv4 prefix that the load balancer will allocate a public IPv4 address from. This setting cannot be changed once the cluster is created. - /// Specify the resource id of a public IPv6 prefix that the load balancer will allocate a public IPv6 address from. This setting cannot be changed once the cluster is created. - /// Specify the resource id of a DDoS network protection plan that will be associated with the virtual network of the cluster. - /// The policy to use when upgrading the cluster. - /// The port used for token-auth based HTTPS connections to the cluster. Cannot be set to the same port as HttpGatewayEndpoint. - /// If true, token-based authentication is not allowed on the HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based authentication is used, HttpGatewayTokenAuthConnectionPort must be defined. - /// Azure resource etag. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static ServiceFabricManagedClusterData ServiceFabricManagedClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ServiceFabricManagedClustersSkuName? skuName, string dnsName, string fqdn, IPAddress ipv4Address, Guid? clusterId, ServiceFabricManagedClusterState? clusterState, IEnumerable clusterCertificateThumbprints, int? clientConnectionPort, int? httpGatewayConnectionPort, string adminUserName, string adminPassword, IEnumerable loadBalancingRules, bool? isRdpAccessAllowed, IEnumerable networkSecurityRules, IEnumerable clients, ManagedClusterAzureActiveDirectory azureActiveDirectory, IEnumerable fabricSettings, ServiceFabricManagedResourceProvisioningState? provisioningState, string clusterCodeVersion, ManagedClusterUpgradeMode? clusterUpgradeMode, ManagedClusterUpgradeCadence? clusterUpgradeCadence, IEnumerable addOnFeatures, bool? isAutoOSUpgradeEnabled, bool? hasZoneResiliency, int? maxUnusedVersionsToKeep, bool? isIPv6Enabled, string subnetId, IEnumerable ipTags, IPAddress ipv6Address, bool? isServicePublicIPEnabled, IEnumerable auxiliarySubnets, IEnumerable serviceEndpoints, ZonalUpdateMode? zonalUpdateMode, bool? useCustomVnet, ResourceIdentifier publicIPPrefixId, ResourceIdentifier publicIPv6PrefixId, ResourceIdentifier ddosProtectionPlanId, ManagedClusterUpgradePolicy upgradeDescription, int? httpGatewayTokenAuthConnectionPort, bool? isHttpGatewayExclusiveAuthModeEnabled, ETag? etag) - { - return ServiceFabricManagedClusterData(id: id, name: name, resourceType: resourceType, systemData: systemData, tags: tags, location: location, skuName: skuName, dnsName: dnsName, fqdn: fqdn, ipv4Address: ipv4Address, clusterId: clusterId, clusterState: clusterState, clusterCertificateThumbprints: clusterCertificateThumbprints, clientConnectionPort: clientConnectionPort, httpGatewayConnectionPort: httpGatewayConnectionPort, adminUserName: adminUserName, adminPassword: adminPassword, loadBalancingRules: loadBalancingRules, isRdpAccessAllowed: isRdpAccessAllowed, networkSecurityRules: networkSecurityRules, clients: clients, azureActiveDirectory: azureActiveDirectory, fabricSettings: fabricSettings, provisioningState: provisioningState, clusterCodeVersion: clusterCodeVersion, clusterUpgradeMode: clusterUpgradeMode, clusterUpgradeCadence: clusterUpgradeCadence, addOnFeatures: addOnFeatures, isAutoOSUpgradeEnabled: isAutoOSUpgradeEnabled, hasZoneResiliency: hasZoneResiliency, maxUnusedVersionsToKeep: maxUnusedVersionsToKeep, isIPv6Enabled: isIPv6Enabled, subnetId: subnetId, ipTags: ipTags, ipv6Address: ipv6Address, isServicePublicIPEnabled: isServicePublicIPEnabled, auxiliarySubnets: auxiliarySubnets, serviceEndpoints: serviceEndpoints, zonalUpdateMode: zonalUpdateMode, useCustomVnet: useCustomVnet, publicIPPrefixId: publicIPPrefixId, publicIPv6PrefixId: publicIPv6PrefixId, ddosProtectionPlanId: ddosProtectionPlanId, upgradeDescription: upgradeDescription, httpGatewayTokenAuthConnectionPort: httpGatewayTokenAuthConnectionPort, isHttpGatewayExclusiveAuthModeEnabled: isHttpGatewayExclusiveAuthModeEnabled, autoGeneratedDomainNameLabelScope: default, allocatedOutboundPorts: default, etag: etag); + return new LongRunningOperationResult( + name, + startOn, + endOn, + percentComplete, + status, + error, + serializedAdditionalRawData: null); } - /// Initializes a new instance of . - /// The id. - /// The name. - /// The resourceType. - /// The systemData. - /// The node type sku. - /// Indicates the Service Fabric system services for the cluster will run on this node type. This setting cannot be changed once the node type is created. - /// The number of nodes in the node type. <br /><br />**Values:** <br />-1 - Use when auto scale rules are configured or sku.capacity is defined <br /> 0 - Not supported <br /> >0 - Use for manual scale. - /// Disk size for the managed disk attached to the vms on the node type in GBs. - /// Managed data disk type. Specifies the storage account type for the managed disk. - /// Managed data disk letter. It can not use the reserved letter C or D and it can not change after created. - /// The placement tags applied to nodes in the node type, which can be used to indicate where certain services (workload) should run. - /// The capacity tags applied to the nodes in the node type, the cluster resource manager uses these tags to understand how much resource a node has. - /// The range of ports from which cluster assigned port to Service Fabric applications. - /// The range of ephemeral ports that nodes in this node type should be configured with. - /// The size of virtual machines in the pool. All virtual machines in a pool are the same size. For example, Standard_D3. - /// The publisher of the Azure Virtual Machines Marketplace image. For example, Canonical or MicrosoftWindowsServer. - /// The offer type of the Azure Virtual Machines Marketplace image. For example, UbuntuServer or WindowsServer. - /// The SKU of the Azure Virtual Machines Marketplace image. For example, 14.04.0-LTS or 2012-R2-Datacenter. - /// The version of the Azure Virtual Machines Marketplace image. A value of 'latest' can be specified to select the latest version of an image. If omitted, the default is 'latest'. - /// The secrets to install in the virtual machines. - /// Set of extensions that should be installed onto the virtual machines. - /// Identities to assign to the virtual machine scale set under the node type. - /// Indicates if the node type can only host Stateless workloads. - /// Indicates if scale set associated with the node type can be composed of multiple placement groups. - /// Indicates the node type uses its own frontend configurations instead of the default one for the cluster. This setting can only be specified for non-primary node types and can not be added or removed after the node type is created. - /// The Network Security Rules for this node type. This setting can only be specified for node types that are configured with frontend configurations. - /// Additional managed data disks. - /// Enable or disable the Host Encryption for the virtual machines on the node type. This will enable the encryption for all the disks including Resource/Temp disk at host itself. Default: The Encryption at host will be disabled unless this property is set to true for the resource. - /// The provisioning state of the node type resource. - /// Specifies whether the network interface is accelerated networking-enabled. - /// Specifies whether the use public load balancer. If not specified and the node type doesn't have its own frontend configuration, it will be attached to the default load balancer. If the node type uses its own Load balancer and useDefaultPublicLoadBalancer is true, then the frontend has to be an Internal Load Balancer. If the node type uses its own Load balancer and useDefaultPublicLoadBalancer is false or not set, then the custom load balancer must include a public load balancer to provide outbound connectivity. - /// Specifies whether to use the temporary disk for the service fabric data root, in which case no managed data disk will be attached and the temporary disk will be used. It is only allowed for stateless node types. - /// Specifies whether the node type should be overprovisioned. It is only allowed for stateless node types. - /// Specifies the availability zones where the node type would span across. If the cluster is not spanning across availability zones, initiates az migration for the cluster. - /// Indicates whether the node type will be Spot Virtual Machines. Azure will allocate the VMs if there is capacity available and the VMs can be evicted at any time. - /// Specifies the full host group resource Id. This property is used for deploying on azure dedicated hosts. - /// Indicates whether to use ephemeral os disk. The sku selected on the vmSize property needs to support this feature. - /// Indicates the time duration after which the platform will not try to restore the VMSS SPOT instances specified as ISO 8601. - /// Specifies the eviction policy for virtual machines in a SPOT node type. Default is Delete. - /// Indicates the resource id of the vm image. This parameter is used for custom vm image. - /// Indicates the resource id of the subnet for the node type. - /// Specifies the actions to be performed on the vms before bootstrapping the service fabric runtime. - /// Specifies the security type of the nodeType. Only Standard and TrustedLaunch are currently supported. - /// Specifies whether secure boot should be enabled on the nodeType. Can only be used with TrustedLaunch SecurityType. - /// Specifies whether each node is allocated its own public IPv4 address. This is only supported on secondary node types with custom Load Balancers. - /// Specifies whether each node is allocated its own public IPv6 address. This is only supported on secondary node types with custom Load Balancers. - /// Indicates the resource id of the vm shared galleries image. This parameter is used for custom vm image. - /// Specifies the resource id of a NAT Gateway to attach to the subnet of this node type. Node type must use custom load balancer. - /// Specifies the NAT configuration on default public Load Balancer for the node type. This is only supported for node types use the default public Load Balancer. - /// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save. - /// Specifies the service artifact reference id used to set same image version for all virtual machines in the scale set when using 'latest' image version. - /// Specifies the resource id of the DSCP configuration to apply to the node type network interface. - /// Specifies the settings for any additional secondary network interfaces to attach to the node type. - /// Specifies the computer name prefix. Limited to 9 characters. If specified, allows for a longer name to be specified for the node type name. - /// Azure resource tags. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static ServiceFabricManagedNodeTypeData ServiceFabricManagedNodeTypeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NodeTypeSku sku, bool? isPrimary, int? vmInstanceCount, int? dataDiskSizeInGB, ServiceFabricManagedDataDiskType? dataDiskType, string dataDiskLetter, IDictionary placementProperties, IDictionary capacities, EndpointRangeDescription applicationPorts, EndpointRangeDescription ephemeralPorts, string vmSize, string vmImagePublisher, string vmImageOffer, string vmImageSku, string vmImageVersion, IEnumerable vmSecrets, IEnumerable vmExtensions, IEnumerable userAssignedIdentities, bool? isStateless, bool? hasMultiplePlacementGroups, IEnumerable frontendConfigurations, IEnumerable networkSecurityRules, IEnumerable additionalDataDisks, bool? isEncryptionAtHostEnabled, ServiceFabricManagedResourceProvisioningState? provisioningState, bool? isAcceleratedNetworkingEnabled, bool? useDefaultPublicLoadBalancer, bool? useTempDataDisk, bool? isOverProvisioningEnabled, IEnumerable zones, bool? isSpotVm, string hostGroupId, bool? useEphemeralOSDisk, string spotRestoreTimeout, SpotNodeVmEvictionPolicyType? evictionPolicy, ResourceIdentifier vmImageResourceId, ResourceIdentifier subnetId, IEnumerable vmSetupActions, ServiceFabricManagedClusterSecurityType? securityType, bool? isSecureBootEnabled, bool? isNodePublicIPEnabled, bool? isNodePublicIPv6Enabled, ResourceIdentifier vmSharedGalleryImageId, ResourceIdentifier natGatewayId, IEnumerable natConfigurations, VmImagePlan vmImagePlan, ResourceIdentifier serviceArtifactReferenceId, ResourceIdentifier dscpConfigurationId, IEnumerable additionalNetworkInterfaceConfigurations, string computerNamePrefix, IDictionary tags) + /// Initializes a new instance of . + /// The error code. + /// The error message. + /// A new instance for mocking. + public static ErrorModelError ErrorModelError(string code = null, string message = null) { - return ServiceFabricManagedNodeTypeData(id: id, name: name, resourceType: resourceType, systemData: systemData, sku: sku, isPrimary: isPrimary, vmInstanceCount: vmInstanceCount, dataDiskSizeInGB: dataDiskSizeInGB, dataDiskType: dataDiskType, dataDiskLetter: dataDiskLetter, placementProperties: placementProperties, capacities: capacities, applicationPorts: applicationPorts, ephemeralPorts: ephemeralPorts, vmSize: vmSize, vmImagePublisher: vmImagePublisher, vmImageOffer: vmImageOffer, vmImageSku: vmImageSku, vmImageVersion: vmImageVersion, vmSecrets: vmSecrets, vmExtensions: vmExtensions, userAssignedIdentities: userAssignedIdentities, isStateless: isStateless, hasMultiplePlacementGroups: hasMultiplePlacementGroups, frontendConfigurations: frontendConfigurations, networkSecurityRules: networkSecurityRules, additionalDataDisks: additionalDataDisks, isEncryptionAtHostEnabled: isEncryptionAtHostEnabled, provisioningState: provisioningState, isAcceleratedNetworkingEnabled: isAcceleratedNetworkingEnabled, useDefaultPublicLoadBalancer: useDefaultPublicLoadBalancer, useTempDataDisk: useTempDataDisk, isOverProvisioningEnabled: isOverProvisioningEnabled, zones: zones, isSpotVm: isSpotVm, hostGroupId: hostGroupId, useEphemeralOSDisk: useEphemeralOSDisk, spotRestoreTimeout: spotRestoreTimeout, evictionPolicy: evictionPolicy, vmImageResourceId: vmImageResourceId, subnetId: subnetId, vmSetupActions: vmSetupActions, securityType: securityType, isSecureBootEnabled: isSecureBootEnabled, isNodePublicIPEnabled: isNodePublicIPEnabled, isNodePublicIPv6Enabled: isNodePublicIPv6Enabled, vmSharedGalleryImageId: vmSharedGalleryImageId, natGatewayId: natGatewayId, natConfigurations: natConfigurations, vmImagePlan: vmImagePlan, serviceArtifactReferenceId: serviceArtifactReferenceId, dscpConfigurationId: dscpConfigurationId, additionalNetworkInterfaceConfigurations: additionalNetworkInterfaceConfigurations, computerNamePrefix: computerNamePrefix, vmApplications: default, tags: tags); + return new ErrorModelError(code, message, serializedAdditionalRawData: null); } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersArmClient.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersArmClient.cs index 7d80fd5be0e9..a0e589cecd55 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersArmClient.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersArmClient.cs @@ -34,6 +34,18 @@ private string GetApiVersionOrNull(ResourceType resourceType) return apiVersion; } + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The resource ID of the resource to get. + /// Returns a object. + public virtual ServiceFabricManagedApplicationResource GetServiceFabricManagedApplicationResource(ResourceIdentifier id) + { + ServiceFabricManagedApplicationResource.ValidateResourceId(id); + return new ServiceFabricManagedApplicationResource(Client, id); + } + /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. @@ -58,18 +70,6 @@ public virtual ServiceFabricManagedApplicationTypeVersionResource GetServiceFabr return new ServiceFabricManagedApplicationTypeVersionResource(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 ServiceFabricManagedApplicationResource GetServiceFabricManagedApplicationResource(ResourceIdentifier id) - { - ServiceFabricManagedApplicationResource.ValidateResourceId(id); - return new ServiceFabricManagedApplicationResource(Client, id); - } - /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. /// You can use to create a from its components. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersResourceGroupResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersResourceGroupResource.cs index e77ca51e1c64..c1d7741186f2 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersResourceGroupResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersResourceGroupResource.cs @@ -49,11 +49,11 @@ public virtual ServiceFabricManagedClusterCollection GetServiceFabricManagedClus /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -80,11 +80,11 @@ public virtual async Task> GetServ /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersSubscriptionResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersSubscriptionResource.cs index 4695cc8855df..3b54801d38fa 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersSubscriptionResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersSubscriptionResource.cs @@ -18,12 +18,16 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Mocking /// A class to add extension methods to SubscriptionResource. public partial class MockableServiceFabricManagedClustersSubscriptionResource : ArmResource { - private ClientDiagnostics _serviceFabricManagedClusterManagedClustersClientDiagnostics; - private ManagedClustersRestOperations _serviceFabricManagedClusterManagedClustersRestClient; private ClientDiagnostics _managedClusterVersionClientDiagnostics; private ManagedClusterVersionRestOperations _managedClusterVersionRestClient; private ClientDiagnostics _managedUnsupportedVmSizesClientDiagnostics; private ManagedUnsupportedVMSizesRestOperations _managedUnsupportedVmSizesRestClient; + private ClientDiagnostics _serviceFabricManagedClusterManagedClustersClientDiagnostics; + private ManagedClustersRestOperations _serviceFabricManagedClusterManagedClustersRestClient; + private ClientDiagnostics _operationResultsClientDiagnostics; + private OperationResultsRestOperations _operationResultsRestClient; + private ClientDiagnostics _operationStatusClientDiagnostics; + private OperationStatusRestOperations _operationStatusRestClient; /// Initializes a new instance of the class for mocking. protected MockableServiceFabricManagedClustersSubscriptionResource() @@ -37,12 +41,16 @@ internal MockableServiceFabricManagedClustersSubscriptionResource(ArmClient clie { } - private ClientDiagnostics ServiceFabricManagedClusterManagedClustersClientDiagnostics => _serviceFabricManagedClusterManagedClustersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ServiceFabricManagedClusters", ServiceFabricManagedClusterResource.ResourceType.Namespace, Diagnostics); - private ManagedClustersRestOperations ServiceFabricManagedClusterManagedClustersRestClient => _serviceFabricManagedClusterManagedClustersRestClient ??= new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ServiceFabricManagedClusterResource.ResourceType)); private ClientDiagnostics ManagedClusterVersionClientDiagnostics => _managedClusterVersionClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ServiceFabricManagedClusters", ProviderConstants.DefaultProviderNamespace, Diagnostics); private ManagedClusterVersionRestOperations ManagedClusterVersionRestClient => _managedClusterVersionRestClient ??= new ManagedClusterVersionRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - private ClientDiagnostics managedUnsupportedVMSizesClientDiagnostics => _managedUnsupportedVmSizesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ServiceFabricManagedClusters", ProviderConstants.DefaultProviderNamespace, Diagnostics); - private ManagedUnsupportedVMSizesRestOperations managedUnsupportedVMSizesRestClient => _managedUnsupportedVmSizesRestClient ??= new ManagedUnsupportedVMSizesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics ManagedUnsupportedVMSizesClientDiagnostics => _managedUnsupportedVmSizesClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ServiceFabricManagedClusters", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private ManagedUnsupportedVMSizesRestOperations ManagedUnsupportedVMSizesRestClient => _managedUnsupportedVmSizesRestClient ??= new ManagedUnsupportedVMSizesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics ServiceFabricManagedClusterManagedClustersClientDiagnostics => _serviceFabricManagedClusterManagedClustersClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ServiceFabricManagedClusters", ServiceFabricManagedClusterResource.ResourceType.Namespace, Diagnostics); + private ManagedClustersRestOperations ServiceFabricManagedClusterManagedClustersRestClient => _serviceFabricManagedClusterManagedClustersRestClient ??= new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(ServiceFabricManagedClusterResource.ResourceType)); + private ClientDiagnostics OperationResultsClientDiagnostics => _operationResultsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ServiceFabricManagedClusters", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private OperationResultsRestOperations OperationResultsRestClient => _operationResultsRestClient ??= new OperationResultsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + private ClientDiagnostics OperationStatusClientDiagnostics => _operationStatusClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ServiceFabricManagedClusters", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private OperationStatusRestOperations OperationStatusRestClient => _operationStatusRestClient ??= new OperationStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); private string GetApiVersionOrNull(ResourceType resourceType) { @@ -51,96 +59,180 @@ private string GetApiVersionOrNull(ResourceType resourceType) } /// - /// Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + /// Gets information about an available Service Fabric managed cluster code version. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions/{clusterVersion} /// /// /// Operation Id - /// ManagedClusters_ListBySubscription + /// ManagedClusterVersion_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview + /// + /// + /// + /// The location for the cluster code versions. This is different from cluster location. + /// The cluster code version. + /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> GetManagedClusterVersionAsync(string location, string clusterVersion, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(location, nameof(location)); + Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + + using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersion"); + scope.Start(); + try + { + var response = await ManagedClusterVersionRestClient.GetAsync(Id.SubscriptionId, location, clusterVersion, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets information about an available Service Fabric managed cluster code version. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions/{clusterVersion} /// /// - /// Resource - /// + /// Operation Id + /// ManagedClusterVersion_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview /// /// /// + /// The location for the cluster code versions. This is different from cluster location. + /// The cluster code version. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetServiceFabricManagedClustersAsync(CancellationToken cancellationToken = default) + /// or is an empty string, and was expected to be non-empty. + /// or is null. + public virtual Response GetManagedClusterVersion(string location, string clusterVersion, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceFabricManagedClusterManagedClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceFabricManagedClusterManagedClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceFabricManagedClusterResource(Client, ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(e)), ServiceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetServiceFabricManagedClusters", "value", "nextLink", cancellationToken); + Argument.AssertNotNullOrEmpty(location, nameof(location)); + Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + + using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersion"); + scope.Start(); + try + { + var response = ManagedClusterVersionRestClient.Get(Id.SubscriptionId, location, clusterVersion, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// - /// Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + /// Gets all available code versions for Service Fabric cluster resources by location. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions /// /// /// Operation Id - /// ManagedClusters_ListBySubscription + /// ManagedClusterVersion_List /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// + /// + /// + /// The location for the cluster code versions. This is different from cluster location. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetManagedClusterVersionsAsync(string location, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(location, nameof(location)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterVersionRestClient.CreateListRequest(Id.SubscriptionId, location); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(e), ManagedClusterVersionClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersions", "", null, cancellationToken); + } + + /// + /// Gets all available code versions for Service Fabric cluster resources by location. + /// /// - /// Resource - /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions + /// + /// + /// Operation Id + /// ManagedClusterVersion_List + /// + /// + /// Default Api Version + /// 2025-03-01-preview /// /// /// + /// The location for the cluster code versions. This is different from cluster location. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetServiceFabricManagedClusters(CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetManagedClusterVersions(string location, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceFabricManagedClusterManagedClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceFabricManagedClusterManagedClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceFabricManagedClusterResource(Client, ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(e)), ServiceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetServiceFabricManagedClusters", "value", "nextLink", cancellationToken); + Argument.AssertNotNullOrEmpty(location, nameof(location)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterVersionRestClient.CreateListRequest(Id.SubscriptionId, location); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(e), ManagedClusterVersionClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersions", "", null, cancellationToken); } /// - /// Gets information about an available Service Fabric managed cluster code version. + /// Gets information about an available Service Fabric cluster code version by environment. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions/{clusterVersion} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions/{clusterVersion} /// /// /// Operation Id - /// ManagedClusterVersion_Get + /// ManagedClusterVersion_GetManagedClusterVersionByEnvironment /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// The location for the cluster code versions. This is different from cluster location. + /// The operating system of the cluster. /// The cluster code version. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetManagedClusterVersionAsync(AzureLocation location, string clusterVersion, CancellationToken cancellationToken = default) + /// or is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> GetManagedClusterVersionByEnvironmentAsync(string location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(location, nameof(location)); Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); - using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersion"); + using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersionByEnvironment"); scope.Start(); try { - var response = await ManagedClusterVersionRestClient.GetAsync(Id.SubscriptionId, location, clusterVersion, cancellationToken).ConfigureAwait(false); + var response = await ManagedClusterVersionRestClient.GetManagedClusterVersionByEnvironmentAsync(Id.SubscriptionId, location, environment, clusterVersion, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -151,36 +243,38 @@ public virtual async Task> GetManag } /// - /// Gets information about an available Service Fabric managed cluster code version. + /// Gets information about an available Service Fabric cluster code version by environment. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions/{clusterVersion} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions/{clusterVersion} /// /// /// Operation Id - /// ManagedClusterVersion_Get + /// ManagedClusterVersion_GetManagedClusterVersionByEnvironment /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// The location for the cluster code versions. This is different from cluster location. + /// The operating system of the cluster. /// The cluster code version. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetManagedClusterVersion(AzureLocation location, string clusterVersion, CancellationToken cancellationToken = default) + /// or is an empty string, and was expected to be non-empty. + /// or is null. + public virtual Response GetManagedClusterVersionByEnvironment(string location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { + Argument.AssertNotNullOrEmpty(location, nameof(location)); Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); - using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersion"); + using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersionByEnvironment"); scope.Start(); try { - var response = ManagedClusterVersionRestClient.Get(Id.SubscriptionId, location, clusterVersion, cancellationToken); + var response = ManagedClusterVersionRestClient.GetManagedClusterVersionByEnvironment(Id.SubscriptionId, location, environment, clusterVersion, cancellationToken); return response; } catch (Exception e) @@ -191,37 +285,99 @@ public virtual Response GetManagedClusterVer } /// - /// Gets information about an available Service Fabric cluster code version by environment. + /// Gets all available code versions for Service Fabric cluster resources by environment. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions/{clusterVersion} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions /// /// /// Operation Id - /// ManagedClusterVersion_GetByEnvironment + /// ManagedClusterVersion_ListByEnvironment /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// The location for the cluster code versions. This is different from cluster location. - /// The operating system of the cluster. The default means all. - /// The cluster code version. + /// The operating system of the cluster. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetManagedClusterVersionByEnvironmentAsync(AzureLocation location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetManagedClusterVersionsByEnvironmentAsync(string location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); - using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersionByEnvironment"); + HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterVersionRestClient.CreateListByEnvironmentRequest(Id.SubscriptionId, location, environment); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(e), ManagedClusterVersionClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersionsByEnvironment", "", null, cancellationToken); + } + + /// + /// Gets all available code versions for Service Fabric cluster resources by environment. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions + /// + /// + /// Operation Id + /// ManagedClusterVersion_ListByEnvironment + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// + /// The location for the cluster code versions. This is different from cluster location. + /// The operating system of the cluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetManagedClusterVersionsByEnvironment(string location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(location, nameof(location)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterVersionRestClient.CreateListByEnvironmentRequest(Id.SubscriptionId, location, environment); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(e), ManagedClusterVersionClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersionsByEnvironment", "", null, cancellationToken); + } + + /// + /// Get unsupported vm size for Service Fabric Managed Clusters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes/{vmSize} + /// + /// + /// Operation Id + /// ManagedUnsupportedVMSizes_GetManagedUnsupportedVmSize + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// + /// The location for the cluster code versions. This is different from cluster location. + /// VM Size name. + /// The cancellation token to use. + /// or is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> GetManagedUnsupportedVmSizeAsync(string location, string vmSize, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(location, nameof(location)); + Argument.AssertNotNullOrEmpty(vmSize, nameof(vmSize)); + + using var scope = ManagedUnsupportedVMSizesClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetManagedUnsupportedVmSize"); scope.Start(); try { - var response = await ManagedClusterVersionRestClient.GetByEnvironmentAsync(Id.SubscriptionId, location, environment, clusterVersion, cancellationToken).ConfigureAwait(false); + var response = await ManagedUnsupportedVMSizesRestClient.GetManagedUnsupportedVmSizeAsync(Id.SubscriptionId, location, vmSize, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -232,37 +388,37 @@ public virtual async Task> GetManag } /// - /// Gets information about an available Service Fabric cluster code version by environment. + /// Get unsupported vm size for Service Fabric Managed Clusters. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions/{clusterVersion} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes/{vmSize} /// /// /// Operation Id - /// ManagedClusterVersion_GetByEnvironment + /// ManagedUnsupportedVMSizes_GetManagedUnsupportedVmSize /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// The location for the cluster code versions. This is different from cluster location. - /// The operating system of the cluster. The default means all. - /// The cluster code version. + /// VM Size name. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetManagedClusterVersionByEnvironment(AzureLocation location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) + /// or is an empty string, and was expected to be non-empty. + /// or is null. + public virtual Response GetManagedUnsupportedVmSize(string location, string vmSize, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); + Argument.AssertNotNullOrEmpty(vmSize, nameof(vmSize)); - using var scope = ManagedClusterVersionClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersionByEnvironment"); + using var scope = ManagedUnsupportedVMSizesClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetManagedUnsupportedVmSize"); scope.Start(); try { - var response = ManagedClusterVersionRestClient.GetByEnvironment(Id.SubscriptionId, location, environment, clusterVersion, cancellationToken); + var response = ManagedUnsupportedVMSizesRestClient.GetManagedUnsupportedVmSize(Id.SubscriptionId, location, vmSize, cancellationToken); return response; } catch (Exception e) @@ -273,196 +429,246 @@ public virtual Response GetManagedClusterVer } /// - /// Gets all available code versions for Service Fabric cluster resources by location. + /// Get the lists of unsupported vm sizes for Service Fabric Managed Clusters. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes /// /// /// Operation Id - /// ManagedClusterVersion_List + /// ManagedUnsupportedVMSizes_GetManagedUnsupportedVmSizes /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// The location for the cluster code versions. This is different from cluster location. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetManagedClusterVersionsAsync(AzureLocation location, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetManagedUnsupportedVmSizesAsync(string location, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterVersionRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(e), ManagedClusterVersionClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersions", "", null, cancellationToken); + Argument.AssertNotNullOrEmpty(location, nameof(location)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedUnsupportedVMSizesRestClient.CreateGetManagedUnsupportedVmSizesRequest(Id.SubscriptionId, location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedUnsupportedVMSizesRestClient.CreateGetManagedUnsupportedVmSizesNextPageRequest(nextLink, Id.SubscriptionId, location); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ServiceFabricManagedUnsupportedVmSize.DeserializeServiceFabricManagedUnsupportedVmSize(e), ManagedUnsupportedVMSizesClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetManagedUnsupportedVmSizes", "value", "nextLink", cancellationToken); } /// - /// Gets all available code versions for Service Fabric cluster resources by location. + /// Get the lists of unsupported vm sizes for Service Fabric Managed Clusters. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes /// /// /// Operation Id - /// ManagedClusterVersion_List + /// ManagedUnsupportedVMSizes_GetManagedUnsupportedVmSizes /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// The location for the cluster code versions. This is different from cluster location. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetManagedClusterVersions(AzureLocation location, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetManagedUnsupportedVmSizes(string location, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterVersionRestClient.CreateListRequest(Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(e), ManagedClusterVersionClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersions", "", null, cancellationToken); + Argument.AssertNotNullOrEmpty(location, nameof(location)); + + HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedUnsupportedVMSizesRestClient.CreateGetManagedUnsupportedVmSizesRequest(Id.SubscriptionId, location); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ManagedUnsupportedVMSizesRestClient.CreateGetManagedUnsupportedVmSizesNextPageRequest(nextLink, Id.SubscriptionId, location); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ServiceFabricManagedUnsupportedVmSize.DeserializeServiceFabricManagedUnsupportedVmSize(e), ManagedUnsupportedVMSizesClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetManagedUnsupportedVmSizes", "value", "nextLink", cancellationToken); } /// - /// Gets all available code versions for Service Fabric cluster resources by environment. + /// Gets all Service Fabric cluster resources created or in the process of being created in the subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters /// /// /// Operation Id - /// ManagedClusterVersion_ListByEnvironment + /// ManagedCluster_ListBySubscription /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview + /// + /// + /// Resource + /// /// /// /// - /// The location for the cluster code versions. This is different from cluster location. - /// The operating system of the cluster. The default means all. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetManagedClusterVersionsByEnvironmentAsync(AzureLocation location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetServiceFabricManagedClustersAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterVersionRestClient.CreateListByEnvironmentRequest(Id.SubscriptionId, location, environment); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, null, e => ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(e), ManagedClusterVersionClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersionsByEnvironment", "", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceFabricManagedClusterManagedClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceFabricManagedClusterManagedClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new ServiceFabricManagedClusterResource(Client, ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(e)), ServiceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetServiceFabricManagedClusters", "value", "nextLink", cancellationToken); } /// - /// Gets all available code versions for Service Fabric cluster resources by environment. + /// Gets all Service Fabric cluster resources created or in the process of being created in the subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters /// /// /// Operation Id - /// ManagedClusterVersion_ListByEnvironment + /// ManagedCluster_ListBySubscription /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview + /// + /// + /// Resource + /// /// /// /// - /// The location for the cluster code versions. This is different from cluster location. - /// The operating system of the cluster. The default means all. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetManagedClusterVersionsByEnvironment(AzureLocation location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetServiceFabricManagedClusters(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => ManagedClusterVersionRestClient.CreateListByEnvironmentRequest(Id.SubscriptionId, location, environment); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, null, e => ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(e), ManagedClusterVersionClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetManagedClusterVersionsByEnvironment", "", null, cancellationToken); + HttpMessage FirstPageRequest(int? pageSizeHint) => ServiceFabricManagedClusterManagedClustersRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => ServiceFabricManagedClusterManagedClustersRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new ServiceFabricManagedClusterResource(Client, ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(e)), ServiceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetServiceFabricManagedClusters", "value", "nextLink", cancellationToken); } /// - /// Get the lists of unsupported vm sizes for Service Fabric Managed Clusters. + /// Get long running operation result. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterOperationResults/{operationId} /// /// /// Operation Id - /// managedUnsupportedVMSizes_List + /// OperationResults_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// - /// The location for the cluster code versions. This is different from cluster location. + /// if the method should wait to return until the long-running operation has completed on the 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 Azure region. + /// operation identifier. /// The cancellation token to use. - /// An async collection of that may take multiple service requests to iterate over. - public virtual AsyncPageable GetManagedUnsupportedVmSizesAsync(AzureLocation location, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task GetOperationResultAsync(WaitUntil waitUntil, AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => managedUnsupportedVMSizesRestClient.CreateListRequest(Id.SubscriptionId, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => managedUnsupportedVMSizesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => ServiceFabricManagedUnsupportedVmSize.DeserializeServiceFabricManagedUnsupportedVmSize(e), managedUnsupportedVMSizesClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetManagedUnsupportedVmSizes", "value", "nextLink", cancellationToken); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = OperationResultsClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetOperationResult"); + scope.Start(); + try + { + var response = await OperationResultsRestClient.GetAsync(Id.SubscriptionId, location, operationId, cancellationToken).ConfigureAwait(false); + var operation = new ServiceFabricManagedClustersArmOperation(OperationResultsClientDiagnostics, Pipeline, OperationResultsRestClient.CreateGetRequest(Id.SubscriptionId, location, operationId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// - /// Get the lists of unsupported vm sizes for Service Fabric Managed Clusters. + /// Get long running operation result. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterOperationResults/{operationId} /// /// /// Operation Id - /// managedUnsupportedVMSizes_List + /// OperationResults_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// - /// The location for the cluster code versions. This is different from cluster location. + /// if the method should wait to return until the long-running operation has completed on the 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 Azure region. + /// operation identifier. /// The cancellation token to use. - /// A collection of that may take multiple service requests to iterate over. - public virtual Pageable GetManagedUnsupportedVmSizes(AzureLocation location, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual ArmOperation GetOperationResult(WaitUntil waitUntil, AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => managedUnsupportedVMSizesRestClient.CreateListRequest(Id.SubscriptionId, location); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => managedUnsupportedVMSizesRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, location); - return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => ServiceFabricManagedUnsupportedVmSize.DeserializeServiceFabricManagedUnsupportedVmSize(e), managedUnsupportedVMSizesClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersSubscriptionResource.GetManagedUnsupportedVmSizes", "value", "nextLink", cancellationToken); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var scope = OperationResultsClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetOperationResult"); + scope.Start(); + try + { + var response = OperationResultsRestClient.Get(Id.SubscriptionId, location, operationId, cancellationToken); + var operation = new ServiceFabricManagedClustersArmOperation(OperationResultsClientDiagnostics, Pipeline, OperationResultsRestClient.CreateGetRequest(Id.SubscriptionId, location, operationId).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } } /// - /// Get unsupported vm size for Service Fabric Managed Clusters. + /// Get long running operation status. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes/{vmSize} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterOperations/{operationId} /// /// /// Operation Id - /// managedUnsupportedVMSizes_Get + /// OperationStatus_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// - /// The location for the cluster code versions. This is different from cluster location. - /// VM Size name. + /// The name of the Azure region. + /// operation identifier. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual async Task> GetManagedUnsupportedVmSizeAsync(AzureLocation location, string vmSize, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetOperationStatuAsync(AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vmSize, nameof(vmSize)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - using var scope = managedUnsupportedVMSizesClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetManagedUnsupportedVmSize"); + using var scope = OperationStatusClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetOperationStatu"); scope.Start(); try { - var response = await managedUnsupportedVMSizesRestClient.GetAsync(Id.SubscriptionId, location, vmSize, cancellationToken).ConfigureAwait(false); + var response = await OperationStatusRestClient.GetAsync(Id.SubscriptionId, location, operationId, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -473,36 +679,36 @@ public virtual async Task> GetMa } /// - /// Get unsupported vm size for Service Fabric Managed Clusters. + /// Get long running operation status. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes/{vmSize} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterOperations/{operationId} /// /// /// Operation Id - /// managedUnsupportedVMSizes_Get + /// OperationStatus_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// - /// The location for the cluster code versions. This is different from cluster location. - /// VM Size name. + /// The name of the Azure region. + /// operation identifier. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// is null. - public virtual Response GetManagedUnsupportedVmSize(AzureLocation location, string vmSize, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response GetOperationStatu(AzureLocation location, string operationId, CancellationToken cancellationToken = default) { - Argument.AssertNotNullOrEmpty(vmSize, nameof(vmSize)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); - using var scope = managedUnsupportedVMSizesClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetManagedUnsupportedVmSize"); + using var scope = OperationStatusClientDiagnostics.CreateScope("MockableServiceFabricManagedClustersSubscriptionResource.GetOperationStatu"); scope.Start(); try { - var response = managedUnsupportedVMSizesRestClient.Get(Id.SubscriptionId, location, vmSize, cancellationToken); + var response = OperationStatusRestClient.Get(Id.SubscriptionId, location, operationId, cancellationToken); return response; } catch (Exception e) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersTenantResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersTenantResource.cs new file mode 100644 index 000000000000..7bc177363baf --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/MockableServiceFabricManagedClustersTenantResource.cs @@ -0,0 +1,95 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Threading; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.ServiceFabricManagedClusters.Models; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Mocking +{ + /// A class to add extension methods to TenantResource. + public partial class MockableServiceFabricManagedClustersTenantResource : ArmResource + { + private ClientDiagnostics _operationsClientDiagnostics; + private OperationsRestOperations _operationsRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableServiceFabricManagedClustersTenantResource() + { + } + + /// 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 MockableServiceFabricManagedClustersTenantResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics OperationsClientDiagnostics => _operationsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.ServiceFabricManagedClusters", ProviderConstants.DefaultProviderNamespace, Diagnostics); + private OperationsRestOperations OperationsRestClient => _operationsRestClient ??= new OperationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Get the list of available Service Fabric resource provider API operations. + /// + /// + /// Request Path + /// /providers/Microsoft.ServiceFabric/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetOperationsAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsRestClient.CreateListRequest(); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationsRestClient.CreateListNextPageRequest(nextLink); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => OperationResult.DeserializeOperationResult(e), OperationsClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersTenantResource.GetOperations", "value", "nextLink", cancellationToken); + } + + /// + /// Get the list of available Service Fabric resource provider API operations. + /// + /// + /// Request Path + /// /providers/Microsoft.ServiceFabric/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetOperations(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => OperationsRestClient.CreateListRequest(); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => OperationsRestClient.CreateListNextPageRequest(nextLink); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => OperationResult.DeserializeOperationResult(e), OperationsClientDiagnostics, Pipeline, "MockableServiceFabricManagedClustersTenantResource.GetOperations", "value", "nextLink", cancellationToken); + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersExtensions.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersExtensions.cs index b1d39a7ef13d..09898af6d981 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersExtensions.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Extensions/ServiceFabricManagedClustersExtensions.cs @@ -33,61 +33,66 @@ private static MockableServiceFabricManagedClustersSubscriptionResource GetMocka return resource.GetCachedClient(client => new MockableServiceFabricManagedClustersSubscriptionResource(client, resource.Id)); } + private static MockableServiceFabricManagedClustersTenantResource GetMockableServiceFabricManagedClustersTenantResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableServiceFabricManagedClustersTenantResource(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. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static ServiceFabricManagedApplicationTypeResource GetServiceFabricManagedApplicationTypeResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ServiceFabricManagedApplicationResource GetServiceFabricManagedApplicationResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableServiceFabricManagedClustersArmClient(client).GetServiceFabricManagedApplicationTypeResource(id); + return GetMockableServiceFabricManagedClustersArmClient(client).GetServiceFabricManagedApplicationResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static ServiceFabricManagedApplicationTypeVersionResource GetServiceFabricManagedApplicationTypeVersionResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ServiceFabricManagedApplicationTypeResource GetServiceFabricManagedApplicationTypeResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableServiceFabricManagedClustersArmClient(client).GetServiceFabricManagedApplicationTypeVersionResource(id); + return GetMockableServiceFabricManagedClustersArmClient(client).GetServiceFabricManagedApplicationTypeResource(id); } /// - /// Gets an object representing a along with the instance operations that can be performed on it but with no data. - /// You can use to create a from its components. + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The resource ID of the resource to get. /// is null. - /// Returns a object. - public static ServiceFabricManagedApplicationResource GetServiceFabricManagedApplicationResource(this ArmClient client, ResourceIdentifier id) + /// Returns a object. + public static ServiceFabricManagedApplicationTypeVersionResource GetServiceFabricManagedApplicationTypeVersionResource(this ArmClient client, ResourceIdentifier id) { Argument.AssertNotNull(client, nameof(client)); - return GetMockableServiceFabricManagedClustersArmClient(client).GetServiceFabricManagedApplicationResource(id); + return GetMockableServiceFabricManagedClustersArmClient(client).GetServiceFabricManagedApplicationTypeVersionResource(id); } /// @@ -173,11 +178,11 @@ public static ServiceFabricManagedClusterCollection GetServiceFabricManagedClust /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -211,11 +216,11 @@ public static async Task> GetServi /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -241,143 +246,139 @@ public static Response GetServiceFabricMana } /// - /// Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + /// Gets information about an available Service Fabric managed cluster code version. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions/{clusterVersion} /// /// /// Operation Id - /// ManagedClusters_ListBySubscription + /// ManagedClusterVersion_Get /// /// /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// + /// 2025-03-01-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. + /// The location for the cluster code versions. This is different from cluster location. + /// The cluster code version. /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetServiceFabricManagedClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is an empty string, and was expected to be non-empty. + /// , or is null. + public static async Task> GetManagedClusterVersionAsync(this SubscriptionResource subscriptionResource, string location, string clusterVersion, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetServiceFabricManagedClustersAsync(cancellationToken); + return await GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedClusterVersionAsync(location, clusterVersion, cancellationToken).ConfigureAwait(false); } /// - /// Gets all Service Fabric cluster resources created or in the process of being created in the subscription. + /// Gets information about an available Service Fabric managed cluster code version. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions/{clusterVersion} /// /// /// Operation Id - /// ManagedClusters_ListBySubscription + /// ManagedClusterVersion_Get /// /// /// Default Api Version - /// 2024-09-01-preview - /// - /// - /// Resource - /// + /// 2025-03-01-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. + /// The location for the cluster code versions. This is different from cluster location. + /// The cluster code version. /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetServiceFabricManagedClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + /// or is an empty string, and was expected to be non-empty. + /// , or is null. + public static Response GetManagedClusterVersion(this SubscriptionResource subscriptionResource, string location, string clusterVersion, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetServiceFabricManagedClusters(cancellationToken); + return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedClusterVersion(location, clusterVersion, cancellationToken); } /// - /// Gets information about an available Service Fabric managed cluster code version. + /// Gets all available code versions for Service Fabric cluster resources by location. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions/{clusterVersion} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions /// /// /// Operation Id - /// ManagedClusterVersion_Get + /// ManagedClusterVersion_List /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. - /// The cluster code version. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public static async Task> GetManagedClusterVersionAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string clusterVersion, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// or is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetManagedClusterVersionsAsync(this SubscriptionResource subscriptionResource, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedClusterVersionAsync(location, clusterVersion, cancellationToken).ConfigureAwait(false); + return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedClusterVersionsAsync(location, cancellationToken); } /// - /// Gets information about an available Service Fabric managed cluster code version. + /// Gets all available code versions for Service Fabric cluster resources by location. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions/{clusterVersion} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions /// /// /// Operation Id - /// ManagedClusterVersion_Get + /// ManagedClusterVersion_List /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. - /// The cluster code version. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public static Response GetManagedClusterVersion(this SubscriptionResource subscriptionResource, AzureLocation location, string clusterVersion, CancellationToken cancellationToken = default) + /// is an empty string, and was expected to be non-empty. + /// or is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetManagedClusterVersions(this SubscriptionResource subscriptionResource, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedClusterVersion(location, clusterVersion, cancellationToken); + return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedClusterVersions(location, cancellationToken); } /// @@ -389,26 +390,26 @@ public static Response GetManagedClusterVers /// /// /// Operation Id - /// ManagedClusterVersion_GetByEnvironment + /// ManagedClusterVersion_GetManagedClusterVersionByEnvironment /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. - /// The operating system of the cluster. The default means all. + /// The operating system of the cluster. /// The cluster code version. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public static async Task> GetManagedClusterVersionByEnvironmentAsync(this SubscriptionResource subscriptionResource, AzureLocation location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) + /// or is an empty string, and was expected to be non-empty. + /// , or is null. + public static async Task> GetManagedClusterVersionByEnvironmentAsync(this SubscriptionResource subscriptionResource, string location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -424,26 +425,26 @@ public static async Task> GetManage /// /// /// Operation Id - /// ManagedClusterVersion_GetByEnvironment + /// ManagedClusterVersion_GetManagedClusterVersionByEnvironment /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. - /// The operating system of the cluster. The default means all. + /// The operating system of the cluster. /// The cluster code version. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public static Response GetManagedClusterVersionByEnvironment(this SubscriptionResource subscriptionResource, AzureLocation location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) + /// or is an empty string, and was expected to be non-empty. + /// , or is null. + public static Response GetManagedClusterVersionByEnvironment(this SubscriptionResource subscriptionResource, string location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -451,137 +452,141 @@ public static Response GetManagedClusterVers } /// - /// Gets all available code versions for Service Fabric cluster resources by location. + /// Gets all available code versions for Service Fabric cluster resources by environment. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions /// /// /// Operation Id - /// ManagedClusterVersion_List + /// ManagedClusterVersion_ListByEnvironment /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. + /// The operating system of the cluster. /// The cancellation token to use. - /// is null. + /// is an empty string, and was expected to be non-empty. + /// or is null. /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetManagedClusterVersionsAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) + public static AsyncPageable GetManagedClusterVersionsByEnvironmentAsync(this SubscriptionResource subscriptionResource, string location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedClusterVersionsAsync(location, cancellationToken); + return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedClusterVersionsByEnvironmentAsync(location, environment, cancellationToken); } /// - /// Gets all available code versions for Service Fabric cluster resources by location. + /// Gets all available code versions for Service Fabric cluster resources by environment. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions /// /// /// Operation Id - /// ManagedClusterVersion_List + /// ManagedClusterVersion_ListByEnvironment /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. + /// The operating system of the cluster. /// The cancellation token to use. - /// is null. + /// is an empty string, and was expected to be non-empty. + /// or is null. /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetManagedClusterVersions(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) + public static Pageable GetManagedClusterVersionsByEnvironment(this SubscriptionResource subscriptionResource, string location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedClusterVersions(location, cancellationToken); + return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedClusterVersionsByEnvironment(location, environment, cancellationToken); } /// - /// Gets all available code versions for Service Fabric cluster resources by environment. + /// Get unsupported vm size for Service Fabric Managed Clusters. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes/{vmSize} /// /// /// Operation Id - /// ManagedClusterVersion_ListByEnvironment + /// ManagedUnsupportedVMSizes_GetManagedUnsupportedVmSize /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. - /// The operating system of the cluster. The default means all. + /// VM Size name. /// The cancellation token to use. - /// is null. - /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetManagedClusterVersionsByEnvironmentAsync(this SubscriptionResource subscriptionResource, AzureLocation location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) + /// or is an empty string, and was expected to be non-empty. + /// , or is null. + public static async Task> GetManagedUnsupportedVmSizeAsync(this SubscriptionResource subscriptionResource, string location, string vmSize, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedClusterVersionsByEnvironmentAsync(location, environment, cancellationToken); + return await GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedUnsupportedVmSizeAsync(location, vmSize, cancellationToken).ConfigureAwait(false); } /// - /// Gets all available code versions for Service Fabric cluster resources by environment. + /// Get unsupported vm size for Service Fabric Managed Clusters. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes/{vmSize} /// /// /// Operation Id - /// ManagedClusterVersion_ListByEnvironment + /// ManagedUnsupportedVMSizes_GetManagedUnsupportedVmSize /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. - /// The operating system of the cluster. The default means all. + /// VM Size name. /// The cancellation token to use. - /// is null. - /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetManagedClusterVersionsByEnvironment(this SubscriptionResource subscriptionResource, AzureLocation location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) + /// or is an empty string, and was expected to be non-empty. + /// , or is null. + public static Response GetManagedUnsupportedVmSize(this SubscriptionResource subscriptionResource, string location, string vmSize, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedClusterVersionsByEnvironment(location, environment, cancellationToken); + return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedUnsupportedVmSize(location, vmSize, cancellationToken); } /// @@ -593,24 +598,25 @@ public static Pageable GetManagedClusterVers /// /// /// Operation Id - /// managedUnsupportedVMSizes_List + /// ManagedUnsupportedVMSizes_GetManagedUnsupportedVmSizes /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. /// The cancellation token to use. - /// is null. + /// is an empty string, and was expected to be non-empty. + /// or is null. /// An async collection of that may take multiple service requests to iterate over. - public static AsyncPageable GetManagedUnsupportedVmSizesAsync(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) + public static AsyncPageable GetManagedUnsupportedVmSizesAsync(this SubscriptionResource subscriptionResource, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -626,24 +632,25 @@ public static AsyncPageable GetManagedUns /// /// /// Operation Id - /// managedUnsupportedVMSizes_List + /// ManagedUnsupportedVMSizes_GetManagedUnsupportedVmSizes /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. /// The location for the cluster code versions. This is different from cluster location. /// The cancellation token to use. - /// is null. + /// is an empty string, and was expected to be non-empty. + /// or is null. /// A collection of that may take multiple service requests to iterate over. - public static Pageable GetManagedUnsupportedVmSizes(this SubscriptionResource subscriptionResource, AzureLocation location, CancellationToken cancellationToken = default) + public static Pageable GetManagedUnsupportedVmSizes(this SubscriptionResource subscriptionResource, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); @@ -651,71 +658,277 @@ public static Pageable GetManagedUnsuppor } /// - /// Get unsupported vm size for Service Fabric Managed Clusters. + /// Gets all Service Fabric cluster resources created or in the process of being created in the subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes/{vmSize} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters /// /// /// Operation Id - /// managedUnsupportedVMSizes_Get + /// ManagedCluster_ListBySubscription /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview + /// + /// + /// Resource + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The location for the cluster code versions. This is different from cluster location. - /// VM Size name. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public static async Task> GetManagedUnsupportedVmSizeAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string vmSize, CancellationToken cancellationToken = default) + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetServiceFabricManagedClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return await GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedUnsupportedVmSizeAsync(location, vmSize, cancellationToken).ConfigureAwait(false); + return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetServiceFabricManagedClustersAsync(cancellationToken); } /// - /// Get unsupported vm size for Service Fabric Managed Clusters. + /// Gets all Service Fabric cluster resources created or in the process of being created in the subscription. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes/{vmSize} + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/managedClusters /// /// /// Operation Id - /// managedUnsupportedVMSizes_Get + /// ManagedCluster_ListBySubscription /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview + /// + /// + /// Resource + /// /// /// /// /// Mocking - /// To mock this method, please mock instead. + /// To mock this method, please mock instead. /// /// /// The instance the method will execute against. - /// The location for the cluster code versions. This is different from cluster location. - /// VM Size name. /// The cancellation token to use. - /// is an empty string, and was expected to be non-empty. - /// or is null. - public static Response GetManagedUnsupportedVmSize(this SubscriptionResource subscriptionResource, AzureLocation location, string vmSize, CancellationToken cancellationToken = default) + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetServiceFabricManagedClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) { Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); - return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetManagedUnsupportedVmSize(location, vmSize, cancellationToken); + return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetServiceFabricManagedClusters(cancellationToken); + } + + /// + /// Get long running operation result. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterOperationResults/{operationId} + /// + /// + /// Operation Id + /// OperationResults_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// if the method should wait to return until the long-running operation has completed on the 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 Azure region. + /// operation identifier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static async Task GetOperationResultAsync(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetOperationResultAsync(waitUntil, location, operationId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get long running operation result. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterOperationResults/{operationId} + /// + /// + /// Operation Id + /// OperationResults_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// if the method should wait to return until the long-running operation has completed on the 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 Azure region. + /// operation identifier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static ArmOperation GetOperationResult(this SubscriptionResource subscriptionResource, WaitUntil waitUntil, AzureLocation location, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetOperationResult(waitUntil, location, operationId, cancellationToken); + } + + /// + /// Get long running operation status. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterOperations/{operationId} + /// + /// + /// Operation Id + /// OperationStatus_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// operation identifier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static async Task> GetOperationStatuAsync(this SubscriptionResource subscriptionResource, AzureLocation location, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetOperationStatuAsync(location, operationId, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get long running operation status. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterOperations/{operationId} + /// + /// + /// Operation Id + /// OperationStatus_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// operation identifier. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public static Response GetOperationStatu(this SubscriptionResource subscriptionResource, AzureLocation location, string operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableServiceFabricManagedClustersSubscriptionResource(subscriptionResource).GetOperationStatu(location, operationId, cancellationToken); + } + + /// + /// Get the list of available Service Fabric resource provider API operations. + /// + /// + /// Request Path + /// /providers/Microsoft.ServiceFabric/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// + /// 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 GetOperationsAsync(this TenantResource tenantResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableServiceFabricManagedClustersTenantResource(tenantResource).GetOperationsAsync(cancellationToken); + } + + /// + /// Get the list of available Service Fabric resource provider API operations. + /// + /// + /// Request Path + /// /providers/Microsoft.ServiceFabric/operations + /// + /// + /// Operation Id + /// Operations_List + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// + /// 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 GetOperations(this TenantResource tenantResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tenantResource, nameof(tenantResource)); + + return GetMockableServiceFabricManagedClustersTenantResource(tenantResource).GetOperations(cancellationToken); } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/LongRunningOperation/FaultSimulationOperationSource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/LongRunningOperation/FaultSimulationOperationSource.cs new file mode 100644 index 000000000000..e9a9751cd1f7 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/LongRunningOperation/FaultSimulationOperationSource.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.ServiceFabricManagedClusters.Models; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters +{ + internal class FaultSimulationOperationSource : IOperationSource + { + FaultSimulation IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return FaultSimulation.DeserializeFaultSimulation(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return FaultSimulation.DeserializeFaultSimulation(document.RootElement); + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationHealthPolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationHealthPolicy.cs index 0b0ba5080f67..88e8a494d8e7 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationHealthPolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationHealthPolicy.cs @@ -10,10 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// - /// Defines a health policy used to evaluate the health of an application or one of its children entities. - /// - /// + /// Defines a health policy used to evaluate the health of an application or one of its children entities. public partial class ApplicationHealthPolicy { /// @@ -55,7 +52,6 @@ public partial class ApplicationHealthPolicy /// The percentage represents the maximum tolerated percentage of deployed applications that can be unhealthy before the application is considered in error. /// This is calculated by dividing the number of unhealthy deployed applications over the number of nodes where the application is currently deployed on in the cluster. /// The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. - /// /// public ApplicationHealthPolicy(bool considerWarningAsError, int maxPercentUnhealthyDeployedApplications) { @@ -71,7 +67,6 @@ public ApplicationHealthPolicy(bool considerWarningAsError, int maxPercentUnheal /// The percentage represents the maximum tolerated percentage of deployed applications that can be unhealthy before the application is considered in error. /// This is calculated by dividing the number of unhealthy deployed applications over the number of nodes where the application is currently deployed on in the cluster. /// The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. - /// /// /// The health policy used by default to evaluate the health of a service type. /// The map with service type health policy per service type name. The map is empty by default. @@ -97,7 +92,6 @@ internal ApplicationHealthPolicy() /// The percentage represents the maximum tolerated percentage of deployed applications that can be unhealthy before the application is considered in error. /// This is calculated by dividing the number of unhealthy deployed applications over the number of nodes where the application is currently deployed on in the cluster. /// The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. - /// /// public int MaxPercentUnhealthyDeployedApplications { get; set; } /// The health policy used by default to evaluate the health of a service type. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationResourceList.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationResourceList.Serialization.cs index af6613777f88..908ad2678253 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationResourceList.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationResourceList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ApplicationResourceList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static ApplicationResourceList DeserializeApplicationResourceList(JsonE return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static ApplicationResourceList DeserializeApplicationResourceList(JsonE } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static ApplicationResourceList DeserializeApplicationResourceList(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new ApplicationResourceList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ApplicationResourceList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationResourceList.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationResourceList.cs index c2006414888b..d6bf1805149c 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationResourceList.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationResourceList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { @@ -46,25 +47,34 @@ internal partial class ApplicationResourceList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ApplicationResourceList() + /// The ApplicationResource items on this page. + /// is null. + internal ApplicationResourceList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// - /// URL to get the next set of application list results if there are any. + /// The ApplicationResource items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ApplicationResourceList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ApplicationResourceList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the value. + /// Initializes a new instance of for deserialization. + internal ApplicationResourceList() + { + } + + /// The ApplicationResource items on this page. public IReadOnlyList Value { get; } - /// URL to get the next set of application list results if there are any. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeResourceList.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeResourceList.Serialization.cs index 235a3b2b85cf..580e0318aa7b 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeResourceList.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeResourceList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ApplicationTypeResourceList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static ApplicationTypeResourceList DeserializeApplicationTypeResourceLi return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static ApplicationTypeResourceList DeserializeApplicationTypeResourceLi } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static ApplicationTypeResourceList DeserializeApplicationTypeResourceLi } } serializedAdditionalRawData = rawDataDictionary; - return new ApplicationTypeResourceList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ApplicationTypeResourceList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeResourceList.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeResourceList.cs index 8bb6ce5c8b54..ef7788b40987 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeResourceList.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeResourceList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { @@ -46,25 +47,34 @@ internal partial class ApplicationTypeResourceList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ApplicationTypeResourceList() + /// The ApplicationTypeResource items on this page. + /// is null. + internal ApplicationTypeResourceList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// - /// URL to get the next set of application type list results if there are any. + /// The ApplicationTypeResource items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ApplicationTypeResourceList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ApplicationTypeResourceList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the value. + /// Initializes a new instance of for deserialization. + internal ApplicationTypeResourceList() + { + } + + /// The ApplicationTypeResource items on this page. public IReadOnlyList Value { get; } - /// URL to get the next set of application type list results if there are any. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeVersionResourceList.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeVersionResourceList.Serialization.cs index c565f1f3f485..bf1cc74167f8 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeVersionResourceList.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeVersionResourceList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ApplicationTypeVersionResourceList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static ApplicationTypeVersionResourceList DeserializeApplicationTypeVer return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static ApplicationTypeVersionResourceList DeserializeApplicationTypeVer } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static ApplicationTypeVersionResourceList DeserializeApplicationTypeVer } } serializedAdditionalRawData = rawDataDictionary; - return new ApplicationTypeVersionResourceList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ApplicationTypeVersionResourceList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeVersionResourceList.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeVersionResourceList.cs index 8202979ab56e..000a5599ff4c 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeVersionResourceList.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationTypeVersionResourceList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { @@ -46,25 +47,34 @@ internal partial class ApplicationTypeVersionResourceList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ApplicationTypeVersionResourceList() + /// The ApplicationTypeVersionResource items on this page. + /// is null. + internal ApplicationTypeVersionResourceList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// - /// URL to get the next set of application type version list results if there are any. + /// The ApplicationTypeVersionResource items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ApplicationTypeVersionResourceList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ApplicationTypeVersionResourceList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the value. + /// Initializes a new instance of for deserialization. + internal ApplicationTypeVersionResourceList() + { + } + + /// The ApplicationTypeVersionResource items on this page. public IReadOnlyList Value { get; } - /// URL to get the next set of application type version list results if there are any. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationUpgradePolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationUpgradePolicy.cs index 224264e1cde7..0be771cf9a52 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationUpgradePolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationUpgradePolicy.cs @@ -51,15 +51,12 @@ public ApplicationUpgradePolicy() } /// Initializes a new instance of . - /// - /// Defines a health policy used to evaluate the health of an application or one of its children entities. - /// - /// + /// Defines a health policy used to evaluate the health of an application or one of its children entities. /// If true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). /// The policy used for monitoring the application upgrade. /// Duration in seconds, to wait before a stateless instance is closed, to allow the active requests to drain gracefully. This would be effective when the instance is closing during the application/cluster upgrade, only for those instances which have a non-zero delay duration configured in the service description. /// The mode used to monitor health during a rolling upgrade. The values are Monitored, and UnmonitoredAuto. - /// The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. Valid values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). + /// The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. Valid values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). Unit is in seconds. /// Determines whether the application should be recreated on update. If value=true, the rest of the upgrade policy parameters are not allowed. /// Keeps track of any properties unknown to the library. internal ApplicationUpgradePolicy(ApplicationHealthPolicy applicationHealthPolicy, bool? forceRestart, RollingUpgradeMonitoringPolicy rollingUpgradeMonitoringPolicy, long? instanceCloseDelayDurationInSeconds, RollingUpgradeMode? upgradeMode, long? upgradeReplicaSetCheckTimeout, bool? recreateApplication, IDictionary serializedAdditionalRawData) @@ -74,10 +71,7 @@ internal ApplicationUpgradePolicy(ApplicationHealthPolicy applicationHealthPolic _serializedAdditionalRawData = serializedAdditionalRawData; } - /// - /// Defines a health policy used to evaluate the health of an application or one of its children entities. - /// - /// + /// Defines a health policy used to evaluate the health of an application or one of its children entities. public ApplicationHealthPolicy ApplicationHealthPolicy { get; set; } /// If true, then processes are forcefully restarted during upgrade even when the code version has not changed (the upgrade only changes configuration or data). public bool? ForceRestart { get; set; } @@ -87,7 +81,7 @@ internal ApplicationUpgradePolicy(ApplicationHealthPolicy applicationHealthPolic public long? InstanceCloseDelayDurationInSeconds { get; set; } /// The mode used to monitor health during a rolling upgrade. The values are Monitored, and UnmonitoredAuto. public RollingUpgradeMode? UpgradeMode { get; set; } - /// The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. Valid values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). + /// The maximum amount of time to block processing of an upgrade domain and prevent loss of availability when there are unexpected issues. When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. The timeout is reset at the start of each upgrade domain. Valid values are between 0 and 42949672925 inclusive. (unsigned 32-bit integer). Unit is in seconds. public long? UpgradeReplicaSetCheckTimeout { get; set; } /// Determines whether the application should be recreated on update. If value=true, the rest of the upgrade policy parameters are not allowed. public bool? RecreateApplication { get; set; } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationUserAssignedIdentityInfo.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationUserAssignedIdentityInfo.cs index 66efeff0ee53..ad605312f365 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationUserAssignedIdentityInfo.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ApplicationUserAssignedIdentityInfo.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// The ApplicationUserAssignedIdentityInfo. + /// User assigned identity for the application. public partial class ApplicationUserAssignedIdentityInfo { /// diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs index 93ff5fa58442..6da34132f1cb 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AutoGeneratedDomainNameLabelScope.cs @@ -12,10 +12,9 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { /// /// This enum is the entrypoint to using a certificate from a public CA for your cluster. This property was introduced to solve the - /// domain squatting problem with new domains. A domain name will be generated in the following format: <clustername>.<hash>.<regionname>.<sfmcdomain>. + /// domain squatting problem with new domains. A domain name will be generated in the following format: {clustername}.{hash}.{regionname}.sfmcdomain. /// The hash portion comes from Azure DNS' Deterministic Name Library. The library creates a hash using the cluster's Tenant, Subscription, Resource Group /// and Resource Name using the AutoGeneratedDomainNameLabelScope/reuse policy chosen. - /// /// public readonly partial struct AutoGeneratedDomainNameLabelScope : IEquatable { diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AvailableOperationDisplay.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AvailableOperationDisplay.Serialization.cs new file mode 100644 index 000000000000..491042026763 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AvailableOperationDisplay.Serialization.cs @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + public partial class AvailableOperationDisplay : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(AvailableOperationDisplay)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Provider)) + { + writer.WritePropertyName("provider"u8); + writer.WriteStringValue(Provider); + } + if (Optional.IsDefined(Resource)) + { + writer.WritePropertyName("resource"u8); + writer.WriteStringValue(Resource); + } + if (Optional.IsDefined(Operation)) + { + writer.WritePropertyName("operation"u8); + writer.WriteStringValue(Operation); + } + if (Optional.IsDefined(Description)) + { + writer.WritePropertyName("description"u8); + writer.WriteStringValue(Description); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + AvailableOperationDisplay IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(AvailableOperationDisplay)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeAvailableOperationDisplay(document.RootElement, options); + } + + internal static AvailableOperationDisplay DeserializeAvailableOperationDisplay(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string provider = default; + string resource = default; + string operation = default; + string description = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("provider"u8)) + { + provider = property.Value.GetString(); + continue; + } + if (property.NameEquals("resource"u8)) + { + resource = property.Value.GetString(); + continue; + } + if (property.NameEquals("operation"u8)) + { + operation = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new AvailableOperationDisplay(provider, resource, operation, description, serializedAdditionalRawData); + } + + BinaryData 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(AvailableOperationDisplay)} does not support writing '{options.Format}' format."); + } + } + + AvailableOperationDisplay IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeAvailableOperationDisplay(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(AvailableOperationDisplay)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AvailableOperationDisplay.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AvailableOperationDisplay.cs new file mode 100644 index 000000000000..90c30a8bf761 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AvailableOperationDisplay.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.ServiceFabricManagedClusters.Models +{ + /// Operation supported by the Service Fabric resource provider. + public partial class AvailableOperationDisplay + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 AvailableOperationDisplay() + { + } + + /// Initializes a new instance of . + /// The name of the provider. + /// The resource on which the operation is performed. + /// The operation that can be performed. + /// Operation description. + /// Keeps track of any properties unknown to the library. + internal AvailableOperationDisplay(string provider, string resource, string operation, string description, IDictionary serializedAdditionalRawData) + { + Provider = provider; + Resource = resource; + Operation = operation; + Description = description; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the provider. + public string Provider { get; } + /// The resource on which the operation is performed. + public string Resource { get; } + /// The operation that can be performed. + public string Operation { get; } + /// Operation description. + public string Description { get; } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AveragePartitionLoadScalingTrigger.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AveragePartitionLoadScalingTrigger.cs index ba10a58b2cff..304e1f04a944 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AveragePartitionLoadScalingTrigger.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AveragePartitionLoadScalingTrigger.cs @@ -32,7 +32,7 @@ public AveragePartitionLoadScalingTrigger(string metricName, double lowerLoadThr } /// Initializes a new instance of . - /// Specifies the trigger associated with this scaling policy. + /// /// Keeps track of any properties unknown to the library. /// The name of the metric for which usage should be tracked. /// The lower limit of the load below which a scale in operation should be performed. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AverageServiceLoadScalingTrigger.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AverageServiceLoadScalingTrigger.cs index 65fc29202c26..7c55a5ab6347 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AverageServiceLoadScalingTrigger.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/AverageServiceLoadScalingTrigger.cs @@ -34,7 +34,7 @@ public AverageServiceLoadScalingTrigger(string metricName, double lowerLoadThres } /// Initializes a new instance of . - /// Specifies the trigger associated with this scaling policy. + /// /// Keeps track of any properties unknown to the library. /// The name of the metric for which usage should be tracked. /// The lower limit of the load below which a scale in operation should be performed. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ErrorModelError.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ErrorModelError.Serialization.cs new file mode 100644 index 000000000000..69a412a7e6a7 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ErrorModelError.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.ServiceFabricManagedClusters.Models +{ + public partial class ErrorModelError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ErrorModelError)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ErrorModelError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ErrorModelError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeErrorModelError(document.RootElement, options); + } + + internal static ErrorModelError DeserializeErrorModelError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string message = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ErrorModelError(code, message, serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ErrorModelError)} does not support writing '{options.Format}' format."); + } + } + + ErrorModelError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeErrorModelError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ErrorModelError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ErrorModelError.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ErrorModelError.cs new file mode 100644 index 000000000000..3d62abcb027d --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ErrorModelError.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.ServiceFabricManagedClusters.Models +{ + /// The error details. + public partial class ErrorModelError + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ErrorModelError() + { + } + + /// Initializes a new instance of . + /// The error code. + /// The error message. + /// Keeps track of any properties unknown to the library. + internal ErrorModelError(string code, string message, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The error code. + public string Code { get; } + /// The error message. + public string Message { get; } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultKind.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultKind.cs new file mode 100644 index 000000000000..8e0c1fa700ea --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultKind.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.ServiceFabricManagedClusters.Models +{ + /// The kind of fault simulation. + internal readonly partial struct FaultKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FaultKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ZoneValue = "Zone"; + + /// Simulates an availability zone down. + public static FaultKind Zone { get; } = new FaultKind(ZoneValue); + /// Determines if two values are the same. + public static bool operator ==(FaultKind left, FaultKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FaultKind left, FaultKind right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FaultKind(string value) => new FaultKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FaultKind other && Equals(other); + /// + public bool Equals(FaultKind 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/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulation.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulation.Serialization.cs new file mode 100644 index 000000000000..1db896305f5c --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulation.Serialization.cs @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + public partial class FaultSimulation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FaultSimulation)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SimulationId)) + { + writer.WritePropertyName("simulationId"u8); + writer.WriteStringValue(SimulationId); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (Optional.IsDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteObjectValue(Details, 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 + } + } + } + + FaultSimulation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FaultSimulation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFaultSimulation(document.RootElement, options); + } + + internal static FaultSimulation DeserializeFaultSimulation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string simulationId = default; + FaultSimulationStatus? status = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + FaultSimulationDetails details = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("simulationId"u8)) + { + simulationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new FaultSimulationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + details = FaultSimulationDetails.DeserializeFaultSimulationDetails(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FaultSimulation( + simulationId, + status, + startTime, + endTime, + details, + serializedAdditionalRawData); + } + + BinaryData 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(FaultSimulation)} does not support writing '{options.Format}' format."); + } + } + + FaultSimulation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFaultSimulation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FaultSimulation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulation.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulation.cs new file mode 100644 index 000000000000..306e4bffee85 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulation.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.ServiceFabricManagedClusters.Models +{ + /// Fault simulation object with status. + public partial class FaultSimulation + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 FaultSimulation() + { + } + + /// Initializes a new instance of . + /// unique identifier for the fault simulation. + /// Fault simulation status. + /// The start time of the fault simulation. + /// The end time of the fault simulation. + /// Fault simulation details. + /// Keeps track of any properties unknown to the library. + internal FaultSimulation(string simulationId, FaultSimulationStatus? status, DateTimeOffset? startOn, DateTimeOffset? endOn, FaultSimulationDetails details, IDictionary serializedAdditionalRawData) + { + SimulationId = simulationId; + Status = status; + StartOn = startOn; + EndOn = endOn; + Details = details; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// unique identifier for the fault simulation. + public string SimulationId { get; } + /// Fault simulation status. + public FaultSimulationStatus? Status { get; } + /// The start time of the fault simulation. + public DateTimeOffset? StartOn { get; } + /// The end time of the fault simulation. + public DateTimeOffset? EndOn { get; } + /// Fault simulation details. + public FaultSimulationDetails Details { get; } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationConstraints.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationConstraints.Serialization.cs new file mode 100644 index 000000000000..d6b297222dc2 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationConstraints.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.ServiceFabricManagedClusters.Models +{ + internal partial class FaultSimulationConstraints : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FaultSimulationConstraints)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ExpireOn)) + { + writer.WritePropertyName("expirationTime"u8); + writer.WriteStringValue(ExpireOn.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 + } + } + } + + FaultSimulationConstraints IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FaultSimulationConstraints)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFaultSimulationConstraints(document.RootElement, options); + } + + internal static FaultSimulationConstraints DeserializeFaultSimulationConstraints(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DateTimeOffset? expirationTime = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("expirationTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + expirationTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FaultSimulationConstraints(expirationTime, serializedAdditionalRawData); + } + + BinaryData 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(FaultSimulationConstraints)} does not support writing '{options.Format}' format."); + } + } + + FaultSimulationConstraints IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFaultSimulationConstraints(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FaultSimulationConstraints)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationConstraints.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationConstraints.cs new file mode 100644 index 000000000000..56887869e7f1 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationConstraints.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.ServiceFabricManagedClusters.Models +{ + /// Constraints for Fault Simulation action. + internal partial class FaultSimulationConstraints + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 FaultSimulationConstraints() + { + } + + /// Initializes a new instance of . + /// The absolute expiration timestamp (UTC) after which this fault simulation should be stopped if it's still active. + /// Keeps track of any properties unknown to the library. + internal FaultSimulationConstraints(DateTimeOffset? expireOn, IDictionary serializedAdditionalRawData) + { + ExpireOn = expireOn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The absolute expiration timestamp (UTC) after which this fault simulation should be stopped if it's still active. + public DateTimeOffset? ExpireOn { get; set; } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContent.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContent.Serialization.cs new file mode 100644 index 000000000000..2e4c295c4a03 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContent.Serialization.cs @@ -0,0 +1,127 @@ +// 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.ServiceFabricManagedClusters.Models +{ + [PersistableModelProxy(typeof(UnknownFaultSimulationContent))] + public partial class FaultSimulationContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FaultSimulationContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("faultKind"u8); + writer.WriteStringValue(FaultKind.ToString()); + if (Optional.IsDefined(Force)) + { + writer.WritePropertyName("force"u8); + writer.WriteBooleanValue(Force.Value); + } + if (Optional.IsDefined(Constraints)) + { + writer.WritePropertyName("constraints"u8); + writer.WriteObjectValue(Constraints, 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 + } + } + } + + FaultSimulationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FaultSimulationContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFaultSimulationContent(document.RootElement, options); + } + + internal static FaultSimulationContent DeserializeFaultSimulationContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("faultKind", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Zone": return ZoneFaultSimulationContent.DeserializeZoneFaultSimulationContent(element, options); + } + } + return UnknownFaultSimulationContent.DeserializeUnknownFaultSimulationContent(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(FaultSimulationContent)} does not support writing '{options.Format}' format."); + } + } + + FaultSimulationContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFaultSimulationContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FaultSimulationContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContent.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContent.cs new file mode 100644 index 000000000000..089885f7f6cc --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContent.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; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + /// + /// Parameters for Fault Simulation action. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public abstract partial class FaultSimulationContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 FaultSimulationContent() + { + } + + /// Initializes a new instance of . + /// The kind of fault to be simulated. + /// Force the action to go through without any check on the cluster. + /// Constraints for Fault Simulation action. + /// Keeps track of any properties unknown to the library. + internal FaultSimulationContent(FaultKind faultKind, bool? force, FaultSimulationConstraints constraints, IDictionary serializedAdditionalRawData) + { + FaultKind = faultKind; + Force = force; + Constraints = constraints; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The kind of fault to be simulated. + internal FaultKind FaultKind { get; set; } + /// Force the action to go through without any check on the cluster. + public bool? Force { get; set; } + /// Constraints for Fault Simulation action. + internal FaultSimulationConstraints Constraints { get; set; } + /// The absolute expiration timestamp (UTC) after which this fault simulation should be stopped if it's still active. + public DateTimeOffset? ConstraintsExpireOn + { + get => Constraints is null ? default : Constraints.ExpireOn; + set + { + if (Constraints is null) + Constraints = new FaultSimulationConstraints(); + Constraints.ExpireOn = value; + } + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContentWrapper.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContentWrapper.Serialization.cs new file mode 100644 index 000000000000..c2ff135526fc --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContentWrapper.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.ServiceFabricManagedClusters.Models +{ + public partial class FaultSimulationContentWrapper : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FaultSimulationContentWrapper)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(Parameters, 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 + } + } + } + + FaultSimulationContentWrapper IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FaultSimulationContentWrapper)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFaultSimulationContentWrapper(document.RootElement, options); + } + + internal static FaultSimulationContentWrapper DeserializeFaultSimulationContentWrapper(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FaultSimulationContent parameters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("parameters"u8)) + { + parameters = FaultSimulationContent.DeserializeFaultSimulationContent(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FaultSimulationContentWrapper(parameters, serializedAdditionalRawData); + } + + BinaryData 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(FaultSimulationContentWrapper)} does not support writing '{options.Format}' format."); + } + } + + FaultSimulationContentWrapper IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFaultSimulationContentWrapper(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FaultSimulationContentWrapper)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContentWrapper.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContentWrapper.cs new file mode 100644 index 000000000000..a5a61e9492fe --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationContentWrapper.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + /// Fault Simulation Request for Start action. + public partial class FaultSimulationContentWrapper + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// + /// Parameters for Fault Simulation start action. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// is null. + public FaultSimulationContentWrapper(FaultSimulationContent parameters) + { + Argument.AssertNotNull(parameters, nameof(parameters)); + + Parameters = parameters; + } + + /// Initializes a new instance of . + /// + /// Parameters for Fault Simulation start action. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// Keeps track of any properties unknown to the library. + internal FaultSimulationContentWrapper(FaultSimulationContent parameters, IDictionary serializedAdditionalRawData) + { + Parameters = parameters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FaultSimulationContentWrapper() + { + } + + /// + /// Parameters for Fault Simulation start action. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public FaultSimulationContent Parameters { get; } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationDetails.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationDetails.Serialization.cs new file mode 100644 index 000000000000..7a01801fe888 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationDetails.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.ServiceFabricManagedClusters.Models +{ + public partial class FaultSimulationDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FaultSimulationDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ClusterId)) + { + writer.WritePropertyName("clusterId"u8); + writer.WriteStringValue(ClusterId); + } + if (Optional.IsDefined(OperationId)) + { + writer.WritePropertyName("operationId"u8); + writer.WriteStringValue(OperationId); + } + if (Optional.IsCollectionDefined(NodeTypeFaultSimulation)) + { + writer.WritePropertyName("nodeTypeFaultSimulation"u8); + writer.WriteStartArray(); + foreach (var item in NodeTypeFaultSimulation) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Parameters)) + { + writer.WritePropertyName("parameters"u8); + writer.WriteObjectValue(Parameters, 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 + } + } + } + + FaultSimulationDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FaultSimulationDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFaultSimulationDetails(document.RootElement, options); + } + + internal static FaultSimulationDetails DeserializeFaultSimulationDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string clusterId = default; + string operationId = default; + IReadOnlyList nodeTypeFaultSimulation = default; + FaultSimulationContent parameters = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("clusterId"u8)) + { + clusterId = property.Value.GetString(); + continue; + } + if (property.NameEquals("operationId"u8)) + { + operationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("nodeTypeFaultSimulation"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(Models.NodeTypeFaultSimulation.DeserializeNodeTypeFaultSimulation(item, options)); + } + nodeTypeFaultSimulation = array; + continue; + } + if (property.NameEquals("parameters"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + parameters = FaultSimulationContent.DeserializeFaultSimulationContent(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FaultSimulationDetails(clusterId, operationId, nodeTypeFaultSimulation ?? new ChangeTrackingList(), parameters, serializedAdditionalRawData); + } + + BinaryData 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(FaultSimulationDetails)} does not support writing '{options.Format}' format."); + } + } + + FaultSimulationDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFaultSimulationDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FaultSimulationDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationDetails.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationDetails.cs new file mode 100644 index 000000000000..cabc8681c0a7 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationDetails.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.ServiceFabricManagedClusters.Models +{ + /// Details for Fault Simulation. + public partial class FaultSimulationDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 FaultSimulationDetails() + { + NodeTypeFaultSimulation = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// unique identifier for the cluster resource. + /// unique identifier for the operation associated with the fault simulation. + /// List of node type simulations associated with the cluster fault simulation. + /// + /// Fault simulation parameters. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + /// Keeps track of any properties unknown to the library. + internal FaultSimulationDetails(string clusterId, string operationId, IReadOnlyList nodeTypeFaultSimulation, FaultSimulationContent parameters, IDictionary serializedAdditionalRawData) + { + ClusterId = clusterId; + OperationId = operationId; + NodeTypeFaultSimulation = nodeTypeFaultSimulation; + Parameters = parameters; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// unique identifier for the cluster resource. + public string ClusterId { get; } + /// unique identifier for the operation associated with the fault simulation. + public string OperationId { get; } + /// List of node type simulations associated with the cluster fault simulation. + public IReadOnlyList NodeTypeFaultSimulation { get; } + /// + /// Fault simulation parameters. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public FaultSimulationContent Parameters { get; } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationIdContent.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationIdContent.Serialization.cs new file mode 100644 index 000000000000..117a13ffbea8 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationIdContent.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.ServiceFabricManagedClusters.Models +{ + public partial class FaultSimulationIdContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FaultSimulationIdContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("simulationId"u8); + writer.WriteStringValue(SimulationId); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + FaultSimulationIdContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FaultSimulationIdContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFaultSimulationIdContent(document.RootElement, options); + } + + internal static FaultSimulationIdContent DeserializeFaultSimulationIdContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string simulationId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("simulationId"u8)) + { + simulationId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new FaultSimulationIdContent(simulationId, serializedAdditionalRawData); + } + + BinaryData 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(FaultSimulationIdContent)} does not support writing '{options.Format}' format."); + } + } + + FaultSimulationIdContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFaultSimulationIdContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FaultSimulationIdContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationIdContent.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationIdContent.cs new file mode 100644 index 000000000000..561082d66c8b --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationIdContent.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.ServiceFabricManagedClusters.Models +{ + /// Parameters for Fault Simulation id. + public partial class FaultSimulationIdContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// unique identifier for the fault simulation. + /// is null. + public FaultSimulationIdContent(string simulationId) + { + Argument.AssertNotNull(simulationId, nameof(simulationId)); + + SimulationId = simulationId; + } + + /// Initializes a new instance of . + /// unique identifier for the fault simulation. + /// Keeps track of any properties unknown to the library. + internal FaultSimulationIdContent(string simulationId, IDictionary serializedAdditionalRawData) + { + SimulationId = simulationId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FaultSimulationIdContent() + { + } + + /// unique identifier for the fault simulation. + public string SimulationId { get; } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationListResult.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationListResult.Serialization.cs new file mode 100644 index 000000000000..d04c1035b696 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationListResult.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.ServiceFabricManagedClusters.Models +{ + internal partial class FaultSimulationListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FaultSimulationListResult)} 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 + } + } + } + + FaultSimulationListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FaultSimulationListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFaultSimulationListResult(document.RootElement, options); + } + + internal static FaultSimulationListResult DeserializeFaultSimulationListResult(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(FaultSimulation.DeserializeFaultSimulation(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 FaultSimulationListResult(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(FaultSimulationListResult)} does not support writing '{options.Format}' format."); + } + } + + FaultSimulationListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFaultSimulationListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FaultSimulationListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationListResult.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationListResult.cs new file mode 100644 index 000000000000..f086a5d95071 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationListResult.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.ServiceFabricManagedClusters.Models +{ + /// Fault simulation list results. + internal partial class FaultSimulationListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 FaultSimulation items on this page. + /// is null. + internal FaultSimulationListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The FaultSimulation items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal FaultSimulationListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal FaultSimulationListResult() + { + } + + /// The FaultSimulation items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationStatus.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationStatus.cs new file mode 100644 index 000000000000..e5ab863f8fd3 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/FaultSimulationStatus.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.ServiceFabricManagedClusters.Models +{ + /// Fault simulation status. + public readonly partial struct FaultSimulationStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FaultSimulationStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StartingValue = "Starting"; + private const string ActiveValue = "Active"; + private const string StoppingValue = "Stopping"; + private const string DoneValue = "Done"; + private const string StartFailedValue = "StartFailed"; + private const string StopFailedValue = "StopFailed"; + + /// Indicates the fault simulation is starting. The simulation will have this status while the start operation is in progress. + public static FaultSimulationStatus Starting { get; } = new FaultSimulationStatus(StartingValue); + /// Indicates the fault simulation is active. The simulation will have this status after the start operation has completed successfully. + public static FaultSimulationStatus Active { get; } = new FaultSimulationStatus(ActiveValue); + /// Indicates the fault simulation is stopping. The simulation will have this status while the stop operation is in progress. + public static FaultSimulationStatus Stopping { get; } = new FaultSimulationStatus(StoppingValue); + /// Indicates the fault simulation is done. The simulation will have this status after the stop operation has completed successfully. + public static FaultSimulationStatus Done { get; } = new FaultSimulationStatus(DoneValue); + /// Indicates the fault simulation has failed on start. The simulation will have this status after the start operation fails. + public static FaultSimulationStatus StartFailed { get; } = new FaultSimulationStatus(StartFailedValue); + /// Indicates the fault simulation has failed on stop. The simulation will have this status after the stop operation fails. + public static FaultSimulationStatus StopFailed { get; } = new FaultSimulationStatus(StopFailedValue); + /// Determines if two values are the same. + public static bool operator ==(FaultSimulationStatus left, FaultSimulationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FaultSimulationStatus left, FaultSimulationStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FaultSimulationStatus(string value) => new FaultSimulationStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FaultSimulationStatus other && Equals(other); + /// + public bool Equals(FaultSimulationStatus 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/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/LongRunningOperationResult.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/LongRunningOperationResult.Serialization.cs new file mode 100644 index 000000000000..f59300332be3 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/LongRunningOperationResult.Serialization.cs @@ -0,0 +1,207 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + public partial class LongRunningOperationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(LongRunningOperationResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (Optional.IsDefined(PercentComplete)) + { + writer.WritePropertyName("percentComplete"u8); + writer.WriteNumberValue(PercentComplete.Value); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + writer.WriteObjectValue(Error, 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 + } + } + } + + LongRunningOperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LongRunningOperationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLongRunningOperationResult(document.RootElement, options); + } + + internal static LongRunningOperationResult DeserializeLongRunningOperationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + double? percentComplete = default; + string status = default; + ErrorModelError error = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("percentComplete"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentComplete = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = ErrorModelError.DeserializeErrorModelError(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LongRunningOperationResult( + name, + startTime, + endTime, + percentComplete, + status, + error, + serializedAdditionalRawData); + } + + BinaryData 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(LongRunningOperationResult)} does not support writing '{options.Format}' format."); + } + } + + LongRunningOperationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLongRunningOperationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LongRunningOperationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/LongRunningOperationResult.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/LongRunningOperationResult.cs new file mode 100644 index 000000000000..3a6f132168f8 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/LongRunningOperationResult.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + /// Long running operation result. + public partial class LongRunningOperationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 LongRunningOperationResult() + { + } + + /// Initializes a new instance of . + /// The name of the operation. + /// The start time of the operation. + /// The end time of the operation. + /// The completion percentage of the operation. + /// The status of the operation. + /// The operation error. + /// Keeps track of any properties unknown to the library. + internal LongRunningOperationResult(string name, DateTimeOffset? startOn, DateTimeOffset? endOn, double? percentComplete, string status, ErrorModelError error, IDictionary serializedAdditionalRawData) + { + Name = name; + StartOn = startOn; + EndOn = endOn; + PercentComplete = percentComplete; + Status = status; + Error = error; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the operation. + public string Name { get; } + /// The start time of the operation. + public DateTimeOffset? StartOn { get; } + /// The end time of the operation. + public DateTimeOffset? EndOn { get; } + /// The completion percentage of the operation. + public double? PercentComplete { get; } + /// The status of the operation. + public string Status { get; } + /// The operation error. + public ErrorModelError Error { get; } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterClientCertificate.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterClientCertificate.Serialization.cs index d3bbaa18dfd7..89da4f094dd1 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterClientCertificate.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterClientCertificate.Serialization.cs @@ -39,14 +39,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(Thumbprint)) { writer.WritePropertyName("thumbprint"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Thumbprint); -#else - using (JsonDocument document = JsonDocument.Parse(Thumbprint, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif + writer.WriteStringValue(Thumbprint); } if (Optional.IsDefined(CommonName)) { @@ -56,14 +49,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(IssuerThumbprint)) { writer.WritePropertyName("issuerThumbprint"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(IssuerThumbprint); -#else - using (JsonDocument document = JsonDocument.Parse(IssuerThumbprint, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif + writer.WriteStringValue(IssuerThumbprint); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -103,9 +89,9 @@ internal static ManagedClusterClientCertificate DeserializeManagedClusterClientC return null; } bool isAdmin = default; - BinaryData thumbprint = default; + string thumbprint = default; string commonName = default; - BinaryData issuerThumbprint = default; + string issuerThumbprint = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -117,11 +103,7 @@ internal static ManagedClusterClientCertificate DeserializeManagedClusterClientC } if (property.NameEquals("thumbprint"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - thumbprint = BinaryData.FromString(property.Value.GetRawText()); + thumbprint = property.Value.GetString(); continue; } if (property.NameEquals("commonName"u8)) @@ -131,11 +113,7 @@ internal static ManagedClusterClientCertificate DeserializeManagedClusterClientC } if (property.NameEquals("issuerThumbprint"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - issuerThumbprint = BinaryData.FromString(property.Value.GetRawText()); + issuerThumbprint = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterClientCertificate.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterClientCertificate.cs index e0e70c5efc45..1ca08a438202 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterClientCertificate.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterClientCertificate.cs @@ -58,7 +58,7 @@ public ManagedClusterClientCertificate(bool isAdmin) /// Certificate common name. /// Issuer thumbprint for the certificate. Only used together with CommonName. /// Keeps track of any properties unknown to the library. - internal ManagedClusterClientCertificate(bool isAdmin, BinaryData thumbprint, string commonName, BinaryData issuerThumbprint, IDictionary serializedAdditionalRawData) + internal ManagedClusterClientCertificate(bool isAdmin, string thumbprint, string commonName, string issuerThumbprint, IDictionary serializedAdditionalRawData) { IsAdmin = isAdmin; Thumbprint = thumbprint; @@ -74,69 +74,11 @@ internal ManagedClusterClientCertificate() /// Indicates if the client certificate has admin access to the cluster. Non admin clients can perform only read only operations on the cluster. public bool IsAdmin { get; set; } - /// - /// Certificate thumbprint. - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData Thumbprint { get; set; } + /// Certificate thumbprint. + public string Thumbprint { get; set; } /// Certificate common name. public string CommonName { get; set; } - /// - /// Issuer thumbprint for the certificate. Only used together with CommonName. - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData IssuerThumbprint { get; set; } + /// Issuer thumbprint for the certificate. Only used together with CommonName. + public string IssuerThumbprint { get; set; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterHealthPolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterHealthPolicy.cs index 1b1be8162594..b00a0fcb43b7 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterHealthPolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterHealthPolicy.cs @@ -10,10 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// - /// Defines a health policy used to evaluate the health of the cluster or of a cluster node. - /// - /// + /// Defines a health policy used to evaluate the health of the cluster or of a cluster node. public partial class ManagedClusterHealthPolicy { /// @@ -58,7 +55,6 @@ public partial class ManagedClusterHealthPolicy /// The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. /// /// In large clusters, some nodes will always be down or out for repairs, so this percentage should be configured to tolerate that. - /// /// /// /// The maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10. @@ -67,7 +63,6 @@ public partial class ManagedClusterHealthPolicy /// If the percentage is respected but there is at least one unhealthy application, the health is evaluated as Warning. /// This is calculated by dividing the number of unhealthy applications over the total number of application instances in the cluster, excluding applications of application types that are included in the ApplicationTypeHealthPolicyMap. /// The computation rounds up to tolerate one failure on small numbers of applications. Default percentage is zero. - /// /// public ManagedClusterHealthPolicy(int maxPercentUnhealthyNodes, int maxPercentUnhealthyApplications) { @@ -85,7 +80,6 @@ public ManagedClusterHealthPolicy(int maxPercentUnhealthyNodes, int maxPercentUn /// The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. /// /// In large clusters, some nodes will always be down or out for repairs, so this percentage should be configured to tolerate that. - /// /// /// /// The maximum allowed percentage of unhealthy applications before reporting an error. For example, to allow 10% of applications to be unhealthy, this value would be 10. @@ -94,7 +88,6 @@ public ManagedClusterHealthPolicy(int maxPercentUnhealthyNodes, int maxPercentUn /// If the percentage is respected but there is at least one unhealthy application, the health is evaluated as Warning. /// This is calculated by dividing the number of unhealthy applications over the total number of application instances in the cluster, excluding applications of application types that are included in the ApplicationTypeHealthPolicyMap. /// The computation rounds up to tolerate one failure on small numbers of applications. Default percentage is zero. - /// /// /// Keeps track of any properties unknown to the library. internal ManagedClusterHealthPolicy(int maxPercentUnhealthyNodes, int maxPercentUnhealthyApplications, IDictionary serializedAdditionalRawData) @@ -118,7 +111,6 @@ internal ManagedClusterHealthPolicy() /// The computation rounds up to tolerate one failure on small numbers of nodes. Default percentage is zero. /// /// In large clusters, some nodes will always be down or out for repairs, so this percentage should be configured to tolerate that. - /// /// public int MaxPercentUnhealthyNodes { get; set; } /// @@ -128,7 +120,6 @@ internal ManagedClusterHealthPolicy() /// If the percentage is respected but there is at least one unhealthy application, the health is evaluated as Warning. /// This is calculated by dividing the number of unhealthy applications over the total number of application instances in the cluster, excluding applications of application types that are included in the ApplicationTypeHealthPolicyMap. /// The computation rounds up to tolerate one failure on small numbers of applications. Default percentage is zero. - /// /// public int MaxPercentUnhealthyApplications { get; set; } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterListResult.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterListResult.Serialization.cs index 08c694e3823c..94e704203cb6 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterListResult.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterListResult.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ManagedClusterListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static ManagedClusterListResult DeserializeManagedClusterListResult(Jso return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static ManagedClusterListResult DeserializeManagedClusterListResult(Jso } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static ManagedClusterListResult DeserializeManagedClusterListResult(Jso } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ManagedClusterListResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterListResult.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterListResult.cs index d5dcf33c771a..d6bf08df3ab3 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterListResult.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterListResult.cs @@ -7,10 +7,11 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// Managed Cluster list results. + /// The response of a ManagedCluster list operation. internal partial class ManagedClusterListResult { /// @@ -46,25 +47,34 @@ internal partial class ManagedClusterListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ManagedClusterListResult() + /// The ManagedCluster items on this page. + /// is null. + internal ManagedClusterListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// - /// The URL to use for getting the next set of results. + /// The ManagedCluster items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ManagedClusterListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ManagedClusterListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the value. + /// Initializes a new instance of for deserialization. + internal ManagedClusterListResult() + { + } + + /// The ManagedCluster items on this page. public IReadOnlyList Value { get; } - /// The URL to use for getting the next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterLoadBalanceProbeProtocol.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterLoadBalanceProbeProtocol.cs index 51171890e958..e97fabee20af 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterLoadBalanceProbeProtocol.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterLoadBalanceProbeProtocol.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// the reference to the load balancer probe used by the load balancing rule. + /// The reference to the load balancer probe used by the load balancing rule. public readonly partial struct ManagedClusterLoadBalanceProbeProtocol : IEquatable { private readonly string _value; @@ -26,11 +26,11 @@ public ManagedClusterLoadBalanceProbeProtocol(string value) private const string HttpValue = "http"; private const string HttpsValue = "https"; - /// tcp. + /// Probe protocol is TCP. public static ManagedClusterLoadBalanceProbeProtocol Tcp { get; } = new ManagedClusterLoadBalanceProbeProtocol(TcpValue); - /// http. + /// Probe protocol is HTTP. public static ManagedClusterLoadBalanceProbeProtocol Http { get; } = new ManagedClusterLoadBalanceProbeProtocol(HttpValue); - /// https. + /// Probe protocol is HTTPS. public static ManagedClusterLoadBalanceProbeProtocol Https { get; } = new ManagedClusterLoadBalanceProbeProtocol(HttpsValue); /// Determines if two values are the same. public static bool operator ==(ManagedClusterLoadBalanceProbeProtocol left, ManagedClusterLoadBalanceProbeProtocol right) => left.Equals(right); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterLoadBalancingRuleTransportProtocol.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterLoadBalancingRuleTransportProtocol.cs index 9ab3a0a1a5c4..52219d84fbff 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterLoadBalancingRuleTransportProtocol.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterLoadBalancingRuleTransportProtocol.cs @@ -25,9 +25,9 @@ public ManagedClusterLoadBalancingRuleTransportProtocol(string value) private const string TcpValue = "tcp"; private const string UdpValue = "udp"; - /// tcp. + /// Transport protocol is TCP. public static ManagedClusterLoadBalancingRuleTransportProtocol Tcp { get; } = new ManagedClusterLoadBalancingRuleTransportProtocol(TcpValue); - /// udp. + /// Transport protocol is UDP. public static ManagedClusterLoadBalancingRuleTransportProtocol Udp { get; } = new ManagedClusterLoadBalancingRuleTransportProtocol(UdpValue); /// Determines if two values are the same. public static bool operator ==(ManagedClusterLoadBalancingRuleTransportProtocol left, ManagedClusterLoadBalancingRuleTransportProtocol right) => left.Equals(right); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterMonitoringPolicy.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterMonitoringPolicy.Serialization.cs index 85d850901a8a..a90c8b427398 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterMonitoringPolicy.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterMonitoringPolicy.Serialization.cs @@ -35,9 +35,9 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("healthCheckWaitDuration"u8); - writer.WriteStringValue(HealthCheckWaitDuration, "c"); + writer.WriteStringValue(HealthCheckWaitDuration); writer.WritePropertyName("healthCheckStableDuration"u8); - writer.WriteStringValue(HealthCheckStableDuration, "c"); + writer.WriteStringValue(HealthCheckStableDuration); writer.WritePropertyName("healthCheckRetryTimeout"u8); writer.WriteStringValue(HealthCheckRetryTimeout); writer.WritePropertyName("upgradeTimeout"u8); @@ -81,8 +81,8 @@ internal static ManagedClusterMonitoringPolicy DeserializeManagedClusterMonitori { return null; } - TimeSpan healthCheckWaitDuration = default; - TimeSpan healthCheckStableDuration = default; + string healthCheckWaitDuration = default; + string healthCheckStableDuration = default; string healthCheckRetryTimeout = default; string upgradeTimeout = default; string upgradeDomainTimeout = default; @@ -92,12 +92,12 @@ internal static ManagedClusterMonitoringPolicy DeserializeManagedClusterMonitori { if (property.NameEquals("healthCheckWaitDuration"u8)) { - healthCheckWaitDuration = property.Value.GetTimeSpan("c"); + healthCheckWaitDuration = property.Value.GetString(); continue; } if (property.NameEquals("healthCheckStableDuration"u8)) { - healthCheckStableDuration = property.Value.GetTimeSpan("c"); + healthCheckStableDuration = property.Value.GetString(); continue; } if (property.NameEquals("healthCheckRetryTimeout"u8)) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterMonitoringPolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterMonitoringPolicy.cs index 6f552152840f..5a95fc072601 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterMonitoringPolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterMonitoringPolicy.cs @@ -51,9 +51,11 @@ public partial class ManagedClusterMonitoringPolicy /// The amount of time to retry health evaluation when the application or cluster is unhealthy before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. /// The amount of time the overall upgrade has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. /// The amount of time each upgrade domain has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - /// , or is null. - public ManagedClusterMonitoringPolicy(TimeSpan healthCheckWaitDuration, TimeSpan healthCheckStableDuration, string healthCheckRetryTimeout, string upgradeTimeout, string upgradeDomainTimeout) + /// , , , or is null. + public ManagedClusterMonitoringPolicy(string healthCheckWaitDuration, string healthCheckStableDuration, string healthCheckRetryTimeout, string upgradeTimeout, string upgradeDomainTimeout) { + Argument.AssertNotNull(healthCheckWaitDuration, nameof(healthCheckWaitDuration)); + Argument.AssertNotNull(healthCheckStableDuration, nameof(healthCheckStableDuration)); Argument.AssertNotNull(healthCheckRetryTimeout, nameof(healthCheckRetryTimeout)); Argument.AssertNotNull(upgradeTimeout, nameof(upgradeTimeout)); Argument.AssertNotNull(upgradeDomainTimeout, nameof(upgradeDomainTimeout)); @@ -72,7 +74,7 @@ public ManagedClusterMonitoringPolicy(TimeSpan healthCheckWaitDuration, TimeSpan /// The amount of time the overall upgrade has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. /// The amount of time each upgrade domain has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. /// Keeps track of any properties unknown to the library. - internal ManagedClusterMonitoringPolicy(TimeSpan healthCheckWaitDuration, TimeSpan healthCheckStableDuration, string healthCheckRetryTimeout, string upgradeTimeout, string upgradeDomainTimeout, IDictionary serializedAdditionalRawData) + internal ManagedClusterMonitoringPolicy(string healthCheckWaitDuration, string healthCheckStableDuration, string healthCheckRetryTimeout, string upgradeTimeout, string upgradeDomainTimeout, IDictionary serializedAdditionalRawData) { HealthCheckWaitDuration = healthCheckWaitDuration; HealthCheckStableDuration = healthCheckStableDuration; @@ -88,9 +90,9 @@ internal ManagedClusterMonitoringPolicy() } /// The length of time to wait after completing an upgrade domain before performing health checks. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - public TimeSpan HealthCheckWaitDuration { get; set; } + public string HealthCheckWaitDuration { get; set; } /// The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. The duration can be in either hh:mm:ss or in d.hh:mm:ss.ms format. - public TimeSpan HealthCheckStableDuration { get; set; } + public string HealthCheckStableDuration { get; set; } /// The amount of time to retry health evaluation when the application or cluster is unhealthy before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. public string HealthCheckRetryTimeout { get; set; } /// The amount of time the overall upgrade has to complete before the upgrade rolls back. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterServiceEndpoint.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterServiceEndpoint.Serialization.cs index d88ed8ee360e..091a4b005232 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterServiceEndpoint.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterServiceEndpoint.Serialization.cs @@ -36,11 +36,11 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("service"u8); writer.WriteStringValue(Service); - if (Optional.IsCollectionDefined(Locations)) + if (Optional.IsCollectionDefined(AzureLocation)) { writer.WritePropertyName("locations"u8); writer.WriteStartArray(); - foreach (var item in Locations) + foreach (var item in AzureLocation) { writer.WriteStringValue(item); } @@ -84,7 +84,7 @@ internal static ManagedClusterServiceEndpoint DeserializeManagedClusterServiceEn return null; } string service = default; - IList locations = default; + IList locations = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -100,10 +100,10 @@ internal static ManagedClusterServiceEndpoint DeserializeManagedClusterServiceEn { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - array.Add(new AzureLocation(item.GetString())); + array.Add(item.GetString()); } locations = array; continue; @@ -114,7 +114,7 @@ internal static ManagedClusterServiceEndpoint DeserializeManagedClusterServiceEn } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedClusterServiceEndpoint(service, locations ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new ManagedClusterServiceEndpoint(service, locations ?? new ChangeTrackingList(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterServiceEndpoint.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterServiceEndpoint.cs index a7e52110f36b..a3ee1b0126b5 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterServiceEndpoint.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterServiceEndpoint.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { @@ -54,17 +53,17 @@ public ManagedClusterServiceEndpoint(string service) Argument.AssertNotNull(service, nameof(service)); Service = service; - Locations = new ChangeTrackingList(); + AzureLocation = new ChangeTrackingList(); } /// Initializes a new instance of . /// The type of the endpoint service. - /// A list of locations. + /// A list of locations. /// Keeps track of any properties unknown to the library. - internal ManagedClusterServiceEndpoint(string service, IList locations, IDictionary serializedAdditionalRawData) + internal ManagedClusterServiceEndpoint(string service, IList azureLocation, IDictionary serializedAdditionalRawData) { Service = service; - Locations = locations; + AzureLocation = azureLocation; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -76,6 +75,6 @@ internal ManagedClusterServiceEndpoint() /// The type of the endpoint service. public string Service { get; set; } /// A list of locations. - public IList Locations { get; } + public IList AzureLocation { get; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterSubnet.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterSubnet.Serialization.cs index 28b70b16131e..16942eb26dea 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterSubnet.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterSubnet.Serialization.cs @@ -136,7 +136,7 @@ internal static ManagedClusterSubnet DeserializeManagedClusterSubnet(JsonElement } if (property.NameEquals("networkSecurityGroupId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null || property.Value.ValueKind == JsonValueKind.String && property.Value.GetString().Length == 0) + if (property.Value.ValueKind == JsonValueKind.Null) { continue; } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterSubnetPrivateEndpointNetworkPoliciesState.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterSubnetPrivateEndpointNetworkPoliciesState.cs index 523bc27925b4..45ad368f6a98 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterSubnetPrivateEndpointNetworkPoliciesState.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterSubnetPrivateEndpointNetworkPoliciesState.cs @@ -25,9 +25,9 @@ public ManagedClusterSubnetPrivateEndpointNetworkPoliciesState(string value) private const string EnabledValue = "enabled"; private const string DisabledValue = "disabled"; - /// enabled. + /// Enable apply network policies on private end point in the subnet. public static ManagedClusterSubnetPrivateEndpointNetworkPoliciesState Enabled { get; } = new ManagedClusterSubnetPrivateEndpointNetworkPoliciesState(EnabledValue); - /// disabled. + /// Disable apply network policies on private end point in the subnet. public static ManagedClusterSubnetPrivateEndpointNetworkPoliciesState Disabled { get; } = new ManagedClusterSubnetPrivateEndpointNetworkPoliciesState(DisabledValue); /// Determines if two values are the same. public static bool operator ==(ManagedClusterSubnetPrivateEndpointNetworkPoliciesState left, ManagedClusterSubnetPrivateEndpointNetworkPoliciesState right) => left.Equals(right); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState.cs index 42bdf2410c11..b119ff8d404d 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState.cs @@ -25,9 +25,9 @@ public ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState(string value) private const string EnabledValue = "enabled"; private const string DisabledValue = "disabled"; - /// enabled. + /// Enable apply network policies on private link service in the subnet. public static ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState Enabled { get; } = new ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState(EnabledValue); - /// disabled. + /// Disable apply network policies on private link service in the subnet. public static ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState Disabled { get; } = new ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState(DisabledValue); /// Determines if two values are the same. public static bool operator ==(ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState left, ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState right) => left.Equals(right); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterUpgradeDeltaHealthPolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterUpgradeDeltaHealthPolicy.cs index dd6d220ba1db..4badc04fcada 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterUpgradeDeltaHealthPolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterUpgradeDeltaHealthPolicy.cs @@ -50,7 +50,6 @@ public partial class ManagedClusterUpgradeDeltaHealthPolicy /// The maximum allowed percentage of nodes health degradation allowed during cluster upgrades. /// The delta is measured between the state of the nodes at the beginning of upgrade and the state of the nodes at the time of the health evaluation. /// The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. - /// /// public ManagedClusterUpgradeDeltaHealthPolicy(int maxPercentDeltaUnhealthyNodes) { @@ -62,20 +61,17 @@ public ManagedClusterUpgradeDeltaHealthPolicy(int maxPercentDeltaUnhealthyNodes) /// The maximum allowed percentage of nodes health degradation allowed during cluster upgrades. /// The delta is measured between the state of the nodes at the beginning of upgrade and the state of the nodes at the time of the health evaluation. /// The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. - /// /// /// /// The maximum allowed percentage of upgrade domain nodes health degradation allowed during cluster upgrades. /// The delta is measured between the state of the upgrade domain nodes at the beginning of upgrade and the state of the upgrade domain nodes at the time of the health evaluation. /// The check is performed after every upgrade domain upgrade completion for all completed upgrade domains to make sure the state of the upgrade domains is within tolerated limits. - /// /// /// /// The maximum allowed percentage of applications health degradation allowed during cluster upgrades. /// The delta is measured between the state of the applications at the beginning of upgrade and the state of the applications at the time of the health evaluation. /// The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. System services are not included in this. /// NOTE: This value will overwrite the value specified in properties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyApplications - /// /// /// Keeps track of any properties unknown to the library. internal ManagedClusterUpgradeDeltaHealthPolicy(int maxPercentDeltaUnhealthyNodes, int? maxPercentUpgradeDomainDeltaUnhealthyNodes, int? maxPercentDeltaUnhealthyApplications, IDictionary serializedAdditionalRawData) @@ -95,14 +91,12 @@ internal ManagedClusterUpgradeDeltaHealthPolicy() /// The maximum allowed percentage of nodes health degradation allowed during cluster upgrades. /// The delta is measured between the state of the nodes at the beginning of upgrade and the state of the nodes at the time of the health evaluation. /// The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. - /// /// public int MaxPercentDeltaUnhealthyNodes { get; set; } /// /// The maximum allowed percentage of upgrade domain nodes health degradation allowed during cluster upgrades. /// The delta is measured between the state of the upgrade domain nodes at the beginning of upgrade and the state of the upgrade domain nodes at the time of the health evaluation. /// The check is performed after every upgrade domain upgrade completion for all completed upgrade domains to make sure the state of the upgrade domains is within tolerated limits. - /// /// public int? MaxPercentUpgradeDomainDeltaUnhealthyNodes { get; set; } /// @@ -110,7 +104,6 @@ internal ManagedClusterUpgradeDeltaHealthPolicy() /// The delta is measured between the state of the applications at the beginning of upgrade and the state of the applications at the time of the health evaluation. /// The check is performed after every upgrade domain upgrade completion to make sure the global state of the cluster is within tolerated limits. System services are not included in this. /// NOTE: This value will overwrite the value specified in properties.UpgradeDescription.HealthPolicy.MaxPercentUnhealthyApplications - /// /// public int? MaxPercentDeltaUnhealthyApplications { get; set; } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterUpgradeMode.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterUpgradeMode.cs index 61b64b828fac..1defa7a18438 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterUpgradeMode.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterUpgradeMode.cs @@ -10,10 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// - /// The upgrade mode of the cluster when new Service Fabric runtime version is available. - /// - /// + /// The upgrade mode of the cluster when new Service Fabric runtime version is available. public readonly partial struct ManagedClusterUpgradeMode : IEquatable { private readonly string _value; diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterUpgradePolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterUpgradePolicy.cs index b81f3679e867..f0485b8f0682 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterUpgradePolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterUpgradePolicy.cs @@ -60,7 +60,6 @@ public ManagedClusterUpgradePolicy() /// When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. /// The timeout is reset at the start of each upgrade domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. /// This value must be between 00:00:00 and 49710.06:28:15 (unsigned 32 bit integer for seconds) - /// /// /// Keeps track of any properties unknown to the library. internal ManagedClusterUpgradePolicy(bool? forceRestart, ManagedClusterHealthPolicy healthPolicy, ManagedClusterUpgradeDeltaHealthPolicy deltaHealthPolicy, ManagedClusterMonitoringPolicy monitoringPolicy, string upgradeReplicaSetCheckTimeout, IDictionary serializedAdditionalRawData) @@ -86,7 +85,6 @@ internal ManagedClusterUpgradePolicy(bool? forceRestart, ManagedClusterHealthPol /// When this timeout expires, processing of the upgrade domain will proceed regardless of availability loss issues. /// The timeout is reset at the start of each upgrade domain. The timeout can be in either hh:mm:ss or in d.hh:mm:ss.ms format. /// This value must be between 00:00:00 and 49710.06:28:15 (unsigned 32 bit integer for seconds) - /// /// public string UpgradeReplicaSetCheckTimeout { get; set; } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterVersionEnvironment.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterVersionEnvironment.cs index e53367088cb0..57533e1b624b 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterVersionEnvironment.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedClusterVersionEnvironment.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// The ManagedClusterVersionEnvironment. + /// The operating system of the cluster. The default means all. public readonly partial struct ManagedClusterVersionEnvironment : IEquatable { private readonly string _value; @@ -24,7 +24,7 @@ public ManagedClusterVersionEnvironment(string value) private const string WindowsValue = "Windows"; - /// Windows. + /// Indicates os is Windows. public static ManagedClusterVersionEnvironment Windows { get; } = new ManagedClusterVersionEnvironment(WindowsValue); /// Determines if two values are the same. public static bool operator ==(ManagedClusterVersionEnvironment left, ManagedClusterVersionEnvironment right) => left.Equals(right); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePartitionScheme.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePartitionScheme.Serialization.cs index 2d6b353be3d9..eab33d75c4e4 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePartitionScheme.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePartitionScheme.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - [PersistableModelProxy(typeof(UnknownPartition))] + [PersistableModelProxy(typeof(UnknownManagedServicePartitionScheme))] public partial class ManagedServicePartitionScheme : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -82,7 +82,7 @@ internal static ManagedServicePartitionScheme DeserializeManagedServicePartition case "UniformInt64Range": return UniformInt64RangePartitionScheme.DeserializeUniformInt64RangePartitionScheme(element, options); } } - return UnknownPartition.DeserializeUnknownPartition(element, options); + return UnknownManagedServicePartitionScheme.DeserializeUnknownManagedServicePartitionScheme(element, options); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePartitionScheme.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePartitionScheme.cs index 167903cc1116..990b8c2bd087 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePartitionScheme.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePartitionScheme.cs @@ -55,7 +55,7 @@ protected ManagedServicePartitionScheme() } /// Initializes a new instance of . - /// Specifies how the service is partitioned. + /// /// Keeps track of any properties unknown to the library. internal ManagedServicePartitionScheme(PartitionScheme partitionScheme, IDictionary serializedAdditionalRawData) { @@ -63,7 +63,7 @@ internal ManagedServicePartitionScheme(PartitionScheme partitionScheme, IDiction _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Specifies how the service is partitioned. + /// Gets or sets the partition scheme. internal PartitionScheme PartitionScheme { get; set; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePlacementPolicy.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePlacementPolicy.Serialization.cs index 625c78627efc..df3396ee72ae 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePlacementPolicy.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePlacementPolicy.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - [PersistableModelProxy(typeof(UnknownServicePlacementPolicy))] + [PersistableModelProxy(typeof(UnknownManagedServicePlacementPolicy))] public partial class ManagedServicePlacementPolicy : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -35,7 +35,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit } writer.WritePropertyName("type"u8); - writer.WriteStringValue(ServicePlacementPolicyType.ToString()); + writer.WriteStringValue(Type.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -84,7 +84,7 @@ internal static ManagedServicePlacementPolicy DeserializeManagedServicePlacement case "RequiredDomainDistribution": return ServicePlacementRequireDomainDistributionPolicy.DeserializeServicePlacementRequireDomainDistributionPolicy(element, options); } } - return UnknownServicePlacementPolicy.DeserializeUnknownServicePlacementPolicy(element, options); + return UnknownManagedServicePlacementPolicy.DeserializeUnknownManagedServicePlacementPolicy(element, options); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePlacementPolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePlacementPolicy.cs index 3686a80b13d4..1f66610be8b6 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePlacementPolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServicePlacementPolicy.cs @@ -55,15 +55,15 @@ protected ManagedServicePlacementPolicy() } /// Initializes a new instance of . - /// The type of placement policy for a service fabric service. Following are the possible values. + /// /// Keeps track of any properties unknown to the library. - internal ManagedServicePlacementPolicy(ServicePlacementPolicyType servicePlacementPolicyType, IDictionary serializedAdditionalRawData) + internal ManagedServicePlacementPolicy(ServicePlacementPolicyType type, IDictionary serializedAdditionalRawData) { - ServicePlacementPolicyType = servicePlacementPolicyType; + Type = type; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The type of placement policy for a service fabric service. Following are the possible values. - internal ServicePlacementPolicyType ServicePlacementPolicyType { get; set; } + /// Gets or sets the type. + internal ServicePlacementPolicyType Type { get; set; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceProperties.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceProperties.Serialization.cs index bb1be2a9fe54..36f2c330fde3 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceProperties.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceProperties.Serialization.cs @@ -12,6 +12,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { + [PersistableModelProxy(typeof(UnknownManagedServiceProperties))] public partial class ManagedServiceProperties : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -85,7 +86,7 @@ internal static ManagedServiceProperties DeserializeManagedServiceProperties(Jso case "Stateless": return StatelessServiceProperties.DeserializeStatelessServiceProperties(element, options); } } - return UnknownServiceResourceProperties.DeserializeUnknownServiceResourceProperties(element, options); + return UnknownManagedServiceProperties.DeserializeUnknownManagedServiceProperties(element, options); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceProperties.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceProperties.cs index 0731e7984a01..a8100bf0395c 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceProperties.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceProperties.cs @@ -15,7 +15,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. /// The available derived classes include and . /// - public partial class ManagedServiceProperties : ManagedServiceBaseProperties + public abstract partial class ManagedServiceProperties : ManagedServiceBaseProperties { /// Initializes a new instance of . /// The name of the service type. @@ -25,7 +25,7 @@ public partial class ManagedServiceProperties : ManagedServiceBaseProperties /// The available derived classes include , and . /// /// or is null. - public ManagedServiceProperties(string serviceTypeName, ManagedServicePartitionScheme partitionDescription) + protected ManagedServiceProperties(string serviceTypeName, ManagedServicePartitionScheme partitionDescription) { Argument.AssertNotNull(serviceTypeName, nameof(serviceTypeName)); Argument.AssertNotNull(partitionDescription, nameof(partitionDescription)); @@ -59,7 +59,6 @@ public ManagedServiceProperties(string serviceTypeName, ManagedServicePartitionS /// Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP). /// When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. /// When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable. - /// /// internal ManagedServiceProperties(string placementConstraints, IList correlationScheme, IList serviceLoadMetrics, IList servicePlacementPolicies, ServiceFabricManagedServiceMoveCost? defaultMoveCost, IList scalingPolicies, IDictionary serializedAdditionalRawData, string provisioningState, ServiceKind serviceKind, string serviceTypeName, ManagedServicePartitionScheme partitionDescription, ManagedServicePackageActivationMode? servicePackageActivationMode, string serviceDnsName) : base(placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost, scalingPolicies, serializedAdditionalRawData) { @@ -94,7 +93,6 @@ internal ManagedServiceProperties() /// Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP). /// When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. /// When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable. - /// /// public string ServiceDnsName { get; set; } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingMechanism.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingMechanism.Serialization.cs index 02b15a5eeb46..8735fdf5b896 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingMechanism.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingMechanism.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - [PersistableModelProxy(typeof(UnknownScalingMechanism))] + [PersistableModelProxy(typeof(UnknownManagedServiceScalingMechanism))] public partial class ManagedServiceScalingMechanism : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -81,7 +81,7 @@ internal static ManagedServiceScalingMechanism DeserializeManagedServiceScalingM case "ScalePartitionInstanceCount": return PartitionInstanceCountScalingMechanism.DeserializePartitionInstanceCountScalingMechanism(element, options); } } - return UnknownScalingMechanism.DeserializeUnknownScalingMechanism(element, options); + return UnknownManagedServiceScalingMechanism.DeserializeUnknownManagedServiceScalingMechanism(element, options); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingMechanism.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingMechanism.cs index 5c341af17b14..90149da6c175 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingMechanism.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingMechanism.cs @@ -55,7 +55,7 @@ protected ManagedServiceScalingMechanism() } /// Initializes a new instance of . - /// Specifies the mechanism associated with this scaling policy. + /// /// Keeps track of any properties unknown to the library. internal ManagedServiceScalingMechanism(ServiceScalingMechanismKind kind, IDictionary serializedAdditionalRawData) { @@ -63,7 +63,7 @@ internal ManagedServiceScalingMechanism(ServiceScalingMechanismKind kind, IDicti _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Specifies the mechanism associated with this scaling policy. + /// Gets or sets the kind. internal ServiceScalingMechanismKind Kind { get; set; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingTrigger.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingTrigger.Serialization.cs index f150510162ef..9f05a871be7f 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingTrigger.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingTrigger.Serialization.cs @@ -12,7 +12,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - [PersistableModelProxy(typeof(UnknownScalingTrigger))] + [PersistableModelProxy(typeof(UnknownManagedServiceScalingTrigger))] public partial class ManagedServiceScalingTrigger : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -81,7 +81,7 @@ internal static ManagedServiceScalingTrigger DeserializeManagedServiceScalingTri case "AverageServiceLoadTrigger": return AverageServiceLoadScalingTrigger.DeserializeAverageServiceLoadScalingTrigger(element, options); } } - return UnknownScalingTrigger.DeserializeUnknownScalingTrigger(element, options); + return UnknownManagedServiceScalingTrigger.DeserializeUnknownManagedServiceScalingTrigger(element, options); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingTrigger.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingTrigger.cs index f71540f773bb..9842d2a487ad 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingTrigger.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedServiceScalingTrigger.cs @@ -55,7 +55,7 @@ protected ManagedServiceScalingTrigger() } /// Initializes a new instance of . - /// Specifies the trigger associated with this scaling policy. + /// /// Keeps track of any properties unknown to the library. internal ManagedServiceScalingTrigger(ServiceScalingTriggerKind kind, IDictionary serializedAdditionalRawData) { @@ -63,7 +63,7 @@ internal ManagedServiceScalingTrigger(ServiceScalingTriggerKind kind, IDictionar _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Specifies the trigger associated with this scaling policy. + /// Gets or sets the kind. internal ServiceScalingTriggerKind Kind { get; set; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedVmSizesResult.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedVmSizesResult.Serialization.cs index efba6ecbad6c..8db5297daca4 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedVmSizesResult.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedVmSizesResult.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ManagedVmSizesResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static ManagedVmSizesResult DeserializeManagedVmSizesResult(JsonElement return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static ManagedVmSizesResult DeserializeManagedVmSizesResult(JsonElement } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static ManagedVmSizesResult DeserializeManagedVmSizesResult(JsonElement } } serializedAdditionalRawData = rawDataDictionary; - return new ManagedVmSizesResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ManagedVmSizesResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedVmSizesResult.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedVmSizesResult.cs index fc122ae20208..56698751577c 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedVmSizesResult.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ManagedVmSizesResult.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { @@ -46,25 +47,34 @@ internal partial class ManagedVmSizesResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ManagedVmSizesResult() + /// The ManagedVMSize items on this page. + /// is null. + internal ManagedVmSizesResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// List of Managed VM Sizes for Service Fabric Managed Clusters. - /// URL to get the next set of Managed VM Sizes if there are any. + /// The ManagedVMSize items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ManagedVmSizesResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ManagedVmSizesResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// List of Managed VM Sizes for Service Fabric Managed Clusters. + /// Initializes a new instance of for deserialization. + internal ManagedVmSizesResult() + { + } + + /// The ManagedVMSize items on this page. public IReadOnlyList Value { get; } - /// URL to get the next set of Managed VM Sizes if there are any. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NamedPartitionAddOrRemoveScalingMechanism.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NamedPartitionAddOrRemoveScalingMechanism.cs index bf4c12644bce..05e0a2e9f806 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NamedPartitionAddOrRemoveScalingMechanism.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NamedPartitionAddOrRemoveScalingMechanism.cs @@ -26,7 +26,7 @@ public NamedPartitionAddOrRemoveScalingMechanism(int minPartitionCount, int maxP } /// Initializes a new instance of . - /// Specifies the mechanism associated with this scaling policy. + /// /// Keeps track of any properties unknown to the library. /// Minimum number of named partitions of the service. /// Maximum number of named partitions of the service. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NamedPartitionScheme.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NamedPartitionScheme.cs index 6f9a855375bd..35bd1d7f33c1 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NamedPartitionScheme.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NamedPartitionScheme.cs @@ -26,7 +26,7 @@ public NamedPartitionScheme(IEnumerable names) } /// Initializes a new instance of . - /// Specifies how the service is partitioned. + /// /// Keeps track of any properties unknown to the library. /// Array for the names of the partitions. internal NamedPartitionScheme(PartitionScheme partitionScheme, IDictionary serializedAdditionalRawData, IList names) : base(partitionScheme, serializedAdditionalRawData) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeAvailableSku.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeAvailableSku.cs index 87d5a05613fa..04504dc621ce 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeAvailableSku.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeAvailableSku.cs @@ -52,7 +52,7 @@ internal NodeTypeAvailableSku() } /// Initializes a new instance of . - /// The type of resource the sku applies to. <br /><br />Value: Microsoft.ServiceFabric/managedClusters/nodeTypes. + /// The type of resource the sku applies to. Value: Microsoft.ServiceFabric/managedClusters/nodeTypes. /// The supported SKU for a for node type. /// Provides information about how the node count can be scaled. /// Keeps track of any properties unknown to the library. @@ -64,7 +64,7 @@ internal NodeTypeAvailableSku(ResourceType? resourceType, NodeTypeSupportedSku s _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The type of resource the sku applies to. <br /><br />Value: Microsoft.ServiceFabric/managedClusters/nodeTypes. + /// The type of resource the sku applies to. Value: Microsoft.ServiceFabric/managedClusters/nodeTypes. public ResourceType? ResourceType { get; } /// The supported SKU for a for node type. public NodeTypeSupportedSku Sku { get; } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFaultSimulation.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFaultSimulation.Serialization.cs new file mode 100644 index 000000000000..131eaeb93fb5 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFaultSimulation.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.ServiceFabricManagedClusters.Models +{ + public partial class NodeTypeFaultSimulation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NodeTypeFaultSimulation)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NodeTypeName)) + { + writer.WritePropertyName("nodeTypeName"u8); + writer.WriteStringValue(NodeTypeName); + } + if (Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (Optional.IsDefined(OperationId)) + { + writer.WritePropertyName("operationId"u8); + writer.WriteStringValue(OperationId); + } + if (Optional.IsDefined(OperationStatus)) + { + writer.WritePropertyName("operationStatus"u8); + writer.WriteStringValue(OperationStatus.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 + } + } + } + + NodeTypeFaultSimulation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NodeTypeFaultSimulation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNodeTypeFaultSimulation(document.RootElement, options); + } + + internal static NodeTypeFaultSimulation DeserializeNodeTypeFaultSimulation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string nodeTypeName = default; + FaultSimulationStatus? status = default; + string operationId = default; + SfmcOperationStatus? operationStatus = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nodeTypeName"u8)) + { + nodeTypeName = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new FaultSimulationStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("operationId"u8)) + { + operationId = property.Value.GetString(); + continue; + } + if (property.NameEquals("operationStatus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + operationStatus = new SfmcOperationStatus(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NodeTypeFaultSimulation(nodeTypeName, status, operationId, operationStatus, serializedAdditionalRawData); + } + + BinaryData 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(NodeTypeFaultSimulation)} does not support writing '{options.Format}' format."); + } + } + + NodeTypeFaultSimulation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNodeTypeFaultSimulation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NodeTypeFaultSimulation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFaultSimulation.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFaultSimulation.cs new file mode 100644 index 000000000000..f35030c3aaea --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFaultSimulation.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.ServiceFabricManagedClusters.Models +{ + /// Node type fault simulation object with status. + public partial class NodeTypeFaultSimulation + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NodeTypeFaultSimulation() + { + } + + /// Initializes a new instance of . + /// Node type name. + /// Fault simulation status. + /// Current or latest asynchronous operation identifier on the node type. + /// Current or latest asynchronous operation status on the node type. + /// Keeps track of any properties unknown to the library. + internal NodeTypeFaultSimulation(string nodeTypeName, FaultSimulationStatus? status, string operationId, SfmcOperationStatus? operationStatus, IDictionary serializedAdditionalRawData) + { + NodeTypeName = nodeTypeName; + Status = status; + OperationId = operationId; + OperationStatus = operationStatus; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Node type name. + public string NodeTypeName { get; } + /// Fault simulation status. + public FaultSimulationStatus? Status { get; } + /// Current or latest asynchronous operation identifier on the node type. + public string OperationId { get; } + /// Current or latest asynchronous operation status on the node type. + public SfmcOperationStatus? OperationStatus { get; } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFrontendConfiguration.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFrontendConfiguration.Serialization.cs index 057ec3935f3a..8fd123a1b12f 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFrontendConfiguration.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFrontendConfiguration.Serialization.cs @@ -110,7 +110,7 @@ internal static NodeTypeFrontendConfiguration DeserializeNodeTypeFrontendConfigu } if (property.NameEquals("loadBalancerBackendAddressPoolId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null || property.Value.ValueKind == JsonValueKind.String && property.Value.GetString().Length == 0) + if (property.Value.ValueKind == JsonValueKind.Null) { continue; } @@ -119,7 +119,7 @@ internal static NodeTypeFrontendConfiguration DeserializeNodeTypeFrontendConfigu } if (property.NameEquals("loadBalancerInboundNatPoolId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null || property.Value.ValueKind == JsonValueKind.String && property.Value.GetString().Length == 0) + if (property.Value.ValueKind == JsonValueKind.Null) { continue; } @@ -128,7 +128,7 @@ internal static NodeTypeFrontendConfiguration DeserializeNodeTypeFrontendConfigu } if (property.NameEquals("applicationGatewayBackendAddressPoolId"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null || property.Value.ValueKind == JsonValueKind.String && property.Value.GetString().Length == 0) + if (property.Value.ValueKind == JsonValueKind.Null) { continue; } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFrontendConfiguration.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFrontendConfiguration.cs index 6ea1a340bb4b..c623a8a34b99 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFrontendConfiguration.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFrontendConfiguration.cs @@ -53,9 +53,9 @@ public NodeTypeFrontendConfiguration() /// Initializes a new instance of . /// The IP address type of this frontend configuration. If omitted the default value is IPv4. - /// The resource Id of the Load Balancer backend address pool that the VM instances of the node type are associated with. The format of the resource Id is '/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/loadBalancers/<loadBalancerName>/backendAddressPools/<backendAddressPoolName>'. - /// The resource Id of the Load Balancer inbound NAT pool that the VM instances of the node type are associated with. The format of the resource Id is '/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/loadBalancers/<loadBalancerName>/inboundNatPools/<inboundNatPoolName>'. - /// The resource Id of application gateway backend address pool. The format of the resource Id is '/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/applicationGateways/<applicationGatewayName>/backendAddressPools/<backendAddressPoolName>'. + /// The resource Id of the Load Balancer backend address pool that the VM instances of the node type are associated with. The format of the resource Id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'. + /// The resource Id of the Load Balancer inbound NAT pool that the VM instances of the node type are associated with. The format of the resource Id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}'. + /// The resource Id of application gateway backend address pool. The format of the resource Id is '/subscriptions/<subscriptionId>/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}'. /// Keeps track of any properties unknown to the library. internal NodeTypeFrontendConfiguration(NodeTypeFrontendConfigurationIPAddressType? ipAddressType, ResourceIdentifier loadBalancerBackendAddressPoolId, ResourceIdentifier loadBalancerInboundNatPoolId, ResourceIdentifier applicationGatewayBackendAddressPoolId, IDictionary serializedAdditionalRawData) { @@ -68,11 +68,11 @@ internal NodeTypeFrontendConfiguration(NodeTypeFrontendConfigurationIPAddressTyp /// The IP address type of this frontend configuration. If omitted the default value is IPv4. public NodeTypeFrontendConfigurationIPAddressType? IPAddressType { get; set; } - /// The resource Id of the Load Balancer backend address pool that the VM instances of the node type are associated with. The format of the resource Id is '/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/loadBalancers/<loadBalancerName>/backendAddressPools/<backendAddressPoolName>'. + /// The resource Id of the Load Balancer backend address pool that the VM instances of the node type are associated with. The format of the resource Id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/backendAddressPools/{backendAddressPoolName}'. public ResourceIdentifier LoadBalancerBackendAddressPoolId { get; set; } - /// The resource Id of the Load Balancer inbound NAT pool that the VM instances of the node type are associated with. The format of the resource Id is '/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/loadBalancers/<loadBalancerName>/inboundNatPools/<inboundNatPoolName>'. + /// The resource Id of the Load Balancer inbound NAT pool that the VM instances of the node type are associated with. The format of the resource Id is '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/loadBalancers/{loadBalancerName}/inboundNatPools/{inboundNatPoolName}'. public ResourceIdentifier LoadBalancerInboundNatPoolId { get; set; } - /// The resource Id of application gateway backend address pool. The format of the resource Id is '/subscriptions/<subscriptionId>/resourceGroups/<resourceGroupName>/providers/Microsoft.Network/applicationGateways/<applicationGatewayName>/backendAddressPools/<backendAddressPoolName>'. + /// The resource Id of application gateway backend address pool. The format of the resource Id is '/subscriptions/<subscriptionId>/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendAddressPools/{backendAddressPoolName}'. public ResourceIdentifier ApplicationGatewayBackendAddressPoolId { get; set; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFrontendConfigurationIPAddressType.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFrontendConfigurationIPAddressType.cs index 484c040b77be..d391ebfc2928 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFrontendConfigurationIPAddressType.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeFrontendConfigurationIPAddressType.cs @@ -10,10 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// - /// The IP address type. - /// - /// + /// The IP address type. public readonly partial struct NodeTypeFrontendConfigurationIPAddressType : IEquatable { private readonly string _value; diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListResult.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListResult.Serialization.cs index 4f66600edbfe..700678de3106 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListResult.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListResult.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(NodeTypeListResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static NodeTypeListResult DeserializeNodeTypeListResult(JsonElement ele return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static NodeTypeListResult DeserializeNodeTypeListResult(JsonElement ele } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static NodeTypeListResult DeserializeNodeTypeListResult(JsonElement ele } } serializedAdditionalRawData = rawDataDictionary; - return new NodeTypeListResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NodeTypeListResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListResult.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListResult.cs index 2d0765b4533a..8fedc17515d3 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListResult.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListResult.cs @@ -7,10 +7,11 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// Node type list results. + /// The response of a NodeType list operation. internal partial class NodeTypeListResult { /// @@ -46,25 +47,34 @@ internal partial class NodeTypeListResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal NodeTypeListResult() + /// The NodeType items on this page. + /// is null. + internal NodeTypeListResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// The list of node types. - /// The URL to use for getting the next set of results. + /// The NodeType items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal NodeTypeListResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NodeTypeListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of node types. + /// Initializes a new instance of for deserialization. + internal NodeTypeListResult() + { + } + + /// The NodeType items on this page. public IReadOnlyList Value { get; } - /// The URL to use for getting the next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListSkuResult.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListSkuResult.Serialization.cs index a9cb2d5bb575..264d67fb687a 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListSkuResult.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListSkuResult.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(NodeTypeListSkuResult)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } + writer.WriteEndArray(); if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static NodeTypeListSkuResult DeserializeNodeTypeListSkuResult(JsonEleme return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static NodeTypeListSkuResult DeserializeNodeTypeListSkuResult(JsonEleme } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static NodeTypeListSkuResult DeserializeNodeTypeListSkuResult(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new NodeTypeListSkuResult(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new NodeTypeListSkuResult(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListSkuResult.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListSkuResult.cs index 8eadedc19e8b..4040137bb30d 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListSkuResult.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeListSkuResult.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { @@ -46,25 +47,34 @@ internal partial class NodeTypeListSkuResult private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal NodeTypeListSkuResult() + /// The NodeTypeAvailableSku items on this page. + /// is null. + internal NodeTypeListSkuResult(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// The list of available node type SKUs. - /// The URL to use for getting the next set of results. + /// The NodeTypeAvailableSku items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal NodeTypeListSkuResult(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal NodeTypeListSkuResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The list of available node type SKUs. + /// Initializes a new instance of for deserialization. + internal NodeTypeListSkuResult() + { + } + + /// The NodeTypeAvailableSku items on this page. public IReadOnlyList Value { get; } - /// The URL to use for getting the next set of results. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSku.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSku.cs index 3f968c3092db..f65d70bf429d 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSku.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSku.cs @@ -46,16 +46,16 @@ public partial class NodeTypeSku private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - /// The number of nodes in the node type.<br /><br />If present in request it will override properties.vmInstanceCount. + /// The number of nodes in the node type. If present in request it will override properties.vmInstanceCount. public NodeTypeSku(int capacity) { Capacity = capacity; } /// Initializes a new instance of . - /// The sku name. <br /><br />Name is internally generated and is used in auto-scale scenarios.<br /> Property does not allow to be changed to other values than generated.<br /> To avoid deployment errors please omit the property. - /// Specifies the tier of the node type. <br /><br /> Possible Values:<br /> **Standard**. - /// The number of nodes in the node type.<br /><br />If present in request it will override properties.vmInstanceCount. + /// The sku name. Name is internally generated and is used in auto-scale scenarios. Property does not allow to be changed to other values than generated. To avoid deployment errors please omit the property. + /// Specifies the tier of the node type. Possible Values: **Standard**. + /// The number of nodes in the node type. If present in request it will override properties.vmInstanceCount. /// Keeps track of any properties unknown to the library. internal NodeTypeSku(string name, string tier, int capacity, IDictionary serializedAdditionalRawData) { @@ -70,11 +70,11 @@ internal NodeTypeSku() { } - /// The sku name. <br /><br />Name is internally generated and is used in auto-scale scenarios.<br /> Property does not allow to be changed to other values than generated.<br /> To avoid deployment errors please omit the property. + /// The sku name. Name is internally generated and is used in auto-scale scenarios. Property does not allow to be changed to other values than generated. To avoid deployment errors please omit the property. public string Name { get; set; } - /// Specifies the tier of the node type. <br /><br /> Possible Values:<br /> **Standard**. + /// Specifies the tier of the node type. Possible Values: **Standard**. public string Tier { get; set; } - /// The number of nodes in the node type.<br /><br />If present in request it will override properties.vmInstanceCount. + /// The number of nodes in the node type. If present in request it will override properties.vmInstanceCount. public int Capacity { get; set; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSkuScaleType.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSkuScaleType.cs index 206c80fe8cfc..a68f9fb73b77 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSkuScaleType.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSkuScaleType.cs @@ -10,10 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// - /// Node type capacity scale type. - /// - /// + /// Node type capacity scale type. public readonly partial struct NodeTypeSkuScaleType : IEquatable { private readonly string _value; diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSupportedSku.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSupportedSku.cs index 481f543cb6f9..ba76ea4ae824 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSupportedSku.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeSupportedSku.cs @@ -52,7 +52,7 @@ internal NodeTypeSupportedSku() /// Initializes a new instance of . /// The sku name. - /// Specifies the tier of the node type. <br /><br /> Possible Values:<br /> **Standard**. + /// Specifies the tier of the node type. Possible Values: **Standard**. /// Keeps track of any properties unknown to the library. internal NodeTypeSupportedSku(string name, string tier, IDictionary serializedAdditionalRawData) { @@ -63,7 +63,7 @@ internal NodeTypeSupportedSku(string name, string tier, IDictionary The sku name. public string Name { get; } - /// Specifies the tier of the node type. <br /><br /> Possible Values:<br /> **Standard**. + /// Specifies the tier of the node type. Possible Values: **Standard**. public string Tier { get; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeVaultCertificate.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeVaultCertificate.cs index 27f95298c1ce..09f9b3a2cff3 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeVaultCertificate.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeVaultCertificate.cs @@ -47,7 +47,7 @@ public partial class NodeTypeVaultCertificate /// Initializes a new instance of . /// This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). - /// For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted. + /// For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name {UppercaseThumbprint}.crt for the X509 certificate file and {UppercaseThumbprint}.prv for private key. Both of these files are .pem formatted. /// or is null. public NodeTypeVaultCertificate(Uri certificateUri, string certificateStore) { @@ -60,7 +60,7 @@ public NodeTypeVaultCertificate(Uri certificateUri, string certificateStore) /// Initializes a new instance of . /// This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). - /// For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted. + /// For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name {UppercaseThumbprint}.crt for the X509 certificate file and {UppercaseThumbprint}.prv for private key. Both of these files are .pem formatted. /// Keeps track of any properties unknown to the library. internal NodeTypeVaultCertificate(Uri certificateUri, string certificateStore, IDictionary serializedAdditionalRawData) { @@ -76,7 +76,7 @@ internal NodeTypeVaultCertificate() /// This is the URL of a certificate that has been uploaded to Key Vault as a secret. For adding a secret to the Key Vault, see [Add a key or secret to the key vault](https://docs.microsoft.com/azure/key-vault/key-vault-get-started/#add). public Uri CertificateUri { get; set; } - /// For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. <br><br>For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name <UppercaseThumbprint>.crt for the X509 certificate file and <UppercaseThumbprint>.prv for private key. Both of these files are .pem formatted. + /// For Windows VMs, specifies the certificate store on the Virtual Machine to which the certificate should be added. The specified certificate store is implicitly in the LocalMachine account. For Linux VMs, the certificate file is placed under the /var/lib/waagent directory, with the file name {UppercaseThumbprint}.crt for the X509 certificate file and {UppercaseThumbprint}.prv for private key. Both of these files are .pem formatted. public string CertificateStore { get; set; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeVmssExtension.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeVmssExtension.Serialization.cs index 789f912f3827..2fab5fd4c714 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeVmssExtension.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeVmssExtension.Serialization.cs @@ -41,7 +41,7 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("publisher"u8); writer.WriteStringValue(Publisher); writer.WritePropertyName("type"u8); - writer.WriteStringValue(VmssExtensionPropertiesType); + writer.WriteStringValue(Type); writer.WritePropertyName("typeHandlerVersion"u8); writer.WriteStringValue(TypeHandlerVersion); if (Optional.IsDefined(AutoUpgradeMinorVersion)) @@ -52,26 +52,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit if (Optional.IsDefined(Settings)) { writer.WritePropertyName("settings"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(Settings); -#else - using (JsonDocument document = JsonDocument.Parse(Settings, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif + writer.WriteObjectValue(Settings, options); } if (Optional.IsDefined(ProtectedSettings)) { writer.WritePropertyName("protectedSettings"u8); -#if NET6_0_OR_GREATER - writer.WriteRawValue(ProtectedSettings); -#else - using (JsonDocument document = JsonDocument.Parse(ProtectedSettings, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif + writer.WriteObjectValue(ProtectedSettings, options); } if (Optional.IsDefined(ForceUpdateTag)) { @@ -151,8 +137,8 @@ internal static NodeTypeVmssExtension DeserializeNodeTypeVmssExtension(JsonEleme string type = default; string typeHandlerVersion = default; bool? autoUpgradeMinorVersion = default; - BinaryData settings = default; - BinaryData protectedSettings = default; + VmSSExtensionPropertiesSettings settings = default; + VmSSExtensionPropertiesProtectedSettings protectedSettings = default; string forceUpdateTag = default; IList provisionAfterExtensions = default; string provisioningState = default; @@ -206,7 +192,7 @@ internal static NodeTypeVmssExtension DeserializeNodeTypeVmssExtension(JsonEleme { continue; } - settings = BinaryData.FromString(property0.Value.GetRawText()); + settings = VmSSExtensionPropertiesSettings.DeserializeVmSSExtensionPropertiesSettings(property0.Value, options); continue; } if (property0.NameEquals("protectedSettings"u8)) @@ -215,7 +201,7 @@ internal static NodeTypeVmssExtension DeserializeNodeTypeVmssExtension(JsonEleme { continue; } - protectedSettings = BinaryData.FromString(property0.Value.GetRawText()); + protectedSettings = VmSSExtensionPropertiesProtectedSettings.DeserializeVmSSExtensionPropertiesProtectedSettings(property0.Value, options); continue; } if (property0.NameEquals("forceUpdateTag"u8)) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeVmssExtension.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeVmssExtension.cs index 282b06f17553..fba1f755637b 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeVmssExtension.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/NodeTypeVmssExtension.cs @@ -48,19 +48,19 @@ public partial class NodeTypeVmssExtension /// Initializes a new instance of . /// The name of the extension. /// The name of the extension handler publisher. - /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// Specifies the type of the extension; an example is "CustomScriptExtension". /// Specifies the version of the script handler. - /// , , or is null. - public NodeTypeVmssExtension(string name, string publisher, string vmssExtensionPropertiesType, string typeHandlerVersion) + /// , , or is null. + public NodeTypeVmssExtension(string name, string publisher, string type, string typeHandlerVersion) { Argument.AssertNotNull(name, nameof(name)); Argument.AssertNotNull(publisher, nameof(publisher)); - Argument.AssertNotNull(vmssExtensionPropertiesType, nameof(vmssExtensionPropertiesType)); + Argument.AssertNotNull(type, nameof(type)); Argument.AssertNotNull(typeHandlerVersion, nameof(typeHandlerVersion)); Name = name; Publisher = publisher; - VmssExtensionPropertiesType = vmssExtensionPropertiesType; + Type = type; TypeHandlerVersion = typeHandlerVersion; ProvisionAfterExtensions = new ChangeTrackingList(); SetupOrder = new ChangeTrackingList(); @@ -69,7 +69,7 @@ public NodeTypeVmssExtension(string name, string publisher, string vmssExtension /// Initializes a new instance of . /// The name of the extension. /// The name of the extension handler publisher. - /// Specifies the type of the extension; an example is "CustomScriptExtension". + /// Specifies the type of the extension; an example is "CustomScriptExtension". /// Specifies the version of the script handler. /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. /// Json formatted public settings for the extension. @@ -80,11 +80,11 @@ public NodeTypeVmssExtension(string name, string publisher, string vmssExtension /// Indicates whether the extension should be automatically upgraded by the platform if there is a newer version of the extension available. /// Indicates the setup order for the extension. /// Keeps track of any properties unknown to the library. - internal NodeTypeVmssExtension(string name, string publisher, string vmssExtensionPropertiesType, string typeHandlerVersion, bool? autoUpgradeMinorVersion, BinaryData settings, BinaryData protectedSettings, string forceUpdateTag, IList provisionAfterExtensions, string provisioningState, bool? isAutomaticUpgradeEnabled, IList setupOrder, IDictionary serializedAdditionalRawData) + internal NodeTypeVmssExtension(string name, string publisher, string type, string typeHandlerVersion, bool? autoUpgradeMinorVersion, VmSSExtensionPropertiesSettings settings, VmSSExtensionPropertiesProtectedSettings protectedSettings, string forceUpdateTag, IList provisionAfterExtensions, string provisioningState, bool? isAutomaticUpgradeEnabled, IList setupOrder, IDictionary serializedAdditionalRawData) { Name = name; Publisher = publisher; - VmssExtensionPropertiesType = vmssExtensionPropertiesType; + Type = type; TypeHandlerVersion = typeHandlerVersion; AutoUpgradeMinorVersion = autoUpgradeMinorVersion; Settings = settings; @@ -107,73 +107,15 @@ internal NodeTypeVmssExtension() /// The name of the extension handler publisher. public string Publisher { get; set; } /// Specifies the type of the extension; an example is "CustomScriptExtension". - public string VmssExtensionPropertiesType { get; set; } + public string Type { get; set; } /// Specifies the version of the script handler. public string TypeHandlerVersion { get; set; } /// Indicates whether the extension should use a newer minor version if one is available at deployment time. Once deployed, however, the extension will not upgrade minor versions unless redeployed, even with this property set to true. public bool? AutoUpgradeMinorVersion { get; set; } - /// - /// Json formatted public settings for the extension. - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData Settings { get; set; } - /// - /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. - /// - /// To assign an object to this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public BinaryData ProtectedSettings { get; set; } + /// Json formatted public settings for the extension. + public VmSSExtensionPropertiesSettings Settings { get; set; } + /// The extension can contain either protectedSettings or protectedSettingsFromKeyVault or no protected settings at all. + public VmSSExtensionPropertiesProtectedSettings ProtectedSettings { get; set; } /// If a value is provided and is different from the previous value, the extension handler will be forced to update even if the extension configuration has not changed. public string ForceUpdateTag { get; set; } /// Collection of extension names after which this extension needs to be provisioned. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationListResult.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationListResult.Serialization.cs new file mode 100644 index 000000000000..ef99dc5dd096 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationListResult.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.ServiceFabricManagedClusters.Models +{ + internal partial class OperationListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(OperationListResult)} 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 + } + } + } + + OperationListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationListResult(document.RootElement, options); + } + + internal static OperationListResult DeserializeOperationListResult(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(OperationResult.DeserializeOperationResult(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 OperationListResult(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(OperationListResult)} does not support writing '{options.Format}' format."); + } + } + + OperationListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOperationListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationListResult.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationListResult.cs new file mode 100644 index 000000000000..b88cc36fedc1 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationListResult.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.ServiceFabricManagedClusters.Models +{ + /// Describes the result of the request to list Service Fabric resource provider operations. + internal partial class OperationListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 OperationResult items on this page. + /// is null. + internal OperationListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The OperationResult items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal OperationListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OperationListResult() + { + } + + /// The OperationResult items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationResult.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationResult.Serialization.cs new file mode 100644 index 000000000000..ec3ac18ec7dc --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationResult.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.ServiceFabricManagedClusters.Models +{ + public partial class OperationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(OperationResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(IsDataAction)) + { + writer.WritePropertyName("isDataAction"u8); + writer.WriteBooleanValue(IsDataAction.Value); + } + if (Optional.IsDefined(Display)) + { + writer.WritePropertyName("display"u8); + writer.WriteObjectValue(Display, options); + } + if (Optional.IsDefined(Origin)) + { + writer.WritePropertyName("origin"u8); + writer.WriteStringValue(Origin); + } + if (Optional.IsDefined(NextLink)) + { + writer.WritePropertyName("nextLink"u8); + writer.WriteStringValue(NextLink); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + OperationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationResult(document.RootElement, options); + } + + internal static OperationResult DeserializeOperationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + bool? isDataAction = default; + AvailableOperationDisplay display = default; + string origin = default; + string nextLink = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("isDataAction"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDataAction = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("display"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + display = AvailableOperationDisplay.DeserializeAvailableOperationDisplay(property.Value, options); + continue; + } + if (property.NameEquals("origin"u8)) + { + origin = property.Value.GetString(); + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationResult( + name, + isDataAction, + display, + origin, + 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(OperationResult)} does not support writing '{options.Format}' format."); + } + } + + OperationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOperationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationResult.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationResult.cs new file mode 100644 index 000000000000..dae3bf0356c3 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/OperationResult.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.ServiceFabricManagedClusters.Models +{ + /// Available operation list result. + public partial class OperationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 OperationResult() + { + } + + /// Initializes a new instance of . + /// The name of the operation. + /// Indicates whether the operation is a data action. + /// The object that represents the operation. + /// Origin result. + /// The URL to use for getting the next set of results. + /// Keeps track of any properties unknown to the library. + internal OperationResult(string name, bool? isDataAction, AvailableOperationDisplay display, string origin, string nextLink, IDictionary serializedAdditionalRawData) + { + Name = name; + IsDataAction = isDataAction; + Display = display; + Origin = origin; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The name of the operation. + public string Name { get; } + /// Indicates whether the operation is a data action. + public bool? IsDataAction { get; } + /// The object that represents the operation. + public AvailableOperationDisplay Display { get; } + /// Origin result. + public string Origin { get; } + /// The URL to use for getting the next set of results. + public string NextLink { get; } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/PartitionInstanceCountScalingMechanism.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/PartitionInstanceCountScalingMechanism.cs index 0ee96e2078b2..385c027006bb 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/PartitionInstanceCountScalingMechanism.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/PartitionInstanceCountScalingMechanism.cs @@ -26,7 +26,7 @@ public PartitionInstanceCountScalingMechanism(int minInstanceCount, int maxInsta } /// Initializes a new instance of . - /// Specifies the mechanism associated with this scaling policy. + /// /// Keeps track of any properties unknown to the library. /// Minimum number of instances of the partition. /// Maximum number of instances of the partition. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/PolicyViolationCompensationAction.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/PolicyViolationCompensationAction.cs index 5e5212d71498..57222883843a 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/PolicyViolationCompensationAction.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/PolicyViolationCompensationAction.cs @@ -10,12 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// - /// The compensating action to perform when a Monitored upgrade encounters monitoring policy or health policy violations. - /// Rollback specifies that the upgrade will start rolling back automatically. - /// Manual indicates that the upgrade will switch to UnmonitoredManual upgrade mode. - /// - /// + /// The compensating action to perform when a Monitored upgrade encounters monitoring policy or health policy violations. Invalid indicates the failure action is invalid. Rollback specifies that the upgrade will start rolling back automatically. Manual indicates that the upgrade will switch to UnmonitoredManual upgrade mode. public readonly partial struct PolicyViolationCompensationAction : IEquatable { private readonly string _value; @@ -30,9 +25,9 @@ public PolicyViolationCompensationAction(string value) private const string RollbackValue = "Rollback"; private const string ManualValue = "Manual"; - /// The upgrade will start rolling back automatically. The value is 0. + /// Indicates that a rollback of the upgrade will be performed by Service Fabric if the upgrade fails. public static PolicyViolationCompensationAction Rollback { get; } = new PolicyViolationCompensationAction(RollbackValue); - /// The upgrade will switch to UnmonitoredManual upgrade mode. The value is 1. + /// Indicates that a manual repair will need to be performed by the administrator if the upgrade fails. Service Fabric will not proceed to the next upgrade domain automatically. public static PolicyViolationCompensationAction Manual { get; } = new PolicyViolationCompensationAction(ManualValue); /// Determines if two values are the same. public static bool operator ==(PolicyViolationCompensationAction left, PolicyViolationCompensationAction right) => left.Equals(right); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/RollingUpgradeMonitoringPolicy.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/RollingUpgradeMonitoringPolicy.Serialization.cs index 7a6ccc0129dc..3fdae4af3a19 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/RollingUpgradeMonitoringPolicy.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/RollingUpgradeMonitoringPolicy.Serialization.cs @@ -37,15 +37,15 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit writer.WritePropertyName("failureAction"u8); writer.WriteStringValue(FailureAction.ToString()); writer.WritePropertyName("healthCheckWaitDuration"u8); - writer.WriteStringValue(HealthCheckWaitDuration, "c"); + writer.WriteStringValue(HealthCheckWaitDuration); writer.WritePropertyName("healthCheckStableDuration"u8); - writer.WriteStringValue(HealthCheckStableDuration, "c"); + writer.WriteStringValue(HealthCheckStableDuration); writer.WritePropertyName("healthCheckRetryTimeout"u8); - writer.WriteStringValue(HealthCheckRetryTimeout, "c"); + writer.WriteStringValue(HealthCheckRetryTimeout); writer.WritePropertyName("upgradeTimeout"u8); - writer.WriteStringValue(UpgradeTimeout, "c"); + writer.WriteStringValue(UpgradeTimeout); writer.WritePropertyName("upgradeDomainTimeout"u8); - writer.WriteStringValue(UpgradeDomainTimeout, "c"); + writer.WriteStringValue(UpgradeDomainTimeout); if (options.Format != "W" && _serializedAdditionalRawData != null) { foreach (var item in _serializedAdditionalRawData) @@ -84,11 +84,11 @@ internal static RollingUpgradeMonitoringPolicy DeserializeRollingUpgradeMonitori return null; } PolicyViolationCompensationAction failureAction = default; - TimeSpan healthCheckWaitDuration = default; - TimeSpan healthCheckStableDuration = default; - TimeSpan healthCheckRetryTimeout = default; - TimeSpan upgradeTimeout = default; - TimeSpan upgradeDomainTimeout = default; + string healthCheckWaitDuration = default; + string healthCheckStableDuration = default; + string healthCheckRetryTimeout = default; + string upgradeTimeout = default; + string upgradeDomainTimeout = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -100,27 +100,27 @@ internal static RollingUpgradeMonitoringPolicy DeserializeRollingUpgradeMonitori } if (property.NameEquals("healthCheckWaitDuration"u8)) { - healthCheckWaitDuration = property.Value.GetTimeSpan("c"); + healthCheckWaitDuration = property.Value.GetString(); continue; } if (property.NameEquals("healthCheckStableDuration"u8)) { - healthCheckStableDuration = property.Value.GetTimeSpan("c"); + healthCheckStableDuration = property.Value.GetString(); continue; } if (property.NameEquals("healthCheckRetryTimeout"u8)) { - healthCheckRetryTimeout = property.Value.GetTimeSpan("c"); + healthCheckRetryTimeout = property.Value.GetString(); continue; } if (property.NameEquals("upgradeTimeout"u8)) { - upgradeTimeout = property.Value.GetTimeSpan("c"); + upgradeTimeout = property.Value.GetString(); continue; } if (property.NameEquals("upgradeDomainTimeout"u8)) { - upgradeDomainTimeout = property.Value.GetTimeSpan("c"); + upgradeDomainTimeout = property.Value.GetString(); continue; } if (options.Format != "W") diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/RollingUpgradeMonitoringPolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/RollingUpgradeMonitoringPolicy.cs index 3155951d965d..594c1f91991e 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/RollingUpgradeMonitoringPolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/RollingUpgradeMonitoringPolicy.cs @@ -52,8 +52,15 @@ public partial class RollingUpgradeMonitoringPolicy /// The amount of time to retry health evaluation when the application or cluster is unhealthy before FailureAction is executed. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". /// The amount of time the overall upgrade has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". /// The amount of time each upgrade domain has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". - public RollingUpgradeMonitoringPolicy(PolicyViolationCompensationAction failureAction, TimeSpan healthCheckWaitDuration, TimeSpan healthCheckStableDuration, TimeSpan healthCheckRetryTimeout, TimeSpan upgradeTimeout, TimeSpan upgradeDomainTimeout) + /// , , , or is null. + public RollingUpgradeMonitoringPolicy(PolicyViolationCompensationAction failureAction, string healthCheckWaitDuration, string healthCheckStableDuration, string healthCheckRetryTimeout, string upgradeTimeout, string upgradeDomainTimeout) { + Argument.AssertNotNull(healthCheckWaitDuration, nameof(healthCheckWaitDuration)); + Argument.AssertNotNull(healthCheckStableDuration, nameof(healthCheckStableDuration)); + Argument.AssertNotNull(healthCheckRetryTimeout, nameof(healthCheckRetryTimeout)); + Argument.AssertNotNull(upgradeTimeout, nameof(upgradeTimeout)); + Argument.AssertNotNull(upgradeDomainTimeout, nameof(upgradeDomainTimeout)); + FailureAction = failureAction; HealthCheckWaitDuration = healthCheckWaitDuration; HealthCheckStableDuration = healthCheckStableDuration; @@ -70,7 +77,7 @@ public RollingUpgradeMonitoringPolicy(PolicyViolationCompensationAction failureA /// The amount of time the overall upgrade has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". /// The amount of time each upgrade domain has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". /// Keeps track of any properties unknown to the library. - internal RollingUpgradeMonitoringPolicy(PolicyViolationCompensationAction failureAction, TimeSpan healthCheckWaitDuration, TimeSpan healthCheckStableDuration, TimeSpan healthCheckRetryTimeout, TimeSpan upgradeTimeout, TimeSpan upgradeDomainTimeout, IDictionary serializedAdditionalRawData) + internal RollingUpgradeMonitoringPolicy(PolicyViolationCompensationAction failureAction, string healthCheckWaitDuration, string healthCheckStableDuration, string healthCheckRetryTimeout, string upgradeTimeout, string upgradeDomainTimeout, IDictionary serializedAdditionalRawData) { FailureAction = failureAction; HealthCheckWaitDuration = healthCheckWaitDuration; @@ -89,14 +96,14 @@ internal RollingUpgradeMonitoringPolicy() /// The compensating action to perform when a Monitored upgrade encounters monitoring policy or health policy violations. Invalid indicates the failure action is invalid. Rollback specifies that the upgrade will start rolling back automatically. Manual indicates that the upgrade will switch to UnmonitoredManual upgrade mode. public PolicyViolationCompensationAction FailureAction { get; set; } /// The amount of time to wait after completing an upgrade domain before applying health policies. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". - public TimeSpan HealthCheckWaitDuration { get; set; } + public string HealthCheckWaitDuration { get; set; } /// The amount of time that the application or cluster must remain healthy before the upgrade proceeds to the next upgrade domain. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". - public TimeSpan HealthCheckStableDuration { get; set; } + public string HealthCheckStableDuration { get; set; } /// The amount of time to retry health evaluation when the application or cluster is unhealthy before FailureAction is executed. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". - public TimeSpan HealthCheckRetryTimeout { get; set; } + public string HealthCheckRetryTimeout { get; set; } /// The amount of time the overall upgrade has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". - public TimeSpan UpgradeTimeout { get; set; } + public string UpgradeTimeout { get; set; } /// The amount of time each upgrade domain has to complete before FailureAction is executed. Cannot be larger than 12 hours. It is interpreted as a string representing an ISO 8601 duration with following format "hh:mm:ss.fff". - public TimeSpan UpgradeDomainTimeout { get; set; } + public string UpgradeDomainTimeout { get; set; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/SecurityEncryptionType.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/SecurityEncryptionType.cs new file mode 100644 index 000000000000..b4f83211485b --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/SecurityEncryptionType.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.ServiceFabricManagedClusters.Models +{ + /// Specifies the securityEncryptionType type of the nodeType. Only DiskWithVMGuestState and VMGuestStateOnly are currently supported. + public readonly partial struct SecurityEncryptionType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SecurityEncryptionType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DiskWithVmGuestStateValue = "DiskWithVMGuestState"; + private const string VmGuestStateOnlyValue = "VMGuestStateOnly"; + + /// For encryption of the managed disk along with VMGuestState blob. + public static SecurityEncryptionType DiskWithVmGuestState { get; } = new SecurityEncryptionType(DiskWithVmGuestStateValue); + /// For encryption of just the VMGuestState blob. + public static SecurityEncryptionType VmGuestStateOnly { get; } = new SecurityEncryptionType(VmGuestStateOnlyValue); + /// Determines if two values are the same. + public static bool operator ==(SecurityEncryptionType left, SecurityEncryptionType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SecurityEncryptionType left, SecurityEncryptionType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SecurityEncryptionType(string value) => new SecurityEncryptionType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SecurityEncryptionType other && Equals(other); + /// + public bool Equals(SecurityEncryptionType 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/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterIPConfiguration.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterIPConfiguration.cs index 95a9e61c9e45..b6ff38c0cdaa 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterIPConfiguration.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterIPConfiguration.cs @@ -63,7 +63,7 @@ public ServiceFabricManagedClusterIPConfiguration(string name) /// Initializes a new instance of . /// Name of the network interface. /// Specifies an array of references to backend address pools of application gateways. A node type can reference backend address pools of multiple application gateways. Multiple node types cannot use the same application gateway. - /// Specifies an array of references to backend address pools of load balancers. A node type can reference backend address pools of one public and one internal load balancer. Multiple node types cannot use the same basic sku load balancer. . + /// Specifies an array of references to backend address pools of load balancers. A node type can reference backend address pools of one public and one internal load balancer. Multiple node types cannot use the same basic sku load balancer. /// Specifies an array of references to inbound Nat pools of the load balancers. A node type can reference inbound nat pools of one public and one internal load balancer. Multiple node types cannot use the same basic sku load balancer. /// Specifies the subnet of the network interface. /// Specifies whether the IP configuration's private IP is IPv4 or IPv6. Default is IPv4. @@ -90,7 +90,7 @@ internal ServiceFabricManagedClusterIPConfiguration() public string Name { get; set; } /// Specifies an array of references to backend address pools of application gateways. A node type can reference backend address pools of multiple application gateways. Multiple node types cannot use the same application gateway. public IList ApplicationGatewayBackendAddressPools { get; } - /// Specifies an array of references to backend address pools of load balancers. A node type can reference backend address pools of one public and one internal load balancer. Multiple node types cannot use the same basic sku load balancer. . + /// Specifies an array of references to backend address pools of load balancers. A node type can reference backend address pools of one public and one internal load balancer. Multiple node types cannot use the same basic sku load balancer. public IList LoadBalancerBackendAddressPools { get; } /// Specifies an array of references to inbound Nat pools of the load balancers. A node type can reference inbound nat pools of one public and one internal load balancer. Multiple node types cannot use the same basic sku load balancer. public IList LoadBalancerInboundNatPools { get; } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterPrivateIPAddressVersion.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterPrivateIPAddressVersion.cs index 40a9677722a4..8e3e13588282 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterPrivateIPAddressVersion.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterPrivateIPAddressVersion.cs @@ -25,9 +25,9 @@ public ServiceFabricManagedClusterPrivateIPAddressVersion(string value) private const string IPv4Value = "IPv4"; private const string IPv6Value = "IPv6"; - /// IPv4. + /// The IP configuration's private IP is IPv4. public static ServiceFabricManagedClusterPrivateIPAddressVersion IPv4 { get; } = new ServiceFabricManagedClusterPrivateIPAddressVersion(IPv4Value); - /// IPv6. + /// The IP configuration's private IP is IPv6. public static ServiceFabricManagedClusterPrivateIPAddressVersion IPv6 { get; } = new ServiceFabricManagedClusterPrivateIPAddressVersion(IPv6Value); /// Determines if two values are the same. public static bool operator ==(ServiceFabricManagedClusterPrivateIPAddressVersion left, ServiceFabricManagedClusterPrivateIPAddressVersion right) => left.Equals(right); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterPublicIPAddressVersion.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterPublicIPAddressVersion.cs index 0364d55d0297..29653f7414db 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterPublicIPAddressVersion.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterPublicIPAddressVersion.cs @@ -25,9 +25,9 @@ public ServiceFabricManagedClusterPublicIPAddressVersion(string value) private const string IPv4Value = "IPv4"; private const string IPv6Value = "IPv6"; - /// IPv4. + /// The IP configuration's public IP is IPv4. public static ServiceFabricManagedClusterPublicIPAddressVersion IPv4 { get; } = new ServiceFabricManagedClusterPublicIPAddressVersion(IPv4Value); - /// IPv6. + /// The IP configuration's public IP is IPv6. public static ServiceFabricManagedClusterPublicIPAddressVersion IPv6 { get; } = new ServiceFabricManagedClusterPublicIPAddressVersion(IPv6Value); /// Determines if two values are the same. public static bool operator ==(ServiceFabricManagedClusterPublicIPAddressVersion left, ServiceFabricManagedClusterPublicIPAddressVersion right) => left.Equals(right); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterSecurityType.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterSecurityType.cs index e92b13e4d122..ebe1d44168a2 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterSecurityType.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterSecurityType.cs @@ -24,11 +24,14 @@ public ServiceFabricManagedClusterSecurityType(string value) private const string TrustedLaunchValue = "TrustedLaunch"; private const string StandardValue = "Standard"; + private const string ConfidentialVmValue = "ConfidentialVM"; /// Trusted Launch is a security type that secures generation 2 virtual machines. public static ServiceFabricManagedClusterSecurityType TrustedLaunch { get; } = new ServiceFabricManagedClusterSecurityType(TrustedLaunchValue); /// Standard is the default security type for all machines. public static ServiceFabricManagedClusterSecurityType Standard { get; } = new ServiceFabricManagedClusterSecurityType(StandardValue); + /// ConfidentialVM provides hardware-based encryption, trusted execution environment (TEE) and isolation of the VM memory & CPU from host. + public static ServiceFabricManagedClusterSecurityType ConfidentialVm { get; } = new ServiceFabricManagedClusterSecurityType(ConfidentialVmValue); /// Determines if two values are the same. public static bool operator ==(ServiceFabricManagedClusterSecurityType left, ServiceFabricManagedClusterSecurityType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterState.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterState.cs index fa7d0caddfcd..05f4888f6710 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterState.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterState.cs @@ -10,10 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// - /// The current state of the cluster. - /// - /// + /// The current state of the cluster. public readonly partial struct ServiceFabricManagedClusterState : IEquatable { private readonly string _value; diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterVersion.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterVersion.Serialization.cs index 8281f847c67c..0e63a8c1a87f 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterVersion.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedClusterVersion.Serialization.cs @@ -127,7 +127,7 @@ internal static ServiceFabricManagedClusterVersion DeserializeServiceFabricManag } if (property0.NameEquals("supportExpiryUtc"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) + if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedDataDiskType.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedDataDiskType.cs index 20a60bfafb70..d7b77f613fc3 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedDataDiskType.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedDataDiskType.cs @@ -10,10 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// - /// Managed data disk type. IOPS and throughput are given by the disk size, to see more information go to https://docs.microsoft.com/en-us/azure/virtual-machines/disks-types. - /// - /// + /// Managed data disk type. IOPS and throughput are given by the disk size, to see more information go to https://docs.microsoft.com/en-us/azure/virtual-machines/disks-types. public readonly partial struct ServiceFabricManagedDataDiskType : IEquatable { private readonly string _value; @@ -25,16 +22,25 @@ public ServiceFabricManagedDataDiskType(string value) _value = value ?? throw new ArgumentNullException(nameof(value)); } - private const string StandardLrsValue = "Standard_LRS"; - private const string StandardSsdLrsValue = "StandardSSD_LRS"; - private const string PremiumLrsValue = "Premium_LRS"; + private const string StandardLRSValue = "Standard_LRS"; + private const string StandardSSDLRSValue = "StandardSSD_LRS"; + private const string PremiumLRSValue = "Premium_LRS"; + private const string PremiumV2LRSValue = "PremiumV2_LRS"; + private const string StandardSSDZRSValue = "StandardSSD_ZRS"; + private const string PremiumZRSValue = "Premium_ZRS"; /// Standard HDD locally redundant storage. Best for backup, non-critical, and infrequent access. - public static ServiceFabricManagedDataDiskType StandardLrs { get; } = new ServiceFabricManagedDataDiskType(StandardLrsValue); + public static ServiceFabricManagedDataDiskType StandardLRS { get; } = new ServiceFabricManagedDataDiskType(StandardLRSValue); /// Standard SSD locally redundant storage. Best for web servers, lightly used enterprise applications and dev/test. - public static ServiceFabricManagedDataDiskType StandardSsdLrs { get; } = new ServiceFabricManagedDataDiskType(StandardSsdLrsValue); + public static ServiceFabricManagedDataDiskType StandardSSDLRS { get; } = new ServiceFabricManagedDataDiskType(StandardSSDLRSValue); /// Premium SSD locally redundant storage. Best for production and performance sensitive workloads. - public static ServiceFabricManagedDataDiskType PremiumLrs { get; } = new ServiceFabricManagedDataDiskType(PremiumLrsValue); + public static ServiceFabricManagedDataDiskType PremiumLRS { get; } = new ServiceFabricManagedDataDiskType(PremiumLRSValue); + /// Premium SSD V2 locally redundant storage. Best for production and performance sensitive workloads that consistently require low latency and high IOPS and throughput. + public static ServiceFabricManagedDataDiskType PremiumV2LRS { get; } = new ServiceFabricManagedDataDiskType(PremiumV2LRSValue); + /// Standard SSD zone redundant storage. Best for web servers, lightly used enterprise applications and dev/test that need storage resiliency against zone failures. + public static ServiceFabricManagedDataDiskType StandardSSDZRS { get; } = new ServiceFabricManagedDataDiskType(StandardSSDZRSValue); + /// Premium SSD zone redundant storage. Best for production workloads that need storage resiliency against zone failures. + public static ServiceFabricManagedDataDiskType PremiumZRS { get; } = new ServiceFabricManagedDataDiskType(PremiumZRSValue); /// Determines if two values are the same. public static bool operator ==(ServiceFabricManagedDataDiskType left, ServiceFabricManagedDataDiskType right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedNetworkSecurityRuleDirection.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedNetworkSecurityRuleDirection.cs index 39249cd693d9..70ddf5f08095 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedNetworkSecurityRuleDirection.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedNetworkSecurityRuleDirection.cs @@ -25,9 +25,9 @@ public ServiceFabricManagedNetworkSecurityRuleDirection(string value) private const string InboundValue = "inbound"; private const string OutboundValue = "outbound"; - /// inbound. + /// Inbound direction. public static ServiceFabricManagedNetworkSecurityRuleDirection Inbound { get; } = new ServiceFabricManagedNetworkSecurityRuleDirection(InboundValue); - /// outbound. + /// Outbound direction. public static ServiceFabricManagedNetworkSecurityRuleDirection Outbound { get; } = new ServiceFabricManagedNetworkSecurityRuleDirection(OutboundValue); /// Determines if two values are the same. public static bool operator ==(ServiceFabricManagedNetworkSecurityRuleDirection left, ServiceFabricManagedNetworkSecurityRuleDirection right) => left.Equals(right); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedNetworkTrafficAccess.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedNetworkTrafficAccess.cs index cc6e9b03b4b7..a320e84cfb55 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedNetworkTrafficAccess.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedNetworkTrafficAccess.cs @@ -25,9 +25,9 @@ public ServiceFabricManagedNetworkTrafficAccess(string value) private const string AllowValue = "allow"; private const string DenyValue = "deny"; - /// allow. + /// The network traffic is allowed. public static ServiceFabricManagedNetworkTrafficAccess Allow { get; } = new ServiceFabricManagedNetworkTrafficAccess(AllowValue); - /// deny. + /// The network traffic is denied. public static ServiceFabricManagedNetworkTrafficAccess Deny { get; } = new ServiceFabricManagedNetworkTrafficAccess(DenyValue); /// Determines if two values are the same. public static bool operator ==(ServiceFabricManagedNetworkTrafficAccess left, ServiceFabricManagedNetworkTrafficAccess right) => left.Equals(right); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedNsgProtocol.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedNsgProtocol.cs index d4964713d19d..1f466b3b767c 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedNsgProtocol.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedNsgProtocol.cs @@ -30,19 +30,19 @@ public ServiceFabricManagedNsgProtocol(string value) private const string AHValue = "ah"; private const string EspValue = "esp"; - /// http. + /// Protocol applies to HTTP. public static ServiceFabricManagedNsgProtocol Http { get; } = new ServiceFabricManagedNsgProtocol(HttpValue); - /// https. + /// Protocol applies to HTTPS. public static ServiceFabricManagedNsgProtocol Https { get; } = new ServiceFabricManagedNsgProtocol(HttpsValue); - /// tcp. + /// Protocol applies to TCP. public static ServiceFabricManagedNsgProtocol Tcp { get; } = new ServiceFabricManagedNsgProtocol(TcpValue); - /// udp. + /// Protocol applies to UDP. public static ServiceFabricManagedNsgProtocol Udp { get; } = new ServiceFabricManagedNsgProtocol(UdpValue); - /// icmp. + /// Protocol applies to ICMP. public static ServiceFabricManagedNsgProtocol Icmp { get; } = new ServiceFabricManagedNsgProtocol(IcmpValue); - /// ah. + /// Protocol applies to AH. public static ServiceFabricManagedNsgProtocol AH { get; } = new ServiceFabricManagedNsgProtocol(AHValue); - /// esp. + /// Protocol applies to ESP. public static ServiceFabricManagedNsgProtocol Esp { get; } = new ServiceFabricManagedNsgProtocol(EspValue); /// Determines if two values are the same. public static bool operator ==(ServiceFabricManagedNsgProtocol left, ServiceFabricManagedNsgProtocol right) => left.Equals(right); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedResourceProvisioningState.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedResourceProvisioningState.cs index 108b27d76f8b..1a7a121e303e 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedResourceProvisioningState.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceFabricManagedResourceProvisioningState.cs @@ -33,25 +33,25 @@ public ServiceFabricManagedResourceProvisioningState(string value) private const string DeletedValue = "Deleted"; private const string OtherValue = "Other"; - /// None. + /// The resource does not have a provisioning state. public static ServiceFabricManagedResourceProvisioningState None { get; } = new ServiceFabricManagedResourceProvisioningState(NoneValue); - /// Creating. + /// The resource is being created. public static ServiceFabricManagedResourceProvisioningState Creating { get; } = new ServiceFabricManagedResourceProvisioningState(CreatingValue); - /// Created. + /// The resource is created. public static ServiceFabricManagedResourceProvisioningState Created { get; } = new ServiceFabricManagedResourceProvisioningState(CreatedValue); - /// Updating. + /// The resource is being updated. public static ServiceFabricManagedResourceProvisioningState Updating { get; } = new ServiceFabricManagedResourceProvisioningState(UpdatingValue); - /// Succeeded. + /// The resource provisioning has succeeded. public static ServiceFabricManagedResourceProvisioningState Succeeded { get; } = new ServiceFabricManagedResourceProvisioningState(SucceededValue); - /// Failed. + /// The resource provisioning has failed. public static ServiceFabricManagedResourceProvisioningState Failed { get; } = new ServiceFabricManagedResourceProvisioningState(FailedValue); - /// Canceled. + /// The resource provisioning has been canceled. public static ServiceFabricManagedResourceProvisioningState Canceled { get; } = new ServiceFabricManagedResourceProvisioningState(CanceledValue); - /// Deleting. + /// The resource is being deleted. public static ServiceFabricManagedResourceProvisioningState Deleting { get; } = new ServiceFabricManagedResourceProvisioningState(DeletingValue); - /// Deleted. + /// The resource has been deleted. public static ServiceFabricManagedResourceProvisioningState Deleted { get; } = new ServiceFabricManagedResourceProvisioningState(DeletedValue); - /// Other. + /// The resource provisioning state is a state other than the previously specified states. public static ServiceFabricManagedResourceProvisioningState Other { get; } = new ServiceFabricManagedResourceProvisioningState(OtherValue); /// Determines if two values are the same. public static bool operator ==(ServiceFabricManagedResourceProvisioningState left, ServiceFabricManagedResourceProvisioningState right) => left.Equals(right); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementInvalidDomainPolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementInvalidDomainPolicy.cs index cff1f5445b2d..9ebfd004ef3b 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementInvalidDomainPolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementInvalidDomainPolicy.cs @@ -21,17 +21,17 @@ public ServicePlacementInvalidDomainPolicy(string domainName) Argument.AssertNotNull(domainName, nameof(domainName)); DomainName = domainName; - ServicePlacementPolicyType = ServicePlacementPolicyType.InvalidDomain; + Type = ServicePlacementPolicyType.InvalidDomain; } /// Initializes a new instance of . - /// The type of placement policy for a service fabric service. Following are the possible values. + /// /// Keeps track of any properties unknown to the library. /// The name of the domain that should not be used for placement. - internal ServicePlacementInvalidDomainPolicy(ServicePlacementPolicyType servicePlacementPolicyType, IDictionary serializedAdditionalRawData, string domainName) : base(servicePlacementPolicyType, serializedAdditionalRawData) + internal ServicePlacementInvalidDomainPolicy(ServicePlacementPolicyType type, IDictionary serializedAdditionalRawData, string domainName) : base(type, serializedAdditionalRawData) { DomainName = domainName; - ServicePlacementPolicyType = servicePlacementPolicyType; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementNonPartiallyPlaceServicePolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementNonPartiallyPlaceServicePolicy.cs index 7aa19caf4d91..ecd13bad6e39 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementNonPartiallyPlaceServicePolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementNonPartiallyPlaceServicePolicy.cs @@ -10,21 +10,21 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// ServicePlacementNonPartiallyPlaceServicePolicy. + /// The type of placement policy for a service fabric service. Following are the possible values. public partial class ServicePlacementNonPartiallyPlaceServicePolicy : ManagedServicePlacementPolicy { /// Initializes a new instance of . public ServicePlacementNonPartiallyPlaceServicePolicy() { - ServicePlacementPolicyType = ServicePlacementPolicyType.NonPartiallyPlaceService; + Type = ServicePlacementPolicyType.NonPartiallyPlaceService; } /// Initializes a new instance of . - /// The type of placement policy for a service fabric service. Following are the possible values. + /// /// Keeps track of any properties unknown to the library. - internal ServicePlacementNonPartiallyPlaceServicePolicy(ServicePlacementPolicyType servicePlacementPolicyType, IDictionary serializedAdditionalRawData) : base(servicePlacementPolicyType, serializedAdditionalRawData) + internal ServicePlacementNonPartiallyPlaceServicePolicy(ServicePlacementPolicyType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) { - ServicePlacementPolicyType = servicePlacementPolicyType; + Type = type; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementPreferPrimaryDomainPolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementPreferPrimaryDomainPolicy.cs index 86b67e4edbd6..eb7bd946493c 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementPreferPrimaryDomainPolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementPreferPrimaryDomainPolicy.cs @@ -19,7 +19,6 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models /// be located in a particular fault domain, which in geo-distributed scenarios usually aligns with regional /// or datacenter boundaries. Note that since this is an optimization it is possible that the Primary replica /// may not end up located in this domain due to failures, capacity limits, or other constraints. - /// /// public partial class ServicePlacementPreferPrimaryDomainPolicy : ManagedServicePlacementPolicy { @@ -31,17 +30,17 @@ public ServicePlacementPreferPrimaryDomainPolicy(string domainName) Argument.AssertNotNull(domainName, nameof(domainName)); DomainName = domainName; - ServicePlacementPolicyType = ServicePlacementPolicyType.PreferredPrimaryDomain; + Type = ServicePlacementPolicyType.PreferredPrimaryDomain; } /// Initializes a new instance of . - /// The type of placement policy for a service fabric service. Following are the possible values. + /// /// Keeps track of any properties unknown to the library. /// The name of the domain that should used for placement as per this policy. - internal ServicePlacementPreferPrimaryDomainPolicy(ServicePlacementPolicyType servicePlacementPolicyType, IDictionary serializedAdditionalRawData, string domainName) : base(servicePlacementPolicyType, serializedAdditionalRawData) + internal ServicePlacementPreferPrimaryDomainPolicy(ServicePlacementPolicyType type, IDictionary serializedAdditionalRawData, string domainName) : base(type, serializedAdditionalRawData) { DomainName = domainName; - ServicePlacementPolicyType = servicePlacementPolicyType; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementRequireDomainDistributionPolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementRequireDomainDistributionPolicy.cs index d28185f9259e..8b23ccfaad15 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementRequireDomainDistributionPolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementRequireDomainDistributionPolicy.cs @@ -20,7 +20,6 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models /// In the event that one of the datacenters goes offline, normally the replica that was placed in that /// datacenter will be packed into one of the remaining datacenters. If this is not desirable then this /// policy should be set. - /// /// public partial class ServicePlacementRequireDomainDistributionPolicy : ManagedServicePlacementPolicy { @@ -32,17 +31,17 @@ public ServicePlacementRequireDomainDistributionPolicy(string domainName) Argument.AssertNotNull(domainName, nameof(domainName)); DomainName = domainName; - ServicePlacementPolicyType = ServicePlacementPolicyType.RequiredDomainDistribution; + Type = ServicePlacementPolicyType.RequiredDomainDistribution; } /// Initializes a new instance of . - /// The type of placement policy for a service fabric service. Following are the possible values. + /// /// Keeps track of any properties unknown to the library. /// The name of the domain that should used for placement as per this policy. - internal ServicePlacementRequireDomainDistributionPolicy(ServicePlacementPolicyType servicePlacementPolicyType, IDictionary serializedAdditionalRawData, string domainName) : base(servicePlacementPolicyType, serializedAdditionalRawData) + internal ServicePlacementRequireDomainDistributionPolicy(ServicePlacementPolicyType type, IDictionary serializedAdditionalRawData, string domainName) : base(type, serializedAdditionalRawData) { DomainName = domainName; - ServicePlacementPolicyType = servicePlacementPolicyType; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementRequiredDomainPolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementRequiredDomainPolicy.cs index 8689e98740ad..c07a4630f0e5 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementRequiredDomainPolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServicePlacementRequiredDomainPolicy.cs @@ -21,17 +21,17 @@ public ServicePlacementRequiredDomainPolicy(string domainName) Argument.AssertNotNull(domainName, nameof(domainName)); DomainName = domainName; - ServicePlacementPolicyType = ServicePlacementPolicyType.RequiredDomain; + Type = ServicePlacementPolicyType.RequiredDomain; } /// Initializes a new instance of . - /// The type of placement policy for a service fabric service. Following are the possible values. + /// /// Keeps track of any properties unknown to the library. /// The name of the domain that should used for placement as per this policy. - internal ServicePlacementRequiredDomainPolicy(ServicePlacementPolicyType servicePlacementPolicyType, IDictionary serializedAdditionalRawData, string domainName) : base(servicePlacementPolicyType, serializedAdditionalRawData) + internal ServicePlacementRequiredDomainPolicy(ServicePlacementPolicyType type, IDictionary serializedAdditionalRawData, string domainName) : base(type, serializedAdditionalRawData) { DomainName = domainName; - ServicePlacementPolicyType = servicePlacementPolicyType; + Type = type; } /// Initializes a new instance of for deserialization. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceResourceList.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceResourceList.Serialization.cs index 7fb8aa1a2f9c..039d3ae7521c 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceResourceList.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceResourceList.Serialization.cs @@ -34,20 +34,17 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(ServiceResourceList)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(Value)) + writer.WritePropertyName("value"u8); + writer.WriteStartArray(); + foreach (var item in Value) { - writer.WritePropertyName("value"u8); - writer.WriteStartArray(); - foreach (var item in Value) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); + writer.WriteObjectValue(item, options); } - if (options.Format != "W" && Optional.IsDefined(NextLink)) + writer.WriteEndArray(); + if (Optional.IsDefined(NextLink)) { writer.WritePropertyName("nextLink"u8); - writer.WriteStringValue(NextLink); + writer.WriteStringValue(NextLink.AbsoluteUri); } if (options.Format != "W" && _serializedAdditionalRawData != null) { @@ -87,17 +84,13 @@ internal static ServiceResourceList DeserializeServiceResourceList(JsonElement e return null; } IReadOnlyList value = default; - string nextLink = default; + Uri nextLink = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { if (property.NameEquals("value"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } List array = new List(); foreach (var item in property.Value.EnumerateArray()) { @@ -108,7 +101,11 @@ internal static ServiceResourceList DeserializeServiceResourceList(JsonElement e } if (property.NameEquals("nextLink"u8)) { - nextLink = property.Value.GetString(); + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nextLink = new Uri(property.Value.GetString()); continue; } if (options.Format != "W") @@ -117,7 +114,7 @@ internal static ServiceResourceList DeserializeServiceResourceList(JsonElement e } } serializedAdditionalRawData = rawDataDictionary; - return new ServiceResourceList(value ?? new ChangeTrackingList(), nextLink, serializedAdditionalRawData); + return new ServiceResourceList(value, nextLink, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceResourceList.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceResourceList.cs index b68a170e23ab..37710bc7652f 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceResourceList.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceResourceList.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.Linq; namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { @@ -46,25 +47,34 @@ internal partial class ServiceResourceList private IDictionary _serializedAdditionalRawData; /// Initializes a new instance of . - internal ServiceResourceList() + /// The ServiceResource items on this page. + /// is null. + internal ServiceResourceList(IEnumerable value) { - Value = new ChangeTrackingList(); + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); } /// Initializes a new instance of . - /// - /// URL to get the next set of service list results if there are any. + /// The ServiceResource items on this page. + /// The link to the next page of items. /// Keeps track of any properties unknown to the library. - internal ServiceResourceList(IReadOnlyList value, string nextLink, IDictionary serializedAdditionalRawData) + internal ServiceResourceList(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) { Value = value; NextLink = nextLink; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// Gets the value. + /// Initializes a new instance of for deserialization. + internal ServiceResourceList() + { + } + + /// The ServiceResource items on this page. public IReadOnlyList Value { get; } - /// URL to get the next set of service list results if there are any. - public string NextLink { get; } + /// The link to the next page of items. + public Uri NextLink { get; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceTypeHealthPolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceTypeHealthPolicy.cs index abf72db581a0..6bc723f9336a 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceTypeHealthPolicy.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ServiceTypeHealthPolicy.cs @@ -10,10 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// - /// Represents the health policy used to evaluate the health of services belonging to a service type. - /// - /// + /// Represents the health policy used to evaluate the health of services belonging to a service type. public partial class ServiceTypeHealthPolicy { /// @@ -56,7 +53,6 @@ public partial class ServiceTypeHealthPolicy /// If the percentage is respected but there is at least one unhealthy service, the health is evaluated as Warning. /// This is calculated by dividing the number of unhealthy services of the specific service type over the total number of services of the specific service type. /// The computation rounds up to tolerate one failure on small numbers of services. - /// /// /// /// The maximum allowed percentage of unhealthy partitions per service. @@ -65,7 +61,6 @@ public partial class ServiceTypeHealthPolicy /// If the percentage is respected but there is at least one unhealthy partition, the health is evaluated as Warning. /// The percentage is calculated by dividing the number of unhealthy partitions over the total number of partitions in the service. /// The computation rounds up to tolerate one failure on small numbers of partitions. - /// /// /// /// The maximum allowed percentage of unhealthy replicas per partition. @@ -74,7 +69,6 @@ public partial class ServiceTypeHealthPolicy /// If the percentage is respected but there is at least one unhealthy replica, the health is evaluated as Warning. /// The percentage is calculated by dividing the number of unhealthy replicas over the total number of replicas in the partition. /// The computation rounds up to tolerate one failure on small numbers of replicas. - /// /// public ServiceTypeHealthPolicy(int maxPercentUnhealthyServices, int maxPercentUnhealthyPartitionsPerService, int maxPercentUnhealthyReplicasPerPartition) { @@ -91,7 +85,6 @@ public ServiceTypeHealthPolicy(int maxPercentUnhealthyServices, int maxPercentUn /// If the percentage is respected but there is at least one unhealthy service, the health is evaluated as Warning. /// This is calculated by dividing the number of unhealthy services of the specific service type over the total number of services of the specific service type. /// The computation rounds up to tolerate one failure on small numbers of services. - /// /// /// /// The maximum allowed percentage of unhealthy partitions per service. @@ -100,7 +93,6 @@ public ServiceTypeHealthPolicy(int maxPercentUnhealthyServices, int maxPercentUn /// If the percentage is respected but there is at least one unhealthy partition, the health is evaluated as Warning. /// The percentage is calculated by dividing the number of unhealthy partitions over the total number of partitions in the service. /// The computation rounds up to tolerate one failure on small numbers of partitions. - /// /// /// /// The maximum allowed percentage of unhealthy replicas per partition. @@ -109,7 +101,6 @@ public ServiceTypeHealthPolicy(int maxPercentUnhealthyServices, int maxPercentUn /// If the percentage is respected but there is at least one unhealthy replica, the health is evaluated as Warning. /// The percentage is calculated by dividing the number of unhealthy replicas over the total number of replicas in the partition. /// The computation rounds up to tolerate one failure on small numbers of replicas. - /// /// /// Keeps track of any properties unknown to the library. internal ServiceTypeHealthPolicy(int maxPercentUnhealthyServices, int maxPercentUnhealthyPartitionsPerService, int maxPercentUnhealthyReplicasPerPartition, IDictionary serializedAdditionalRawData) @@ -132,7 +123,6 @@ internal ServiceTypeHealthPolicy() /// If the percentage is respected but there is at least one unhealthy service, the health is evaluated as Warning. /// This is calculated by dividing the number of unhealthy services of the specific service type over the total number of services of the specific service type. /// The computation rounds up to tolerate one failure on small numbers of services. - /// /// public int MaxPercentUnhealthyServices { get; set; } /// @@ -142,7 +132,6 @@ internal ServiceTypeHealthPolicy() /// If the percentage is respected but there is at least one unhealthy partition, the health is evaluated as Warning. /// The percentage is calculated by dividing the number of unhealthy partitions over the total number of partitions in the service. /// The computation rounds up to tolerate one failure on small numbers of partitions. - /// /// public int MaxPercentUnhealthyPartitionsPerService { get; set; } /// @@ -152,7 +141,6 @@ internal ServiceTypeHealthPolicy() /// If the percentage is respected but there is at least one unhealthy replica, the health is evaluated as Warning. /// The percentage is calculated by dividing the number of unhealthy replicas over the total number of replicas in the partition. /// The computation rounds up to tolerate one failure on small numbers of replicas. - /// /// public int MaxPercentUnhealthyReplicasPerPartition { get; set; } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/SfmcOperationStatus.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/SfmcOperationStatus.cs new file mode 100644 index 000000000000..b326cec7d4fe --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/SfmcOperationStatus.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.ServiceFabricManagedClusters.Models +{ + /// Sfmc operation status. + public readonly partial struct SfmcOperationStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SfmcOperationStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string CreatedValue = "Created"; + private const string StartedValue = "Started"; + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string AbortedValue = "Aborted"; + private const string CanceledValue = "Canceled"; + + /// Operation created. + public static SfmcOperationStatus Created { get; } = new SfmcOperationStatus(CreatedValue); + /// Operation started. + public static SfmcOperationStatus Started { get; } = new SfmcOperationStatus(StartedValue); + /// Operation succeeded. + public static SfmcOperationStatus Succeeded { get; } = new SfmcOperationStatus(SucceededValue); + /// Operation failed. + public static SfmcOperationStatus Failed { get; } = new SfmcOperationStatus(FailedValue); + /// Operation aborted. + public static SfmcOperationStatus Aborted { get; } = new SfmcOperationStatus(AbortedValue); + /// Operation canceled. + public static SfmcOperationStatus Canceled { get; } = new SfmcOperationStatus(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(SfmcOperationStatus left, SfmcOperationStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SfmcOperationStatus left, SfmcOperationStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SfmcOperationStatus(string value) => new SfmcOperationStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SfmcOperationStatus other && Equals(other); + /// + public bool Equals(SfmcOperationStatus 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/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/SingletonPartitionScheme.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/SingletonPartitionScheme.cs index f65db2f707c3..53608354b2b2 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/SingletonPartitionScheme.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/SingletonPartitionScheme.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// SingletonPartitionScheme. + /// Describes the partition scheme of a singleton-partitioned, or non-partitioned service. public partial class SingletonPartitionScheme : ManagedServicePartitionScheme { /// Initializes a new instance of . @@ -20,7 +20,7 @@ public SingletonPartitionScheme() } /// Initializes a new instance of . - /// Specifies how the service is partitioned. + /// /// Keeps track of any properties unknown to the library. internal SingletonPartitionScheme(PartitionScheme partitionScheme, IDictionary serializedAdditionalRawData) : base(partitionScheme, serializedAdditionalRawData) { diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/StatefulServiceProperties.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/StatefulServiceProperties.Serialization.cs index 74904eabad7d..e9e371dbecf8 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/StatefulServiceProperties.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/StatefulServiceProperties.Serialization.cs @@ -53,22 +53,22 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri if (Optional.IsDefined(ReplicaRestartWaitDuration)) { writer.WritePropertyName("replicaRestartWaitDuration"u8); - writer.WriteStringValue(ReplicaRestartWaitDuration.Value, "c"); + writer.WriteStringValue(ReplicaRestartWaitDuration); } if (Optional.IsDefined(QuorumLossWaitDuration)) { writer.WritePropertyName("quorumLossWaitDuration"u8); - writer.WriteStringValue(QuorumLossWaitDuration.Value, "c"); + writer.WriteStringValue(QuorumLossWaitDuration); } if (Optional.IsDefined(StandByReplicaKeepDuration)) { writer.WritePropertyName("standByReplicaKeepDuration"u8); - writer.WriteStringValue(StandByReplicaKeepDuration.Value, "c"); + writer.WriteStringValue(StandByReplicaKeepDuration); } if (Optional.IsDefined(ServicePlacementTimeLimit)) { writer.WritePropertyName("servicePlacementTimeLimit"u8); - writer.WriteStringValue(ServicePlacementTimeLimit.Value, "c"); + writer.WriteStringValue(ServicePlacementTimeLimit); } } @@ -95,10 +95,10 @@ internal static StatefulServiceProperties DeserializeStatefulServiceProperties(J bool? hasPersistedState = default; int? targetReplicaSetSize = default; int? minReplicaSetSize = default; - TimeSpan? replicaRestartWaitDuration = default; - TimeSpan? quorumLossWaitDuration = default; - TimeSpan? standByReplicaKeepDuration = default; - TimeSpan? servicePlacementTimeLimit = default; + string replicaRestartWaitDuration = default; + string quorumLossWaitDuration = default; + string standByReplicaKeepDuration = default; + string servicePlacementTimeLimit = default; string provisioningState = default; ServiceKind serviceKind = default; string serviceTypeName = default; @@ -144,38 +144,22 @@ internal static StatefulServiceProperties DeserializeStatefulServiceProperties(J } if (property.NameEquals("replicaRestartWaitDuration"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - replicaRestartWaitDuration = property.Value.GetTimeSpan("c"); + replicaRestartWaitDuration = property.Value.GetString(); continue; } if (property.NameEquals("quorumLossWaitDuration"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - quorumLossWaitDuration = property.Value.GetTimeSpan("c"); + quorumLossWaitDuration = property.Value.GetString(); continue; } if (property.NameEquals("standByReplicaKeepDuration"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - standByReplicaKeepDuration = property.Value.GetTimeSpan("c"); + standByReplicaKeepDuration = property.Value.GetString(); continue; } if (property.NameEquals("servicePlacementTimeLimit"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - servicePlacementTimeLimit = property.Value.GetTimeSpan("c"); + servicePlacementTimeLimit = property.Value.GetString(); continue; } if (property.NameEquals("provisioningState"u8)) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/StatefulServiceProperties.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/StatefulServiceProperties.cs index 155996858673..9f1171dca31c 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/StatefulServiceProperties.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/StatefulServiceProperties.cs @@ -54,7 +54,6 @@ public StatefulServiceProperties(string serviceTypeName, ManagedServicePartition /// Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP). /// When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. /// When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable. - /// /// /// A flag indicating whether this is a persistent service which stores states on the local disk. If it is then the value of this property is true, if not it is false. /// The target replica set size as a number. @@ -63,7 +62,7 @@ public StatefulServiceProperties(string serviceTypeName, ManagedServicePartition /// The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format "hh:mm:ss". /// The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format "hh:mm:ss". /// The duration for which replicas can stay InBuild before reporting that build is stuck, represented in ISO 8601 format "hh:mm:ss". - internal StatefulServiceProperties(string placementConstraints, IList correlationScheme, IList serviceLoadMetrics, IList servicePlacementPolicies, ServiceFabricManagedServiceMoveCost? defaultMoveCost, IList scalingPolicies, IDictionary serializedAdditionalRawData, string provisioningState, ServiceKind serviceKind, string serviceTypeName, ManagedServicePartitionScheme partitionDescription, ManagedServicePackageActivationMode? servicePackageActivationMode, string serviceDnsName, bool? hasPersistedState, int? targetReplicaSetSize, int? minReplicaSetSize, TimeSpan? replicaRestartWaitDuration, TimeSpan? quorumLossWaitDuration, TimeSpan? standByReplicaKeepDuration, TimeSpan? servicePlacementTimeLimit) : base(placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost, scalingPolicies, serializedAdditionalRawData, provisioningState, serviceKind, serviceTypeName, partitionDescription, servicePackageActivationMode, serviceDnsName) + internal StatefulServiceProperties(string placementConstraints, IList correlationScheme, IList serviceLoadMetrics, IList servicePlacementPolicies, ServiceFabricManagedServiceMoveCost? defaultMoveCost, IList scalingPolicies, IDictionary serializedAdditionalRawData, string provisioningState, ServiceKind serviceKind, string serviceTypeName, ManagedServicePartitionScheme partitionDescription, ManagedServicePackageActivationMode? servicePackageActivationMode, string serviceDnsName, bool? hasPersistedState, int? targetReplicaSetSize, int? minReplicaSetSize, string replicaRestartWaitDuration, string quorumLossWaitDuration, string standByReplicaKeepDuration, string servicePlacementTimeLimit) : base(placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost, scalingPolicies, serializedAdditionalRawData, provisioningState, serviceKind, serviceTypeName, partitionDescription, servicePackageActivationMode, serviceDnsName) { HasPersistedState = hasPersistedState; TargetReplicaSetSize = targetReplicaSetSize; @@ -87,12 +86,12 @@ internal StatefulServiceProperties() /// The minimum replica set size as a number. public int? MinReplicaSetSize { get; set; } /// The duration between when a replica goes down and when a new replica is created, represented in ISO 8601 format "hh:mm:ss". - public TimeSpan? ReplicaRestartWaitDuration { get; set; } + public string ReplicaRestartWaitDuration { get; set; } /// The maximum duration for which a partition is allowed to be in a state of quorum loss, represented in ISO 8601 format "hh:mm:ss". - public TimeSpan? QuorumLossWaitDuration { get; set; } + public string QuorumLossWaitDuration { get; set; } /// The definition on how long StandBy replicas should be maintained before being removed, represented in ISO 8601 format "hh:mm:ss". - public TimeSpan? StandByReplicaKeepDuration { get; set; } + public string StandByReplicaKeepDuration { get; set; } /// The duration for which replicas can stay InBuild before reporting that build is stuck, represented in ISO 8601 format "hh:mm:ss". - public TimeSpan? ServicePlacementTimeLimit { get; set; } + public string ServicePlacementTimeLimit { get; set; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/StatelessServiceProperties.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/StatelessServiceProperties.cs index 93129f40d5e1..fd3d6be14ccb 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/StatelessServiceProperties.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/StatelessServiceProperties.cs @@ -56,7 +56,6 @@ public StatelessServiceProperties(string serviceTypeName, ManagedServicePartitio /// Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP). /// When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. /// When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable. - /// /// /// The instance count. /// MinInstanceCount is the minimum number of instances that must be up to meet the EnsureAvailability safety check during operations like upgrade or deactivate node. The actual number that is used is max( MinInstanceCount, ceil( MinInstancePercentage/100.0 * InstanceCount) ). Note, if InstanceCount is set to -1, during MinInstanceCount computation -1 is first converted into the number of nodes on which the instances are allowed to be placed according to the placement constraints on the service. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UniformInt64RangePartitionScheme.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UniformInt64RangePartitionScheme.cs index 67b928a41677..5bf473d31704 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UniformInt64RangePartitionScheme.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UniformInt64RangePartitionScheme.cs @@ -18,12 +18,10 @@ public partial class UniformInt64RangePartitionScheme : ManagedServicePartitionS /// /// The lower bound of the partition key range that /// should be split between the partition ‘Count’ - /// /// /// /// The upper bound of the partition key range that /// should be split between the partition ‘Count’ - /// /// public UniformInt64RangePartitionScheme(int count, long lowKey, long highKey) { @@ -34,18 +32,16 @@ public UniformInt64RangePartitionScheme(int count, long lowKey, long highKey) } /// Initializes a new instance of . - /// Specifies how the service is partitioned. + /// /// Keeps track of any properties unknown to the library. /// The number of partitions. /// /// The lower bound of the partition key range that /// should be split between the partition ‘Count’ - /// /// /// /// The upper bound of the partition key range that /// should be split between the partition ‘Count’ - /// /// internal UniformInt64RangePartitionScheme(PartitionScheme partitionScheme, IDictionary serializedAdditionalRawData, int count, long lowKey, long highKey) : base(partitionScheme, serializedAdditionalRawData) { @@ -65,13 +61,11 @@ internal UniformInt64RangePartitionScheme() /// /// The lower bound of the partition key range that /// should be split between the partition ‘Count’ - /// /// public long LowKey { get; set; } /// /// The upper bound of the partition key range that /// should be split between the partition ‘Count’ - /// /// public long HighKey { get; set; } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownFaultSimulationContent.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownFaultSimulationContent.Serialization.cs new file mode 100644 index 000000000000..cce1d457a695 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownFaultSimulationContent.Serialization.cs @@ -0,0 +1,130 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.ServiceFabricManagedClusters.Models +{ + internal partial class UnknownFaultSimulationContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FaultSimulationContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + FaultSimulationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FaultSimulationContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFaultSimulationContent(document.RootElement, options); + } + + internal static UnknownFaultSimulationContent DeserializeUnknownFaultSimulationContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FaultKind faultKind = "Unknown"; + bool? force = default; + FaultSimulationConstraints constraints = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("faultKind"u8)) + { + faultKind = new FaultKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("force"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + force = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("constraints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + constraints = FaultSimulationConstraints.DeserializeFaultSimulationConstraints(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownFaultSimulationContent(faultKind, force, constraints, serializedAdditionalRawData); + } + + BinaryData 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(FaultSimulationContent)} does not support writing '{options.Format}' format."); + } + } + + FaultSimulationContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFaultSimulationContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FaultSimulationContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownFaultSimulationContent.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownFaultSimulationContent.cs new file mode 100644 index 000000000000..d150971bc6db --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownFaultSimulationContent.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + /// Unknown version of FaultSimulationContent. + internal partial class UnknownFaultSimulationContent : FaultSimulationContent + { + /// Initializes a new instance of . + /// The kind of fault to be simulated. + /// Force the action to go through without any check on the cluster. + /// Constraints for Fault Simulation action. + /// Keeps track of any properties unknown to the library. + internal UnknownFaultSimulationContent(FaultKind faultKind, bool? force, FaultSimulationConstraints constraints, IDictionary serializedAdditionalRawData) : base(faultKind, force, constraints, serializedAdditionalRawData) + { + FaultKind = faultKind; + } + + /// Initializes a new instance of for deserialization. + internal UnknownFaultSimulationContent() + { + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownPartition.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServicePartitionScheme.Serialization.cs similarity index 92% rename from sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownPartition.Serialization.cs rename to sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServicePartitionScheme.Serialization.cs index 7042e245e50f..ea8c031cd1b8 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownPartition.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServicePartitionScheme.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - internal partial class UnknownPartition : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownManagedServicePartitionScheme : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -49,7 +49,7 @@ ManagedServicePartitionScheme IJsonModel.Create(r return DeserializeManagedServicePartitionScheme(document.RootElement, options); } - internal static UnknownPartition DeserializeUnknownPartition(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownManagedServicePartitionScheme DeserializeUnknownManagedServicePartitionScheme(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -73,7 +73,7 @@ internal static UnknownPartition DeserializeUnknownPartition(JsonElement element } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownPartition(partitionScheme, serializedAdditionalRawData); + return new UnknownManagedServicePartitionScheme(partitionScheme, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownPartition.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServicePartitionScheme.cs similarity index 50% rename from sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownPartition.cs rename to sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServicePartitionScheme.cs index 9d8e065b17dc..837a8816aaec 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownPartition.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServicePartitionScheme.cs @@ -10,19 +10,19 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// Unknown version of Partition. - internal partial class UnknownPartition : ManagedServicePartitionScheme + /// Unknown version of ManagedServicePartitionScheme. + internal partial class UnknownManagedServicePartitionScheme : ManagedServicePartitionScheme { - /// Initializes a new instance of . - /// Specifies how the service is partitioned. + /// Initializes a new instance of . + /// /// Keeps track of any properties unknown to the library. - internal UnknownPartition(PartitionScheme partitionScheme, IDictionary serializedAdditionalRawData) : base(partitionScheme, serializedAdditionalRawData) + internal UnknownManagedServicePartitionScheme(PartitionScheme partitionScheme, IDictionary serializedAdditionalRawData) : base(partitionScheme, serializedAdditionalRawData) { PartitionScheme = partitionScheme; } - /// Initializes a new instance of for deserialization. - internal UnknownPartition() + /// Initializes a new instance of for deserialization. + internal UnknownManagedServicePartitionScheme() { } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownServicePlacementPolicy.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServicePlacementPolicy.Serialization.cs similarity index 92% rename from sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownServicePlacementPolicy.Serialization.cs rename to sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServicePlacementPolicy.Serialization.cs index 7a5961edc0eb..7d905ac05280 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownServicePlacementPolicy.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServicePlacementPolicy.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - internal partial class UnknownServicePlacementPolicy : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownManagedServicePlacementPolicy : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -49,7 +49,7 @@ ManagedServicePlacementPolicy IJsonModel.Create(r return DeserializeManagedServicePlacementPolicy(document.RootElement, options); } - internal static UnknownServicePlacementPolicy DeserializeUnknownServicePlacementPolicy(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownManagedServicePlacementPolicy DeserializeUnknownManagedServicePlacementPolicy(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -73,7 +73,7 @@ internal static UnknownServicePlacementPolicy DeserializeUnknownServicePlacement } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownServicePlacementPolicy(type, serializedAdditionalRawData); + return new UnknownManagedServicePlacementPolicy(type, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServicePlacementPolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServicePlacementPolicy.cs new file mode 100644 index 000000000000..2674fd4598d3 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServicePlacementPolicy.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + /// Unknown version of ManagedServicePlacementPolicy. + internal partial class UnknownManagedServicePlacementPolicy : ManagedServicePlacementPolicy + { + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal UnknownManagedServicePlacementPolicy(ServicePlacementPolicyType type, IDictionary serializedAdditionalRawData) : base(type, serializedAdditionalRawData) + { + Type = type; + } + + /// Initializes a new instance of for deserialization. + internal UnknownManagedServicePlacementPolicy() + { + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownServiceResourceProperties.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceProperties.Serialization.cs similarity index 96% rename from sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownServiceResourceProperties.Serialization.cs rename to sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceProperties.Serialization.cs index 2b1f900d7fbd..1973badd8c40 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownServiceResourceProperties.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceProperties.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - internal partial class UnknownServiceResourceProperties : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownManagedServiceProperties : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -49,7 +49,7 @@ ManagedServiceProperties IJsonModel.Create(ref Utf8Jso return DeserializeManagedServiceProperties(document.RootElement, options); } - internal static UnknownServiceResourceProperties DeserializeUnknownServiceResourceProperties(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownManagedServiceProperties DeserializeUnknownManagedServiceProperties(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -183,7 +183,7 @@ internal static UnknownServiceResourceProperties DeserializeUnknownServiceResour } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownServiceResourceProperties( + return new UnknownManagedServiceProperties( placementConstraints, correlationScheme ?? new ChangeTrackingList(), serviceLoadMetrics ?? new ChangeTrackingList(), diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownServiceResourceProperties.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceProperties.cs similarity index 74% rename from sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownServiceResourceProperties.cs rename to sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceProperties.cs index cdab207081e0..db7381e5d678 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownServiceResourceProperties.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceProperties.cs @@ -10,10 +10,10 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// Unknown version of ServiceResourceProperties. - internal partial class UnknownServiceResourceProperties : ManagedServiceProperties + /// Unknown version of ManagedServiceProperties. + internal partial class UnknownManagedServiceProperties : ManagedServiceProperties { - /// Initializes a new instance of . + /// Initializes a new instance of . /// The placement constraints as a string. Placement constraints are boolean expressions on node properties and allow for restricting a service to particular nodes based on the service requirements. For example, to place a service on nodes where NodeType is blue specify the following: "NodeColor == blue)". /// A list that describes the correlation of the service with other services. /// The service load metrics is given as an array of ServiceLoadMetric objects. @@ -38,15 +38,14 @@ internal partial class UnknownServiceResourceProperties : ManagedServiceProperti /// Dns name used for the service. If this is specified, then the DNS name can be used to return the IP addresses of service endpoints for application layer protocols (e.g., HTTP). /// When updating serviceDnsName, old name may be temporarily resolvable. However, rely on new name. /// When removing serviceDnsName, removed name may temporarily be resolvable. Do not rely on the name being unresolvable. - /// /// - internal UnknownServiceResourceProperties(string placementConstraints, IList correlationScheme, IList serviceLoadMetrics, IList servicePlacementPolicies, ServiceFabricManagedServiceMoveCost? defaultMoveCost, IList scalingPolicies, IDictionary serializedAdditionalRawData, string provisioningState, ServiceKind serviceKind, string serviceTypeName, ManagedServicePartitionScheme partitionDescription, ManagedServicePackageActivationMode? servicePackageActivationMode, string serviceDnsName) : base(placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost, scalingPolicies, serializedAdditionalRawData, provisioningState, serviceKind, serviceTypeName, partitionDescription, servicePackageActivationMode, serviceDnsName) + internal UnknownManagedServiceProperties(string placementConstraints, IList correlationScheme, IList serviceLoadMetrics, IList servicePlacementPolicies, ServiceFabricManagedServiceMoveCost? defaultMoveCost, IList scalingPolicies, IDictionary serializedAdditionalRawData, string provisioningState, ServiceKind serviceKind, string serviceTypeName, ManagedServicePartitionScheme partitionDescription, ManagedServicePackageActivationMode? servicePackageActivationMode, string serviceDnsName) : base(placementConstraints, correlationScheme, serviceLoadMetrics, servicePlacementPolicies, defaultMoveCost, scalingPolicies, serializedAdditionalRawData, provisioningState, serviceKind, serviceTypeName, partitionDescription, servicePackageActivationMode, serviceDnsName) { ServiceKind = serviceKind; } - /// Initializes a new instance of for deserialization. - internal UnknownServiceResourceProperties() + /// Initializes a new instance of for deserialization. + internal UnknownManagedServiceProperties() { } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownScalingMechanism.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceScalingMechanism.Serialization.cs similarity index 92% rename from sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownScalingMechanism.Serialization.cs rename to sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceScalingMechanism.Serialization.cs index c3ab717e4451..885a61b12d73 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownScalingMechanism.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceScalingMechanism.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - internal partial class UnknownScalingMechanism : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownManagedServiceScalingMechanism : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -49,7 +49,7 @@ ManagedServiceScalingMechanism IJsonModel.Create return DeserializeManagedServiceScalingMechanism(document.RootElement, options); } - internal static UnknownScalingMechanism DeserializeUnknownScalingMechanism(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownManagedServiceScalingMechanism DeserializeUnknownManagedServiceScalingMechanism(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -73,7 +73,7 @@ internal static UnknownScalingMechanism DeserializeUnknownScalingMechanism(JsonE } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownScalingMechanism(kind, serializedAdditionalRawData); + return new UnknownManagedServiceScalingMechanism(kind, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceScalingMechanism.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceScalingMechanism.cs new file mode 100644 index 000000000000..6de1727919c7 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceScalingMechanism.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + /// Unknown version of ManagedServiceScalingMechanism. + internal partial class UnknownManagedServiceScalingMechanism : ManagedServiceScalingMechanism + { + /// Initializes a new instance of . + /// + /// Keeps track of any properties unknown to the library. + internal UnknownManagedServiceScalingMechanism(ServiceScalingMechanismKind kind, IDictionary serializedAdditionalRawData) : base(kind, serializedAdditionalRawData) + { + Kind = kind; + } + + /// Initializes a new instance of for deserialization. + internal UnknownManagedServiceScalingMechanism() + { + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownScalingTrigger.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceScalingTrigger.Serialization.cs similarity index 92% rename from sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownScalingTrigger.Serialization.cs rename to sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceScalingTrigger.Serialization.cs index 165f583ba389..611af9836507 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownScalingTrigger.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceScalingTrigger.Serialization.cs @@ -13,7 +13,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - internal partial class UnknownScalingTrigger : IUtf8JsonSerializable, IJsonModel + internal partial class UnknownManagedServiceScalingTrigger : IUtf8JsonSerializable, IJsonModel { void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); @@ -49,7 +49,7 @@ ManagedServiceScalingTrigger IJsonModel.Create(ref return DeserializeManagedServiceScalingTrigger(document.RootElement, options); } - internal static UnknownScalingTrigger DeserializeUnknownScalingTrigger(JsonElement element, ModelReaderWriterOptions options = null) + internal static UnknownManagedServiceScalingTrigger DeserializeUnknownManagedServiceScalingTrigger(JsonElement element, ModelReaderWriterOptions options = null) { options ??= ModelSerializationExtensions.WireOptions; @@ -73,7 +73,7 @@ internal static UnknownScalingTrigger DeserializeUnknownScalingTrigger(JsonEleme } } serializedAdditionalRawData = rawDataDictionary; - return new UnknownScalingTrigger(kind, serializedAdditionalRawData); + return new UnknownManagedServiceScalingTrigger(kind, serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownScalingMechanism.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceScalingTrigger.cs similarity index 50% rename from sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownScalingMechanism.cs rename to sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceScalingTrigger.cs index c3924d9086b9..7406dd5d9a07 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownScalingMechanism.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownManagedServiceScalingTrigger.cs @@ -10,19 +10,19 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// Unknown version of ScalingMechanism. - internal partial class UnknownScalingMechanism : ManagedServiceScalingMechanism + /// Unknown version of ManagedServiceScalingTrigger. + internal partial class UnknownManagedServiceScalingTrigger : ManagedServiceScalingTrigger { - /// Initializes a new instance of . - /// Specifies the mechanism associated with this scaling policy. + /// Initializes a new instance of . + /// /// Keeps track of any properties unknown to the library. - internal UnknownScalingMechanism(ServiceScalingMechanismKind kind, IDictionary serializedAdditionalRawData) : base(kind, serializedAdditionalRawData) + internal UnknownManagedServiceScalingTrigger(ServiceScalingTriggerKind kind, IDictionary serializedAdditionalRawData) : base(kind, serializedAdditionalRawData) { Kind = kind; } - /// Initializes a new instance of for deserialization. - internal UnknownScalingMechanism() + /// Initializes a new instance of for deserialization. + internal UnknownManagedServiceScalingTrigger() { } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownScalingTrigger.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownScalingTrigger.cs deleted file mode 100644 index 170529134bd4..000000000000 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownScalingTrigger.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models -{ - /// Unknown version of ScalingTrigger. - internal partial class UnknownScalingTrigger : ManagedServiceScalingTrigger - { - /// Initializes a new instance of . - /// Specifies the trigger associated with this scaling policy. - /// Keeps track of any properties unknown to the library. - internal UnknownScalingTrigger(ServiceScalingTriggerKind kind, IDictionary serializedAdditionalRawData) : base(kind, serializedAdditionalRawData) - { - Kind = kind; - } - - /// Initializes a new instance of for deserialization. - internal UnknownScalingTrigger() - { - } - } -} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownServicePlacementPolicy.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownServicePlacementPolicy.cs deleted file mode 100644 index 11a95e1f3b96..000000000000 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/UnknownServicePlacementPolicy.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -// - -#nullable disable - -using System; -using System.Collections.Generic; - -namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models -{ - /// Unknown version of ServicePlacementPolicy. - internal partial class UnknownServicePlacementPolicy : ManagedServicePlacementPolicy - { - /// Initializes a new instance of . - /// The type of placement policy for a service fabric service. Following are the possible values. - /// Keeps track of any properties unknown to the library. - internal UnknownServicePlacementPolicy(ServicePlacementPolicyType servicePlacementPolicyType, IDictionary serializedAdditionalRawData) : base(servicePlacementPolicyType, serializedAdditionalRawData) - { - ServicePlacementPolicyType = servicePlacementPolicyType; - } - - /// Initializes a new instance of for deserialization. - internal UnknownServicePlacementPolicy() - { - } - } -} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmImagePlan.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmImagePlan.cs index 14f95717e1d4..1d375b50c5a7 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmImagePlan.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmImagePlan.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started ->. Enter any required information and then click Save. + /// Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click Want to deploy programmatically, Get Started. Enter any required information and then click Save. public partial class VmImagePlan { /// diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmManagedIdentity.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmManagedIdentity.Serialization.cs index 7e2286264455..f82f73ea4454 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmManagedIdentity.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmManagedIdentity.Serialization.cs @@ -34,17 +34,12 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(VmManagedIdentity)} does not support writing '{format}' format."); } - if (Optional.IsCollectionDefined(UserAssignedIdentities)) + if (Optional.IsCollectionDefined(ArmId)) { writer.WritePropertyName("userAssignedIdentities"u8); writer.WriteStartArray(); - foreach (var item in UserAssignedIdentities) + foreach (var item in ArmId) { - if (item == null) - { - writer.WriteNullValue(); - continue; - } writer.WriteStringValue(item); } writer.WriteEndArray(); @@ -86,7 +81,7 @@ internal static VmManagedIdentity DeserializeVmManagedIdentity(JsonElement eleme { return null; } - IList userAssignedIdentities = default; + IList userAssignedIdentities = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -97,17 +92,10 @@ internal static VmManagedIdentity DeserializeVmManagedIdentity(JsonElement eleme { continue; } - List array = new List(); + List array = new List(); foreach (var item in property.Value.EnumerateArray()) { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(new ResourceIdentifier(item.GetString())); - } + array.Add(item.GetString()); } userAssignedIdentities = array; continue; @@ -118,7 +106,7 @@ internal static VmManagedIdentity DeserializeVmManagedIdentity(JsonElement eleme } } serializedAdditionalRawData = rawDataDictionary; - return new VmManagedIdentity(userAssignedIdentities ?? new ChangeTrackingList(), serializedAdditionalRawData); + return new VmManagedIdentity(userAssignedIdentities ?? new ChangeTrackingList(), serializedAdditionalRawData); } BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmManagedIdentity.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmManagedIdentity.cs index 06c1b954a85d..d5f4eba84fcc 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmManagedIdentity.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmManagedIdentity.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using Azure.Core; namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { @@ -49,19 +48,19 @@ internal partial class VmManagedIdentity /// Initializes a new instance of . public VmManagedIdentity() { - UserAssignedIdentities = new ChangeTrackingList(); + ArmId = new ChangeTrackingList(); } /// Initializes a new instance of . - /// The list of user identities associated with the virtual machine scale set under the node type. Each entry will be an ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + /// The list of user identities associated with the virtual machine scale set under the node type. Each entry will be an ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. /// Keeps track of any properties unknown to the library. - internal VmManagedIdentity(IList userAssignedIdentities, IDictionary serializedAdditionalRawData) + internal VmManagedIdentity(IList armId, IDictionary serializedAdditionalRawData) { - UserAssignedIdentities = userAssignedIdentities; + ArmId = armId; _serializedAdditionalRawData = serializedAdditionalRawData; } /// The list of user identities associated with the virtual machine scale set under the node type. Each entry will be an ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - public IList UserAssignedIdentities { get; } + public IList ArmId { get; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesProtectedSettings.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesProtectedSettings.Serialization.cs new file mode 100644 index 000000000000..36e2148ead7e --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesProtectedSettings.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + public partial class VmSSExtensionPropertiesProtectedSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(VmSSExtensionPropertiesProtectedSettings)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + VmSSExtensionPropertiesProtectedSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VmSSExtensionPropertiesProtectedSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVmSSExtensionPropertiesProtectedSettings(document.RootElement, options); + } + + internal static VmSSExtensionPropertiesProtectedSettings DeserializeVmSSExtensionPropertiesProtectedSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VmSSExtensionPropertiesProtectedSettings(serializedAdditionalRawData); + } + + BinaryData 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(VmSSExtensionPropertiesProtectedSettings)} does not support writing '{options.Format}' format."); + } + } + + VmSSExtensionPropertiesProtectedSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVmSSExtensionPropertiesProtectedSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VmSSExtensionPropertiesProtectedSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesProtectedSettings.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesProtectedSettings.cs new file mode 100644 index 000000000000..e12127408216 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesProtectedSettings.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + /// The VmSSExtensionPropertiesProtectedSettings. + public partial class VmSSExtensionPropertiesProtectedSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 VmSSExtensionPropertiesProtectedSettings() + { + } + + /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + internal VmSSExtensionPropertiesProtectedSettings(IDictionary serializedAdditionalRawData) + { + _serializedAdditionalRawData = serializedAdditionalRawData; + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesSettings.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesSettings.Serialization.cs new file mode 100644 index 000000000000..52d469171fd9 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesSettings.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + public partial class VmSSExtensionPropertiesSettings : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(VmSSExtensionPropertiesSettings)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + VmSSExtensionPropertiesSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VmSSExtensionPropertiesSettings)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVmSSExtensionPropertiesSettings(document.RootElement, options); + } + + internal static VmSSExtensionPropertiesSettings DeserializeVmSSExtensionPropertiesSettings(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VmSSExtensionPropertiesSettings(serializedAdditionalRawData); + } + + BinaryData 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(VmSSExtensionPropertiesSettings)} does not support writing '{options.Format}' format."); + } + } + + VmSSExtensionPropertiesSettings IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVmSSExtensionPropertiesSettings(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VmSSExtensionPropertiesSettings)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesSettings.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesSettings.cs new file mode 100644 index 000000000000..41e140051ab1 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmSSExtensionPropertiesSettings.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + /// The VmSSExtensionPropertiesSettings. + public partial class VmSSExtensionPropertiesSettings + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 VmSSExtensionPropertiesSettings() + { + } + + /// Initializes a new instance of . + /// Keeps track of any properties unknown to the library. + internal VmSSExtensionPropertiesSettings(IDictionary serializedAdditionalRawData) + { + _serializedAdditionalRawData = serializedAdditionalRawData; + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmssExtensionSetupOrder.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmssExtensionSetupOrder.cs index 8f16c4924940..98c99b5c76fa 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmssExtensionSetupOrder.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/VmssExtensionSetupOrder.cs @@ -10,10 +10,7 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models { - /// - /// Vm extension setup order. - /// - /// + /// Vm extension setup order. public readonly partial struct VmssExtensionSetupOrder : IEquatable { private readonly string _value; diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ZoneFaultSimulationContent.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ZoneFaultSimulationContent.Serialization.cs new file mode 100644 index 000000000000..3fb4e03ebaf9 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ZoneFaultSimulationContent.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.ServiceFabricManagedClusters.Models +{ + public partial class ZoneFaultSimulationContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ZoneFaultSimulationContent)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsCollectionDefined(Zones)) + { + writer.WritePropertyName("zones"u8); + writer.WriteStartArray(); + foreach (var item in Zones) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + } + + ZoneFaultSimulationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ZoneFaultSimulationContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeZoneFaultSimulationContent(document.RootElement, options); + } + + internal static ZoneFaultSimulationContent DeserializeZoneFaultSimulationContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList zones = default; + FaultKind faultKind = default; + bool? force = default; + FaultSimulationConstraints constraints = 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("faultKind"u8)) + { + faultKind = new FaultKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("force"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + force = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("constraints"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + constraints = FaultSimulationConstraints.DeserializeFaultSimulationConstraints(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ZoneFaultSimulationContent(faultKind, force, constraints, serializedAdditionalRawData, zones ?? new ChangeTrackingList()); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(ZoneFaultSimulationContent)} does not support writing '{options.Format}' format."); + } + } + + ZoneFaultSimulationContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeZoneFaultSimulationContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ZoneFaultSimulationContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ZoneFaultSimulationContent.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ZoneFaultSimulationContent.cs new file mode 100644 index 000000000000..7b735ef01745 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/Models/ZoneFaultSimulationContent.cs @@ -0,0 +1,38 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters.Models +{ + /// Parameters for Zone Fault Simulation action. + public partial class ZoneFaultSimulationContent : FaultSimulationContent + { + /// Initializes a new instance of . + public ZoneFaultSimulationContent() + { + Zones = new ChangeTrackingList(); + FaultKind = FaultKind.Zone; + } + + /// Initializes a new instance of . + /// The kind of fault to be simulated. + /// Force the action to go through without any check on the cluster. + /// Constraints for Fault Simulation action. + /// Keeps track of any properties unknown to the library. + /// Indicates the zones of the fault simulation. + internal ZoneFaultSimulationContent(FaultKind faultKind, bool? force, FaultSimulationConstraints constraints, IDictionary serializedAdditionalRawData, IList zones) : base(faultKind, force, constraints, serializedAdditionalRawData) + { + Zones = zones; + FaultKind = faultKind; + } + + /// Indicates the zones of the fault simulation. + public IList Zones { get; } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ApplicationTypeVersionsRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ApplicationTypeVersionsRestOperations.cs index 93cabb6d0fa1..4300bba394b2 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ApplicationTypeVersionsRestOperations.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ApplicationTypeVersionsRestOperations.cs @@ -25,14 +25,14 @@ internal partial class ApplicationTypeVersionsRestOperations /// Initializes a new instance of ApplicationTypeVersionsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public ApplicationTypeVersionsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -44,7 +44,7 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -65,7 +65,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -79,8 +79,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get a Service Fabric managed application type version resource created or in the process of being created in the Service Fabric managed application type name resource. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The application type version. @@ -114,8 +114,8 @@ public async Task> GetA } /// Get a Service Fabric managed application type version resource created or in the process of being created in the Service Fabric managed application type name resource. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The application type version. @@ -156,7 +156,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -177,7 +177,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -195,8 +195,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update a Service Fabric managed application type version resource with the specified name. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The application type version. @@ -226,8 +226,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or update a Service Fabric managed application type version resource with the specified name. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The application type version. @@ -264,7 +264,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -285,7 +285,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -303,8 +303,8 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates the tags of an application type version resource of a given managed cluster. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The application type version. @@ -338,8 +338,8 @@ public async Task> Upda } /// Updates the tags of an application type version resource of a given managed cluster. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The application type version. @@ -380,7 +380,7 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -401,7 +401,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -415,8 +415,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a Service Fabric managed application type version resource with the specified name. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The application type version. @@ -435,7 +435,6 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; @@ -445,8 +444,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Service Fabric managed application type version resource with the specified name. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The application type version. @@ -465,7 +464,6 @@ public Response Delete(string subscriptionId, string resourceGroupName, string c _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; @@ -482,7 +480,7 @@ internal RequestUriBuilder CreateListByApplicationTypesRequestUri(string subscri uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -502,7 +500,7 @@ internal HttpMessage CreateListByApplicationTypesRequest(string subscriptionId, uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -515,8 +513,8 @@ internal HttpMessage CreateListByApplicationTypesRequest(string subscriptionId, } /// Gets all application type version resources created or in the process of being created in the Service Fabric managed application type name resource. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The cancellation token to use. @@ -546,8 +544,8 @@ public async Task> ListByApplicatio } /// Gets all application type version resources created or in the process of being created in the Service Fabric managed application type name resource. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The cancellation token to use. @@ -600,8 +598,8 @@ internal HttpMessage CreateListByApplicationTypesNextPageRequest(string nextLink /// Gets all application type version resources created or in the process of being created in the Service Fabric managed application type name resource. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The cancellation token to use. @@ -633,8 +631,8 @@ public async Task> ListByApplicatio /// Gets all application type version resources created or in the process of being created in the Service Fabric managed application type name resource. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The cancellation token to use. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ApplicationTypesRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ApplicationTypesRestOperations.cs index 939894f7a141..c6aeda2e269c 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ApplicationTypesRestOperations.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ApplicationTypesRestOperations.cs @@ -25,14 +25,14 @@ internal partial class ApplicationTypesRestOperations /// Initializes a new instance of ApplicationTypesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public ApplicationTypesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -44,7 +44,7 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -63,7 +63,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -75,8 +75,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric managed cluster resource. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The cancellation token to use. @@ -108,8 +108,8 @@ public async Task> GetAsync(st } /// Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric managed cluster resource. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The cancellation token to use. @@ -148,7 +148,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -167,7 +167,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -183,8 +183,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update a Service Fabric managed application type name resource with the specified name. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The application type name resource. @@ -216,8 +216,8 @@ public async Task> CreateOrUpd } /// Create or update a Service Fabric managed application type name resource with the specified name. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The application type name resource. @@ -256,7 +256,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -275,7 +275,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -291,8 +291,8 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates the tags of an application type resource of a given managed cluster. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The application type resource updated tags. @@ -324,8 +324,8 @@ public async Task> UpdateAsync } /// Updates the tags of an application type resource of a given managed cluster. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The application type resource updated tags. @@ -364,7 +364,7 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -383,7 +383,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes/", false); uri.AppendPath(applicationTypeName, true); @@ -395,8 +395,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a Service Fabric managed application type name resource with the specified name. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The cancellation token to use. @@ -413,7 +413,6 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; @@ -423,8 +422,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Service Fabric managed application type name resource with the specified name. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application type name resource. /// The cancellation token to use. @@ -441,7 +440,6 @@ public Response Delete(string subscriptionId, string resourceGroupName, string c _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; @@ -458,7 +456,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes", false); uri.AppendQuery("api-version", _apiVersion, true); @@ -476,7 +474,7 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applicationTypes", false); uri.AppendQuery("api-version", _apiVersion, true); @@ -487,8 +485,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Gets all application type name resources created or in the process of being created in the Service Fabric managed cluster resource. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The cancellation token to use. /// , or is null. @@ -516,8 +514,8 @@ public async Task> ListAsync(string subscr } /// Gets all application type name resources created or in the process of being created in the Service Fabric managed cluster resource. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The cancellation token to use. /// , or is null. @@ -568,8 +566,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Gets all application type name resources created or in the process of being created in the Service Fabric managed cluster resource. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The cancellation token to use. /// , , or is null. @@ -599,8 +597,8 @@ public async Task> ListNextPageAsync(strin /// Gets all application type name resources created or in the process of being created in the Service Fabric managed cluster resource. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The cancellation token to use. /// , , or is null. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ApplicationsRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ApplicationsRestOperations.cs index 255649d6246a..72755491e210 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ApplicationsRestOperations.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ApplicationsRestOperations.cs @@ -25,18 +25,18 @@ internal partial class ApplicationsRestOperations /// Initializes a new instance of ApplicationsRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public ApplicationsRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateReadUpgradeRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -48,16 +48,15 @@ internal RequestUriBuilder CreateReadUpgradeRequestUri(string subscriptionId, st uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); - uri.AppendPath("/fetchUpgradeStatus", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateReadUpgradeRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -68,7 +67,6 @@ internal HttpMessage CreateReadUpgradeRequest(string subscriptionId, string reso uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); - uri.AppendPath("/fetchUpgradeStatus", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -76,59 +74,73 @@ internal HttpMessage CreateReadUpgradeRequest(string subscriptionId, string reso return message; } - /// Get the status of the latest application upgrade. It will query the cluster to find the status of the latest application upgrade. - /// The customer subscription identifier. - /// The name of the resource group. + /// Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the cluster resource. /// The name of the application resource. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task ReadUpgradeAsync(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); - using var message = CreateReadUpgradeRequest(subscriptionId, resourceGroupName, clusterName, applicationName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName, applicationName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 202: - return message.Response; + case 200: + { + ServiceFabricManagedApplicationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ServiceFabricManagedApplicationData.DeserializeServiceFabricManagedApplicationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServiceFabricManagedApplicationData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get the status of the latest application upgrade. It will query the cluster to find the status of the latest application upgrade. - /// The customer subscription identifier. - /// The name of the resource group. + /// Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the cluster resource. /// The name of the application resource. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ReadUpgrade(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) + public Response Get(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); - using var message = CreateReadUpgradeRequest(subscriptionId, resourceGroupName, clusterName, applicationName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName, applicationName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 202: - return message.Response; + case 200: + { + ServiceFabricManagedApplicationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ServiceFabricManagedApplicationData.DeserializeServiceFabricManagedApplicationData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServiceFabricManagedApplicationData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateStartRollbackRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -140,16 +152,15 @@ internal RequestUriBuilder CreateStartRollbackRequestUri(string subscriptionId, uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); - uri.AppendPath("/startRollback", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateStartRollbackRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -160,33 +171,39 @@ internal HttpMessage CreateStartRollbackRequest(string subscriptionId, string re uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); - uri.AppendPath("/startRollback", 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; } - /// Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version. - /// The customer subscription identifier. - /// The name of the resource group. + /// Create or update a Service Fabric managed application resource with the specified name. + /// 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 cluster resource. /// The name of the application resource. + /// The application resource. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task StartRollbackAsync(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateStartRollbackRequest(subscriptionId, resourceGroupName, clusterName, applicationName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, clusterName, applicationName, data); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { + case 200: case 202: return message.Response; default: @@ -194,25 +211,28 @@ public async Task StartRollbackAsync(string subscriptionId, string res } } - /// Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version. - /// The customer subscription identifier. - /// The name of the resource group. + /// Create or update a Service Fabric managed application resource with the specified name. + /// 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 cluster resource. /// The name of the application resource. + /// The application resource. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response StartRollback(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationData data, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); + Argument.AssertNotNull(data, nameof(data)); - using var message = CreateStartRollbackRequest(subscriptionId, resourceGroupName, clusterName, applicationName); + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, clusterName, applicationName, data); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { + case 200: case 202: return message.Response; default: @@ -220,7 +240,7 @@ public Response StartRollback(string subscriptionId, string resourceGroupName, s } } - internal RequestUriBuilder CreateResumeUpgradeRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, RuntimeResumeApplicationUpgradeContent content) + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationPatch patch) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -232,16 +252,15 @@ internal RequestUriBuilder CreateResumeUpgradeRequestUri(string subscriptionId, uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); - uri.AppendPath("/resumeUpgrade", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateResumeUpgradeRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, RuntimeResumeApplicationUpgradeContent content) + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationPatch patch) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Patch; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -252,75 +271,84 @@ internal HttpMessage CreateResumeUpgradeRequest(string subscriptionId, string re uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); - uri.AppendPath("/resumeUpgrade", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); request.Headers.Add("Content-Type", "application/json"); - var content0 = new Utf8JsonRequestContent(); - content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); - request.Content = content0; + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused. - /// The customer subscription identifier. - /// The name of the resource group. + /// Updates the tags of an application resource of a given managed 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 cluster resource. /// The name of the application resource. - /// The parameters for resuming an application upgrade. + /// The application resource updated tags. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task ResumeUpgradeAsync(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, RuntimeResumeApplicationUpgradeContent content, CancellationToken cancellationToken = default) + public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateResumeUpgradeRequest(subscriptionId, resourceGroupName, clusterName, applicationName, content); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, applicationName, patch); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 202: - return message.Response; + case 200: + { + ServiceFabricManagedApplicationData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ServiceFabricManagedApplicationData.DeserializeServiceFabricManagedApplicationData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused. - /// The customer subscription identifier. - /// The name of the resource group. + /// Updates the tags of an application resource of a given managed 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 cluster resource. /// The name of the application resource. - /// The parameters for resuming an application upgrade. + /// The application resource updated tags. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ResumeUpgrade(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, RuntimeResumeApplicationUpgradeContent content, CancellationToken cancellationToken = default) + public Response Update(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationPatch patch, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); - Argument.AssertNotNull(content, nameof(content)); + Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateResumeUpgradeRequest(subscriptionId, resourceGroupName, clusterName, applicationName, content); + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, applicationName, patch); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 202: - return message.Response; + case 200: + { + ServiceFabricManagedApplicationData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ServiceFabricManagedApplicationData.DeserializeServiceFabricManagedApplicationData(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -328,7 +356,7 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); @@ -336,18 +364,18 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Delete; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); @@ -358,73 +386,61 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou return message; } - /// Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource. - /// The customer subscription identifier. - /// The name of the resource group. + /// Delete a Service Fabric managed application resource with the specified name. + /// 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 cluster resource. /// The name of the application resource. /// 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 clusterName, string applicationName, CancellationToken cancellationToken = default) + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName, applicationName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName, applicationName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - ServiceFabricManagedApplicationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ServiceFabricManagedApplicationData.DeserializeServiceFabricManagedApplicationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ServiceFabricManagedApplicationData)null, message.Response); + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource. - /// The customer subscription identifier. - /// The name of the resource group. + /// Delete a Service Fabric managed application resource with the specified name. + /// 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 cluster resource. /// The name of the application resource. /// 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 clusterName, string applicationName, CancellationToken cancellationToken = default) + public Response Delete(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName, applicationName); + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName, applicationName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - ServiceFabricManagedApplicationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ServiceFabricManagedApplicationData.DeserializeServiceFabricManagedApplicationData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ServiceFabricManagedApplicationData)null, message.Response); + case 202: + case 204: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationData data) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string clusterName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -432,99 +448,93 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); - uri.AppendPath("/applications/", false); - uri.AppendPath(applicationName, true); + uri.AppendPath("/applications", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationData data) + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string clusterName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Get; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); - uri.AppendPath("/applications/", false); - uri.AppendPath(applicationName, true); + uri.AppendPath("/applications", 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 or update a Service Fabric managed application resource with the specified name. - /// The customer subscription identifier. - /// The name of the resource group. + /// Gets all managed application resources created or in the process of being created in the Service Fabric cluster resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the cluster resource. - /// The name of the application resource. - /// The application resource. /// 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 clusterName, string applicationName, ServiceFabricManagedApplicationData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, clusterName, applicationName, data); + using var message = CreateListRequest(subscriptionId, resourceGroupName, clusterName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + ApplicationResourceList value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ApplicationResourceList.DeserializeApplicationResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Create or update a Service Fabric managed application resource with the specified name. - /// The customer subscription identifier. - /// The name of the resource group. + /// Gets all managed application resources created or in the process of being created in the Service Fabric cluster resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. /// The name of the cluster resource. - /// The name of the application resource. - /// The application resource. /// 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 clusterName, string applicationName, ServiceFabricManagedApplicationData data, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, clusterName, applicationName, data); + using var message = CreateListRequest(subscriptionId, resourceGroupName, clusterName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + ApplicationResourceList value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ApplicationResourceList.DeserializeApplicationResourceList(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationPatch patch) + internal RequestUriBuilder CreateReadUpgradeRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -532,107 +542,91 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); + uri.AppendPath("/fetchUpgradeStatus", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationPatch patch) + internal HttpMessage CreateReadUpgradeRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); + uri.AppendPath("/fetchUpgradeStatus", 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; } - /// Updates the tags of an application resource of a given managed cluster. - /// The customer subscription identifier. - /// The name of the resource group. + /// Get the status of the latest application upgrade. It will query the cluster to find the status of the latest application upgrade. + /// 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 cluster resource. /// The name of the application resource. - /// The application resource updated tags. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationPatch patch, CancellationToken cancellationToken = default) + public async Task ReadUpgradeAsync(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, applicationName, patch); + using var message = CreateReadUpgradeRequest(subscriptionId, resourceGroupName, clusterName, applicationName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - ServiceFabricManagedApplicationData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ServiceFabricManagedApplicationData.DeserializeServiceFabricManagedApplicationData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Updates the tags of an application resource of a given managed cluster. - /// The customer subscription identifier. - /// The name of the resource group. + /// Get the status of the latest application upgrade. It will query the cluster to find the status of the latest application upgrade. + /// 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 cluster resource. /// The name of the application resource. - /// The application resource updated tags. /// The cancellation token to use. - /// , , , or is null. + /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, ServiceFabricManagedApplicationPatch patch, CancellationToken cancellationToken = default) + public Response ReadUpgrade(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); - Argument.AssertNotNull(patch, nameof(patch)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, applicationName, patch); + using var message = CreateReadUpgradeRequest(subscriptionId, resourceGroupName, clusterName, applicationName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - ServiceFabricManagedApplicationData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ServiceFabricManagedApplicationData.DeserializeServiceFabricManagedApplicationData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) + internal RequestUriBuilder CreateResumeUpgradeRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, RuntimeResumeApplicationUpgradeContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -640,93 +634,99 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); + uri.AppendPath("/resumeUpgrade", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) + internal HttpMessage CreateResumeUpgradeRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, RuntimeResumeApplicationUpgradeContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); + uri.AppendPath("/resumeUpgrade", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Delete a Service Fabric managed application resource with the specified name. - /// The customer subscription identifier. - /// The name of the resource group. + /// Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused. + /// 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 cluster resource. /// The name of the application resource. + /// The parameters for resuming an application upgrade. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) + public async Task ResumeUpgradeAsync(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, RuntimeResumeApplicationUpgradeContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName, applicationName); + using var message = CreateResumeUpgradeRequest(subscriptionId, resourceGroupName, clusterName, applicationName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Delete a Service Fabric managed application resource with the specified name. - /// The customer subscription identifier. - /// The name of the resource group. + /// Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused. + /// 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 cluster resource. /// The name of the application resource. + /// The parameters for resuming an application upgrade. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) + public Response ResumeUpgrade(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, RuntimeResumeApplicationUpgradeContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName, applicationName); + using var message = CreateResumeUpgradeRequest(subscriptionId, resourceGroupName, clusterName, applicationName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string clusterName) + internal RequestUriBuilder CreateStartRollbackRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -734,27 +734,31 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); - uri.AppendPath("/applications", false); + uri.AppendPath("/applications/", false); + uri.AppendPath(applicationName, true); + uri.AppendPath("/startRollback", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string clusterName) + internal HttpMessage CreateStartRollbackRequest(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); - uri.AppendPath("/applications", false); + uri.AppendPath("/applications/", false); + uri.AppendPath(applicationName, true); + uri.AppendPath("/startRollback", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -762,59 +766,53 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro return message; } - /// Gets all managed application resources created or in the process of being created in the Service Fabric cluster resource. - /// The customer subscription identifier. - /// The name of the resource group. + /// Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version. + /// 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 cluster resource. + /// The name of the application resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StartRollbackAsync(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, clusterName); + using var message = CreateStartRollbackRequest(subscriptionId, resourceGroupName, clusterName, applicationName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - ApplicationResourceList value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ApplicationResourceList.DeserializeApplicationResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Gets all managed application resources created or in the process of being created in the Service Fabric cluster resource. - /// The customer subscription identifier. - /// The name of the resource group. + /// Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version. + /// 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 cluster resource. + /// The name of the application resource. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response StartRollback(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(applicationName, nameof(applicationName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, clusterName); + using var message = CreateStartRollbackRequest(subscriptionId, resourceGroupName, clusterName, applicationName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - ApplicationResourceList value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ApplicationResourceList.DeserializeApplicationResourceList(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } @@ -844,8 +842,8 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Gets all managed application resources created or in the process of being created in the Service Fabric cluster resource. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The cancellation token to use. /// , , or is null. @@ -875,8 +873,8 @@ public async Task> ListNextPageAsync(string ne /// Gets all managed application resources created or in the process of being created in the Service Fabric cluster resource. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The cancellation token to use. /// , , or is null. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedApplyMaintenanceWindowRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedApplyMaintenanceWindowRestOperations.cs index c45acb409fec..dc85f94ae1a5 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedApplyMaintenanceWindowRestOperations.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedApplyMaintenanceWindowRestOperations.cs @@ -23,14 +23,14 @@ internal partial class ManagedApplyMaintenanceWindowRestOperations /// Initializes a new instance of ManagedApplyMaintenanceWindowRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public ManagedApplyMaintenanceWindowRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -71,8 +71,8 @@ internal HttpMessage CreatePostRequest(string subscriptionId, string resourceGro } /// Action to Apply Maintenance window on the Service Fabric Managed Clusters, right now. Any pending update will be applied. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The cancellation token to use. /// , or is null. @@ -95,8 +95,8 @@ public async Task PostAsync(string subscriptionId, string resourceGrou } /// Action to Apply Maintenance window on the Service Fabric Managed Clusters, right now. Any pending update will be applied. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The cancellation token to use. /// , or is null. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedAzResiliencyStatusRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedAzResiliencyStatusRestOperations.cs index 0d6bb642c742..7a724c0ffafb 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedAzResiliencyStatusRestOperations.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedAzResiliencyStatusRestOperations.cs @@ -25,18 +25,18 @@ internal partial class ManagedAzResiliencyStatusRestOperations /// Initializes a new instance of ManagedAzResiliencyStatusRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public ManagedAzResiliencyStatusRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string clusterName) + internal RequestUriBuilder CreateGetManagedAzResiliencyStatusRequestUri(string subscriptionId, string resourceGroupName, string clusterName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -51,7 +51,7 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string clusterName) + internal HttpMessage CreateGetManagedAzResiliencyStatusRequest(string subscriptionId, string resourceGroupName, string clusterName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -73,19 +73,19 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Action to get Az Resiliency Status of all the Base resources constituting Service Fabric Managed Clusters. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// 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 clusterName, CancellationToken cancellationToken = default) + public async Task> GetManagedAzResiliencyStatusAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName); + using var message = CreateGetManagedAzResiliencyStatusRequest(subscriptionId, resourceGroupName, clusterName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -102,19 +102,19 @@ public async Task> GetAsync(string subscript } /// Action to get Az Resiliency Status of all the Base resources constituting Service Fabric Managed Clusters. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// 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 clusterName, CancellationToken cancellationToken = default) + public Response GetManagedAzResiliencyStatus(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName); + using var message = CreateGetManagedAzResiliencyStatusRequest(subscriptionId, resourceGroupName, clusterName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedClusterVersionRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedClusterVersionRestOperations.cs index 1f6de46f3826..170cb02e5cf8 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedClusterVersionRestOperations.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedClusterVersionRestOperations.cs @@ -26,18 +26,18 @@ internal partial class ManagedClusterVersionRestOperations /// Initializes a new instance of ManagedClusterVersionRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public ManagedClusterVersionRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string clusterVersion) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string location, string clusterVersion) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -51,7 +51,7 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocat return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string clusterVersion) + internal HttpMessage CreateGetRequest(string subscriptionId, string location, string clusterVersion) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -72,15 +72,16 @@ internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation locat } /// Gets information about an available Service Fabric managed cluster code version. - /// The customer subscription identifier. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. /// The cluster code version. /// 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 clusterVersion, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string location, string clusterVersion, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); using var message = CreateGetRequest(subscriptionId, location, clusterVersion); @@ -100,15 +101,16 @@ public async Task> GetAsync(string } /// Gets information about an available Service Fabric managed cluster code version. - /// The customer subscription identifier. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. /// The cluster code version. /// 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 clusterVersion, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string location, string clusterVersion, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); using var message = CreateGetRequest(subscriptionId, location, clusterVersion); @@ -127,7 +129,7 @@ public Response Get(string subscriptionId, A } } - internal RequestUriBuilder CreateGetByEnvironmentRequestUri(string subscriptionId, AzureLocation location, ManagedClusterVersionEnvironment environment, string clusterVersion) + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string location) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -135,15 +137,12 @@ internal RequestUriBuilder CreateGetByEnvironmentRequestUri(string subscriptionI uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/locations/", false); uri.AppendPath(location, true); - uri.AppendPath("/environments/", false); - uri.AppendPath(environment.ToString(), true); - uri.AppendPath("/managedClusterVersions/", false); - uri.AppendPath(clusterVersion, true); + uri.AppendPath("/managedClusterVersions", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetByEnvironmentRequest(string subscriptionId, AzureLocation location, ManagedClusterVersionEnvironment environment, string clusterVersion) + internal HttpMessage CreateListRequest(string subscriptionId, string location) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -154,10 +153,7 @@ internal HttpMessage CreateGetByEnvironmentRequest(string subscriptionId, AzureL uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/locations/", false); uri.AppendPath(location, true); - uri.AppendPath("/environments/", false); - uri.AppendPath(environment.ToString(), true); - uri.AppendPath("/managedClusterVersions/", false); - uri.AppendPath(clusterVersion, true); + uri.AppendPath("/managedClusterVersions", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -165,28 +161,31 @@ internal HttpMessage CreateGetByEnvironmentRequest(string subscriptionId, AzureL return message; } - /// Gets information about an available Service Fabric cluster code version by environment. - /// The customer subscription identifier. + /// Gets all available code versions for Service Fabric cluster resources by location. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. - /// The operating system of the cluster. The default means all. - /// The cluster code version. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public async Task> GetByEnvironmentAsync(string subscriptionId, AzureLocation location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task>> ListAsync(string subscriptionId, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); - using var message = CreateGetByEnvironmentRequest(subscriptionId, location, environment, clusterVersion); + using var message = CreateListRequest(subscriptionId, location); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ServiceFabricManagedClusterVersion value = default; + IReadOnlyList value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(document.RootElement); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(item)); + } + value = array; return Response.FromValue(value, message.Response); } default: @@ -194,28 +193,31 @@ public async Task> GetByEnvironment } } - /// Gets information about an available Service Fabric cluster code version by environment. - /// The customer subscription identifier. + /// Gets all available code versions for Service Fabric cluster resources by location. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. - /// The operating system of the cluster. The default means all. - /// The cluster code version. /// The cancellation token to use. - /// or is null. - /// or is an empty string, and was expected to be non-empty. - public Response GetByEnvironment(string subscriptionId, AzureLocation location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response> List(string subscriptionId, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); - using var message = CreateGetByEnvironmentRequest(subscriptionId, location, environment, clusterVersion); + using var message = CreateListRequest(subscriptionId, location); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ServiceFabricManagedClusterVersion value = default; + IReadOnlyList value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(document.RootElement); + List array = new List(); + foreach (var item in document.RootElement.EnumerateArray()) + { + array.Add(ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(item)); + } + value = array; return Response.FromValue(value, message.Response); } default: @@ -223,7 +225,7 @@ public Response GetByEnvironment(string subs } } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, AzureLocation location) + internal RequestUriBuilder CreateGetManagedClusterVersionByEnvironmentRequestUri(string subscriptionId, string location, ManagedClusterVersionEnvironment environment, string clusterVersion) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -231,12 +233,15 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, AzureLoca uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/locations/", false); uri.AppendPath(location, true); - uri.AppendPath("/managedClusterVersions", false); + uri.AppendPath("/environments/", false); + uri.AppendPath(environment.ToString(), true); + uri.AppendPath("/managedClusterVersions/", false); + uri.AppendPath(clusterVersion, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation location) + internal HttpMessage CreateGetManagedClusterVersionByEnvironmentRequest(string subscriptionId, string location, ManagedClusterVersionEnvironment environment, string clusterVersion) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -247,7 +252,10 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/locations/", false); uri.AppendPath(location, true); - uri.AppendPath("/managedClusterVersions", false); + uri.AppendPath("/environments/", false); + uri.AppendPath(environment.ToString(), true); + uri.AppendPath("/managedClusterVersions/", false); + uri.AppendPath(clusterVersion, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -255,30 +263,29 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca return message; } - /// Gets all available code versions for Service Fabric cluster resources by location. - /// The customer subscription identifier. + /// Gets information about an available Service Fabric cluster code version by environment. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. + /// The operating system of the cluster. + /// The cluster code version. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task>> ListAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetManagedClusterVersionByEnvironmentAsync(string subscriptionId, string location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); + Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); - using var message = CreateListRequest(subscriptionId, location); + using var message = CreateGetManagedClusterVersionByEnvironmentRequest(subscriptionId, location, environment, clusterVersion); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - IReadOnlyList value = default; + ServiceFabricManagedClusterVersion 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(ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(item)); - } - value = array; + value = ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -286,30 +293,29 @@ public async Task>> L } } - /// Gets all available code versions for Service Fabric cluster resources by location. - /// The customer subscription identifier. + /// Gets information about an available Service Fabric cluster code version by environment. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. + /// The operating system of the cluster. + /// The cluster code version. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response> List(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetManagedClusterVersionByEnvironment(string subscriptionId, string location, ManagedClusterVersionEnvironment environment, string clusterVersion, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); + Argument.AssertNotNullOrEmpty(clusterVersion, nameof(clusterVersion)); - using var message = CreateListRequest(subscriptionId, location); + using var message = CreateGetManagedClusterVersionByEnvironmentRequest(subscriptionId, location, environment, clusterVersion); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - IReadOnlyList value = default; + ServiceFabricManagedClusterVersion 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(ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(item)); - } - value = array; + value = ServiceFabricManagedClusterVersion.DeserializeServiceFabricManagedClusterVersion(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -317,7 +323,7 @@ public Response> List(string s } } - internal RequestUriBuilder CreateListByEnvironmentRequestUri(string subscriptionId, AzureLocation location, ManagedClusterVersionEnvironment environment) + internal RequestUriBuilder CreateListByEnvironmentRequestUri(string subscriptionId, string location, ManagedClusterVersionEnvironment environment) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -332,7 +338,7 @@ internal RequestUriBuilder CreateListByEnvironmentRequestUri(string subscription return uri; } - internal HttpMessage CreateListByEnvironmentRequest(string subscriptionId, AzureLocation location, ManagedClusterVersionEnvironment environment) + internal HttpMessage CreateListByEnvironmentRequest(string subscriptionId, string location, ManagedClusterVersionEnvironment environment) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -354,15 +360,16 @@ internal HttpMessage CreateListByEnvironmentRequest(string subscriptionId, Azure } /// Gets all available code versions for Service Fabric cluster resources by environment. - /// The customer subscription identifier. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. - /// The operating system of the cluster. The default means all. + /// The operating system of the cluster. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task>> ListByEnvironmentAsync(string subscriptionId, AzureLocation location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task>> ListByEnvironmentAsync(string subscriptionId, string location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); using var message = CreateListByEnvironmentRequest(subscriptionId, location, environment); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); @@ -386,15 +393,16 @@ public async Task>> L } /// Gets all available code versions for Service Fabric cluster resources by environment. - /// The customer subscription identifier. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. - /// The operating system of the cluster. The default means all. + /// The operating system of the cluster. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response> ListByEnvironment(string subscriptionId, AzureLocation location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response> ListByEnvironment(string subscriptionId, string location, ManagedClusterVersionEnvironment environment, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); using var message = CreateListByEnvironmentRequest(subscriptionId, location, environment); _pipeline.Send(message, cancellationToken); diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedClustersRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedClustersRestOperations.cs index 2b4e2d0f01f7..5260fa9abd15 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedClustersRestOperations.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedClustersRestOperations.cs @@ -25,17 +25,389 @@ internal partial class ManagedClustersRestOperations /// Initializes a new instance of ManagedClustersRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public ManagedClustersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string clusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string clusterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get a Service Fabric managed cluster resource created or in the process of being created in the specified 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 name of the cluster resource. + /// 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 clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServiceFabricManagedClusterData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServiceFabricManagedClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a Service Fabric managed cluster resource created or in the process of being created in the specified 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 name of the cluster resource. + /// 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 clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServiceFabricManagedClusterData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((ServiceFabricManagedClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, ServiceFabricManagedClusterData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, ServiceFabricManagedClusterData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, 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 or update a Service Fabric managed cluster resource with the specified name. + /// 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 cluster resource. + /// The cluster resource. + /// 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 clusterName, ServiceFabricManagedClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, clusterName, 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); + } + } + + /// Create or update a Service Fabric managed cluster resource with the specified name. + /// 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 cluster resource. + /// The cluster resource. + /// 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 clusterName, ServiceFabricManagedClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, clusterName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, ServiceFabricManagedClusterPatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, ServiceFabricManagedClusterPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, 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 the tags of of a Service Fabric managed cluster resource with the specified name. + /// 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 cluster resource. + /// The managed cluster resource updated tags. + /// 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 clusterName, ServiceFabricManagedClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ServiceFabricManagedClusterData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Update the tags of of a Service Fabric managed cluster resource with the specified name. + /// 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 cluster resource. + /// The managed cluster resource updated tags. + /// 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 clusterName, ServiceFabricManagedClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ServiceFabricManagedClusterData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string clusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string clusterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Service Fabric managed cluster resource with the specified name. + /// 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 cluster resource. + /// 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 clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName); + 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 Service Fabric managed cluster resource with the specified name. + /// 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 cluster resource. + /// 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 clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName); + _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(); @@ -69,8 +441,8 @@ internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, str } /// Gets all Service Fabric cluster resources created or in the process of being created in the resource group. - /// The customer subscription identifier. - /// The name of the 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. @@ -96,8 +468,8 @@ public async Task> ListByResourceGroupAsync(s } /// Gets all Service Fabric cluster resources created or in the process of being created in the resource group. - /// The customer subscription identifier. - /// The name of the 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. @@ -151,7 +523,7 @@ internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) } /// Gets all Service Fabric cluster resources created or in the process of being created in the subscription. - /// The customer subscription identifier. + /// 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. @@ -176,7 +548,7 @@ public async Task> ListBySubscriptionAsync(st } /// Gets all Service Fabric cluster resources created or in the process of being created in the subscription. - /// The customer subscription identifier. + /// 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. @@ -200,7 +572,7 @@ public Response ListBySubscription(string subscription } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string clusterName) + internal RequestUriBuilder CreateGetFaultSimulationRequestUri(string subscriptionId, string resourceGroupName, string clusterName, FaultSimulationIdContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -210,15 +582,16 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); + uri.AppendPath("/getFaultSimulation", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string clusterName) + internal HttpMessage CreateGetFaultSimulationRequest(string subscriptionId, string resourceGroupName, string clusterName, FaultSimulationIdContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -227,76 +600,81 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); + uri.AppendPath("/getFaultSimulation", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Get a Service Fabric managed cluster resource created or in the process of being created in the specified resource group. - /// The customer subscription identifier. - /// The name of the resource group. + /// Gets a fault simulation by the simulationId. + /// 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 cluster resource. + /// parameter with fault simulation id. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) + public async Task> GetFaultSimulationAsync(string subscriptionId, string resourceGroupName, string clusterName, FaultSimulationIdContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName); + using var message = CreateGetFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ServiceFabricManagedClusterData value = default; + FaultSimulation value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(document.RootElement); + value = FaultSimulation.DeserializeFaultSimulation(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ServiceFabricManagedClusterData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Get a Service Fabric managed cluster resource created or in the process of being created in the specified resource group. - /// The customer subscription identifier. - /// The name of the resource group. + /// Gets a fault simulation by the simulationId. + /// 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 cluster resource. + /// parameter with fault simulation id. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) + public Response GetFaultSimulation(string subscriptionId, string resourceGroupName, string clusterName, FaultSimulationIdContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName); + using var message = CreateGetFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ServiceFabricManagedClusterData value = default; + FaultSimulation value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(document.RootElement); + value = FaultSimulation.DeserializeFaultSimulation(document.RootElement); return Response.FromValue(value, message.Response); } - case 404: - return Response.FromValue((ServiceFabricManagedClusterData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, ServiceFabricManagedClusterData data) + internal RequestUriBuilder CreateListFaultSimulationRequestUri(string subscriptionId, string resourceGroupName, string clusterName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -306,15 +684,16 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); + uri.AppendPath("/listFaultSimulation", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, ServiceFabricManagedClusterData data) + internal HttpMessage CreateListFaultSimulationRequest(string subscriptionId, string resourceGroupName, string clusterName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -323,72 +702,73 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); + uri.AppendPath("/listFaultSimulation", 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 or update a Service Fabric managed cluster resource with the specified name. - /// The customer subscription identifier. - /// The name of the resource group. + /// Gets the list of recent fault simulations for the 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 cluster resource. - /// The cluster resource. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string clusterName, ServiceFabricManagedClusterData data, CancellationToken cancellationToken = default) + public async Task> ListFaultSimulationAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, clusterName, data); + using var message = CreateListFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + FaultSimulationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FaultSimulationListResult.DeserializeFaultSimulationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Create or update a Service Fabric managed cluster resource with the specified name. - /// The customer subscription identifier. - /// The name of the resource group. + /// Gets the list of recent fault simulations for the 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 cluster resource. - /// The cluster resource. /// The cancellation token to use. - /// , , or is null. + /// , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string clusterName, ServiceFabricManagedClusterData data, CancellationToken cancellationToken = default) + public Response ListFaultSimulation(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNull(data, nameof(data)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, clusterName, data); + using var message = CreateListFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + FaultSimulationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FaultSimulationListResult.DeserializeFaultSimulationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, ServiceFabricManagedClusterPatch patch) + internal RequestUriBuilder CreateStartFaultSimulationRequestUri(string subscriptionId, string resourceGroupName, string clusterName, FaultSimulationContentWrapper faultSimulationContentWrapper) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -398,15 +778,16 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); + uri.AppendPath("/startFaultSimulation", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, ServiceFabricManagedClusterPatch patch) + internal HttpMessage CreateStartFaultSimulationRequest(string subscriptionId, string resourceGroupName, string clusterName, FaultSimulationContentWrapper faultSimulationContentWrapper) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -415,80 +796,71 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); + uri.AppendPath("/startFaultSimulation", 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); + content.JsonWriter.WriteObjectValue(faultSimulationContentWrapper, ModelSerializationExtensions.WireOptions); request.Content = content; _userAgent.Apply(message); return message; } - /// Update the tags of of a Service Fabric managed cluster resource with the specified name. - /// The customer subscription identifier. - /// The name of the resource group. + /// Starts a fault simulation on the 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 cluster resource. - /// The managed cluster resource updated tags. + /// parameters describing the fault simulation. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task> UpdateAsync(string subscriptionId, string resourceGroupName, string clusterName, ServiceFabricManagedClusterPatch patch, CancellationToken cancellationToken = default) + public async Task StartFaultSimulationAsync(string subscriptionId, string resourceGroupName, string clusterName, FaultSimulationContentWrapper faultSimulationContentWrapper, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(faultSimulationContentWrapper, nameof(faultSimulationContentWrapper)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, patch); + using var message = CreateStartFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, faultSimulationContentWrapper); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - ServiceFabricManagedClusterData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Update the tags of of a Service Fabric managed cluster resource with the specified name. - /// The customer subscription identifier. - /// The name of the resource group. + /// Starts a fault simulation on the 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 cluster resource. - /// The managed cluster resource updated tags. + /// parameters describing the fault simulation. /// The cancellation token to use. - /// , , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string clusterName, ServiceFabricManagedClusterPatch patch, CancellationToken cancellationToken = default) + public Response StartFaultSimulation(string subscriptionId, string resourceGroupName, string clusterName, FaultSimulationContentWrapper faultSimulationContentWrapper, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(faultSimulationContentWrapper, nameof(faultSimulationContentWrapper)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, patch); + using var message = CreateStartFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, faultSimulationContentWrapper); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - ServiceFabricManagedClusterData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ServiceFabricManagedClusterData.DeserializeServiceFabricManagedClusterData(document.RootElement); - return Response.FromValue(value, message.Response); - } + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string clusterName) + internal RequestUriBuilder CreateStopFaultSimulationRequestUri(string subscriptionId, string resourceGroupName, string clusterName, FaultSimulationIdContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -498,15 +870,16 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); + uri.AppendPath("/stopFaultSimulation", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string clusterName) + internal HttpMessage CreateStopFaultSimulationRequest(string subscriptionId, string resourceGroupName, string clusterName, FaultSimulationIdContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -515,59 +888,64 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); + uri.AppendPath("/stopFaultSimulation", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Delete a Service Fabric managed cluster resource with the specified name. - /// The customer subscription identifier. - /// The name of the resource group. + /// Stops a fault simulation on the 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 cluster resource. + /// parameter with fault simulation id. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) + public async Task StopFaultSimulationAsync(string subscriptionId, string resourceGroupName, string clusterName, FaultSimulationIdContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName); + using var message = CreateStopFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Delete a Service Fabric managed cluster resource with the specified name. - /// The customer subscription identifier. - /// The name of the resource group. + /// Stops a fault simulation on the 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 cluster resource. + /// parameter with fault simulation id. /// The cancellation token to use. - /// , or is null. + /// , , or is null. /// , or is an empty string, and was expected to be non-empty. - public Response Delete(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) + public Response StopFaultSimulation(string subscriptionId, string resourceGroupName, string clusterName, FaultSimulationIdContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName); + using var message = CreateStopFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: - case 204: return message.Response; default: throw new RequestFailedException(message.Response); @@ -598,8 +976,8 @@ internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, s /// Gets all Service Fabric cluster resources created or in the process of being created in the resource group. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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. @@ -627,8 +1005,8 @@ public async Task> ListByResourceGroupNextPag /// Gets all Service Fabric cluster resources created or in the process of being created in the resource group. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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. @@ -678,7 +1056,7 @@ internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, st /// Gets all Service Fabric cluster resources created or in the process of being created in the subscription. /// The URL to the next page of results. - /// The customer subscription identifier. + /// 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. @@ -705,7 +1083,7 @@ public async Task> ListBySubscriptionNextPage /// Gets all Service Fabric cluster resources created or in the process of being created in the subscription. /// The URL to the next page of results. - /// The customer subscription identifier. + /// 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. @@ -729,5 +1107,89 @@ public Response ListBySubscriptionNextPage(string next throw new RequestFailedException(message.Response); } } + + internal RequestUriBuilder CreateListFaultSimulationNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string clusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListFaultSimulationNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string clusterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of recent fault simulations for the cluster. + /// 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 cluster resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListFaultSimulationNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var message = CreateListFaultSimulationNextPageRequest(nextLink, subscriptionId, resourceGroupName, clusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FaultSimulationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FaultSimulationListResult.DeserializeFaultSimulationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of recent fault simulations for the cluster. + /// 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 cluster resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListFaultSimulationNextPage(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var message = CreateListFaultSimulationNextPageRequest(nextLink, subscriptionId, resourceGroupName, clusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FaultSimulationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FaultSimulationListResult.DeserializeFaultSimulationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedMaintenanceWindowStatusRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedMaintenanceWindowStatusRestOperations.cs index c63da012f10e..da9210d94c46 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedMaintenanceWindowStatusRestOperations.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedMaintenanceWindowStatusRestOperations.cs @@ -25,14 +25,14 @@ internal partial class ManagedMaintenanceWindowStatusRestOperations /// Initializes a new instance of ManagedMaintenanceWindowStatusRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public ManagedMaintenanceWindowStatusRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -73,8 +73,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Action to get Maintenance Window Status of the Service Fabric Managed Clusters. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The cancellation token to use. /// , or is null. @@ -102,8 +102,8 @@ public async Task> GetAsync(string subs } /// Action to get Maintenance Window Status of the Service Fabric Managed Clusters. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The cancellation token to use. /// , or is null. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedUnsupportedVMSizesRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedUnsupportedVMSizesRestOperations.cs index 93113c271520..52cb7970bca5 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedUnsupportedVMSizesRestOperations.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ManagedUnsupportedVMSizesRestOperations.cs @@ -25,18 +25,18 @@ internal partial class ManagedUnsupportedVMSizesRestOperations /// Initializes a new instance of ManagedUnsupportedVMSizesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public ManagedUnsupportedVMSizesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, AzureLocation location) + internal RequestUriBuilder CreateGetManagedUnsupportedVmSizeRequestUri(string subscriptionId, string location, string vmSize) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -44,12 +44,13 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, AzureLoca uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/locations/", false); uri.AppendPath(location, true); - uri.AppendPath("/managedUnsupportedVMSizes", false); + uri.AppendPath("/managedUnsupportedVMSizes/", false); + uri.AppendPath(vmSize, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation location) + internal HttpMessage CreateGetManagedUnsupportedVmSizeRequest(string subscriptionId, string location, string vmSize) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -60,7 +61,8 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/locations/", false); uri.AppendPath(location, true); - uri.AppendPath("/managedUnsupportedVMSizes", false); + uri.AppendPath("/managedUnsupportedVMSizes/", false); + uri.AppendPath(vmSize, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -68,25 +70,28 @@ internal HttpMessage CreateListRequest(string subscriptionId, AzureLocation loca return message; } - /// Get the lists of unsupported vm sizes for Service Fabric Managed Clusters. - /// The customer subscription identifier. + /// Get unsupported vm size for Service Fabric Managed Clusters. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. + /// VM Size name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetManagedUnsupportedVmSizeAsync(string subscriptionId, string location, string vmSize, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); + Argument.AssertNotNullOrEmpty(vmSize, nameof(vmSize)); - using var message = CreateListRequest(subscriptionId, location); + using var message = CreateGetManagedUnsupportedVmSizeRequest(subscriptionId, location, vmSize); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ManagedVmSizesResult value = default; + ServiceFabricManagedUnsupportedVmSize value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ManagedVmSizesResult.DeserializeManagedVmSizesResult(document.RootElement); + value = ServiceFabricManagedUnsupportedVmSize.DeserializeServiceFabricManagedUnsupportedVmSize(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -94,25 +99,28 @@ public async Task> ListAsync(string subscriptionI } } - /// Get the lists of unsupported vm sizes for Service Fabric Managed Clusters. - /// The customer subscription identifier. + /// Get unsupported vm size for Service Fabric Managed Clusters. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. + /// VM Size name. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response GetManagedUnsupportedVmSize(string subscriptionId, string location, string vmSize, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); + Argument.AssertNotNullOrEmpty(vmSize, nameof(vmSize)); - using var message = CreateListRequest(subscriptionId, location); + using var message = CreateGetManagedUnsupportedVmSizeRequest(subscriptionId, location, vmSize); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ManagedVmSizesResult value = default; + ServiceFabricManagedUnsupportedVmSize value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ManagedVmSizesResult.DeserializeManagedVmSizesResult(document.RootElement); + value = ServiceFabricManagedUnsupportedVmSize.DeserializeServiceFabricManagedUnsupportedVmSize(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -120,7 +128,7 @@ public Response List(string subscriptionId, AzureLocation } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string vmSize) + internal RequestUriBuilder CreateGetManagedUnsupportedVmSizesRequestUri(string subscriptionId, string location) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -128,13 +136,12 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocat uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/locations/", false); uri.AppendPath(location, true); - uri.AppendPath("/managedUnsupportedVMSizes/", false); - uri.AppendPath(vmSize, true); + uri.AppendPath("/managedUnsupportedVMSizes", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string vmSize) + internal HttpMessage CreateGetManagedUnsupportedVmSizesRequest(string subscriptionId, string location) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -145,8 +152,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation locat uri.AppendPath(subscriptionId, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/locations/", false); uri.AppendPath(location, true); - uri.AppendPath("/managedUnsupportedVMSizes/", false); - uri.AppendPath(vmSize, true); + uri.AppendPath("/managedUnsupportedVMSizes", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -154,27 +160,26 @@ internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation locat return message; } - /// Get unsupported vm size for Service Fabric Managed Clusters. - /// The customer subscription identifier. + /// Get the lists of unsupported vm sizes for Service Fabric Managed Clusters. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. - /// VM Size 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 vmSize, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetManagedUnsupportedVmSizesAsync(string subscriptionId, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(vmSize, nameof(vmSize)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); - using var message = CreateGetRequest(subscriptionId, location, vmSize); + using var message = CreateGetManagedUnsupportedVmSizesRequest(subscriptionId, location); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - ServiceFabricManagedUnsupportedVmSize value = default; + ManagedVmSizesResult value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ServiceFabricManagedUnsupportedVmSize.DeserializeServiceFabricManagedUnsupportedVmSize(document.RootElement); + value = ManagedVmSizesResult.DeserializeManagedVmSizesResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -182,27 +187,26 @@ public async Task> GetAsync(stri } } - /// Get unsupported vm size for Service Fabric Managed Clusters. - /// The customer subscription identifier. + /// Get the lists of unsupported vm sizes for Service Fabric Managed Clusters. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. - /// VM Size 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 vmSize, CancellationToken cancellationToken = default) + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response GetManagedUnsupportedVmSizes(string subscriptionId, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); - Argument.AssertNotNullOrEmpty(vmSize, nameof(vmSize)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); - using var message = CreateGetRequest(subscriptionId, location, vmSize); + using var message = CreateGetManagedUnsupportedVmSizesRequest(subscriptionId, location); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - ServiceFabricManagedUnsupportedVmSize value = default; + ManagedVmSizesResult value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ServiceFabricManagedUnsupportedVmSize.DeserializeServiceFabricManagedUnsupportedVmSize(document.RootElement); + value = ManagedVmSizesResult.DeserializeManagedVmSizesResult(document.RootElement); return Response.FromValue(value, message.Response); } default: @@ -210,7 +214,7 @@ public Response Get(string subscriptionId } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, AzureLocation location) + internal RequestUriBuilder CreateGetManagedUnsupportedVmSizesNextPageRequestUri(string nextLink, string subscriptionId, string location) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -218,7 +222,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, AzureLocation location) + internal HttpMessage CreateGetManagedUnsupportedVmSizesNextPageRequest(string nextLink, string subscriptionId, string location) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -234,17 +238,18 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get the lists of unsupported vm sizes for Service Fabric Managed Clusters. /// The URL to the next page of results. - /// The customer subscription identifier. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> GetManagedUnsupportedVmSizesNextPageAsync(string nextLink, string subscriptionId, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, location); + using var message = CreateGetManagedUnsupportedVmSizesNextPageRequest(nextLink, subscriptionId, location); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -262,17 +267,18 @@ public async Task> ListNextPageAsync(string nextL /// Get the lists of unsupported vm sizes for Service Fabric Managed Clusters. /// The URL to the next page of results. - /// The customer subscription identifier. + /// The ID of the target subscription. The value must be an UUID. /// The location for the cluster code versions. This is different from cluster location. /// The cancellation token to use. - /// or is null. - /// is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, AzureLocation location, CancellationToken cancellationToken = default) + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response GetManagedUnsupportedVmSizesNextPage(string nextLink, string subscriptionId, string location, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(location, nameof(location)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, location); + using var message = CreateGetManagedUnsupportedVmSizesNextPageRequest(nextLink, subscriptionId, location); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/NodeTypeSkusRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/NodeTypeSkusRestOperations.cs index 1b2c284ea8e5..7776f44c54d1 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/NodeTypeSkusRestOperations.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/NodeTypeSkusRestOperations.cs @@ -25,18 +25,18 @@ internal partial class NodeTypeSkusRestOperations /// Initializes a new instance of NodeTypeSkusRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public NodeTypeSkusRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) + internal RequestUriBuilder CreateGetAvailableSkusRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -53,7 +53,7 @@ internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string re return uri; } - internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) + internal HttpMessage CreateGetAvailableSkusRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -77,21 +77,21 @@ internal HttpMessage CreateListRequest(string subscriptionId, string resourceGro } /// Get a Service Fabric node type supported SKUs. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the node type. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) + public async Task> GetAvailableSkusAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); + using var message = CreateGetAvailableSkusRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -108,21 +108,21 @@ public async Task> ListAsync(string subscription } /// Get a Service Fabric node type supported SKUs. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the node type. /// The cancellation token to use. /// , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response List(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) + public Response GetAvailableSkus(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); - using var message = CreateListRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); + using var message = CreateGetAvailableSkusRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { @@ -138,7 +138,7 @@ public Response List(string subscriptionId, string resour } } - internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) + internal RequestUriBuilder CreateGetAvailableSkusNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -146,7 +146,7 @@ internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string return uri; } - internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) + internal HttpMessage CreateGetAvailableSkusNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -162,14 +162,14 @@ internal HttpMessage CreateListNextPageRequest(string nextLink, string subscript /// Get a Service Fabric node type supported SKUs. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the node type. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) + public async Task> GetAvailableSkusNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -177,7 +177,7 @@ public async Task> ListNextPageAsync(string next Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, clusterName, nodeTypeName); + using var message = CreateGetAvailableSkusNextPageRequest(nextLink, subscriptionId, resourceGroupName, clusterName, nodeTypeName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { @@ -195,14 +195,14 @@ public async Task> ListNextPageAsync(string next /// Get a Service Fabric node type supported SKUs. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the node type. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) + public Response GetAvailableSkusNextPage(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNull(nextLink, nameof(nextLink)); Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); @@ -210,7 +210,7 @@ public Response ListNextPage(string nextLink, string subs Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); - using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, clusterName, nodeTypeName); + using var message = CreateGetAvailableSkusNextPageRequest(nextLink, subscriptionId, resourceGroupName, clusterName, nodeTypeName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/NodeTypesRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/NodeTypesRestOperations.cs index dd4e1bb607d6..49e9cf63bc16 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/NodeTypesRestOperations.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/NodeTypesRestOperations.cs @@ -25,18 +25,18 @@ internal partial class NodeTypesRestOperations /// Initializes a new instance of NodeTypesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public NodeTypesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } - internal RequestUriBuilder CreateListByManagedClustersRequestUri(string subscriptionId, string resourceGroupName, string clusterName) + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -46,12 +46,13 @@ internal RequestUriBuilder CreateListByManagedClustersRequestUri(string subscrip uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); - uri.AppendPath("/nodeTypes", false); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, true); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateListByManagedClustersRequest(string subscriptionId, string resourceGroupName, string clusterName) + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -64,7 +65,8 @@ internal HttpMessage CreateListByManagedClustersRequest(string subscriptionId, s uri.AppendPath(resourceGroupName, true); uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); - uri.AppendPath("/nodeTypes", false); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, true); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -72,65 +74,73 @@ internal HttpMessage CreateListByManagedClustersRequest(string subscriptionId, s return message; } - /// Gets all Node types of the specified managed cluster. - /// The customer subscription identifier. - /// The name of the resource group. + /// Get a Service Fabric node type of a given managed 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 cluster resource. + /// The name of the node type. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public async Task> ListByManagedClustersAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); - using var message = CreateListByManagedClustersRequest(subscriptionId, resourceGroupName, clusterName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: { - NodeTypeListResult value = default; + ServiceFabricManagedNodeTypeData value = default; using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = NodeTypeListResult.DeserializeNodeTypeListResult(document.RootElement); + value = ServiceFabricManagedNodeTypeData.DeserializeServiceFabricManagedNodeTypeData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((ServiceFabricManagedNodeTypeData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - /// Gets all Node types of the specified managed cluster. - /// The customer subscription identifier. - /// The name of the resource group. + /// Get a Service Fabric node type of a given managed 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 cluster resource. + /// The name of the node type. /// The cancellation token to use. - /// , or is null. - /// , or is an empty string, and was expected to be non-empty. - public Response ListByManagedClusters(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); - using var message = CreateListByManagedClustersRequest(subscriptionId, resourceGroupName, clusterName); + using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: { - NodeTypeListResult value = default; + ServiceFabricManagedNodeTypeData value = default; using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = NodeTypeListResult.DeserializeNodeTypeListResult(document.RootElement); + value = ServiceFabricManagedNodeTypeData.DeserializeServiceFabricManagedNodeTypeData(document.RootElement); return Response.FromValue(value, message.Response); } + case 404: + return Response.FromValue((ServiceFabricManagedNodeTypeData)null, message.Response); default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateRestartRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, ServiceFabricManagedNodeTypeData data) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -142,16 +152,15 @@ internal RequestUriBuilder CreateRestartRequestUri(string subscriptionId, string uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); - uri.AppendPath("/restart", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateRestartRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, ServiceFabricManagedNodeTypeData data) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Post; + request.Method = RequestMethod.Put; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -162,7 +171,694 @@ internal HttpMessage CreateRestartRequest(string subscriptionId, string resource uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); - uri.AppendPath("/restart", 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 or update a Service Fabric node type of a given managed 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 cluster resource. + /// The name of the node type. + /// The node type resource. + /// 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 clusterName, string nodeTypeName, ServiceFabricManagedNodeTypeData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, 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); + } + } + + /// Create or update a Service Fabric node type of a given managed 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 cluster resource. + /// The name of the node type. + /// The node type resource. + /// 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 clusterName, string nodeTypeName, ServiceFabricManagedNodeTypeData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, ServiceFabricManagedNodeTypePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, ServiceFabricManagedNodeTypePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, 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 the configuration of a node type of a given managed cluster, only updating tags. + /// 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 cluster resource. + /// The name of the node type. + /// The parameters to update the node type configuration. + /// 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 clusterName, string nodeTypeName, ServiceFabricManagedNodeTypePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, 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 the configuration of a node type of a given managed cluster, only updating tags. + /// 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 cluster resource. + /// The name of the node type. + /// The parameters to update the node type configuration. + /// 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 clusterName, string nodeTypeName, ServiceFabricManagedNodeTypePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, 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 clusterName, string nodeTypeName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Delete a Service Fabric node type of a given managed 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 cluster resource. + /// The name of the node type. + /// 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 clusterName, string nodeTypeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); + 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 Service Fabric node type of a given managed 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 cluster resource. + /// The name of the node type. + /// 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 clusterName, string nodeTypeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListByManagedClustersRequestUri(string subscriptionId, string resourceGroupName, string clusterName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByManagedClustersRequest(string subscriptionId, string resourceGroupName, string clusterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all Node types of the specified managed 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 cluster resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListByManagedClustersAsync(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var message = CreateListByManagedClustersRequest(subscriptionId, resourceGroupName, clusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + NodeTypeListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = NodeTypeListResult.DeserializeNodeTypeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all Node types of the specified managed 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 cluster resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListByManagedClusters(string subscriptionId, string resourceGroupName, string clusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + + using var message = CreateListByManagedClustersRequest(subscriptionId, resourceGroupName, clusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + NodeTypeListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = NodeTypeListResult.DeserializeNodeTypeListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeallocateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/deallocate", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeallocateRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/deallocate", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Deallocates one or more nodes on the node type. It will disable the fabric nodes, trigger a shutdown on the VMs and release them from the 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 cluster resource. + /// The name of the node type. + /// parameters for deallocate action. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeallocateAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deallocates one or more nodes on the node type. It will disable the fabric nodes, trigger a shutdown on the VMs and release them from the 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 cluster resource. + /// The name of the node type. + /// parameters for deallocate action. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Deallocate(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateDeallocateRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteNodeRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/deleteNode", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteNodeRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/deleteNode", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and removes the state from the 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 cluster resource. + /// The name of the node type. + /// parameters for delete action. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteNodeAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateDeleteNodeRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and removes the state from the 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 cluster resource. + /// The name of the node type. + /// parameters for delete action. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeleteNode(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateDeleteNodeRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateRedeployRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/redeploy", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateRedeployRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/redeploy", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Redeploys one or more nodes on the node type. It will disable the fabric nodes, trigger a shut down on the VMs, move them to a new node, and power them back on. + /// 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 cluster resource. + /// The name of the node type. + /// parameters for redeploy action. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task RedeployAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateRedeployRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Redeploys one or more nodes on the node type. It will disable the fabric nodes, trigger a shut down on the VMs, move them to a new node, and power them back on. + /// 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 cluster resource. + /// The name of the node type. + /// parameters for redeploy action. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Redeploy(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateRedeployRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateReimageRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/reimage", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateReimageRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); + uri.AppendPath(clusterName, true); + uri.AppendPath("/nodeTypes/", false); + uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/reimage", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -174,16 +870,16 @@ internal HttpMessage CreateRestartRequest(string subscriptionId, string resource return message; } - /// Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and activate the nodes back again. - /// The customer subscription identifier. - /// The name of the resource group. + /// Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and activate the nodes back again. + /// 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 cluster resource. /// The name of the node type. - /// parameters for restart action. + /// parameters for reimage action. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task RestartAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) + public async Task ReimageAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -191,11 +887,10 @@ public async Task RestartAsync(string subscriptionId, string resourceG Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateRestartRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); + using var message = CreateReimageRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: return message.Response; default: @@ -203,16 +898,16 @@ public async Task RestartAsync(string subscriptionId, string resourceG } } - /// Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and activate the nodes back again. - /// The customer subscription identifier. - /// The name of the resource group. + /// Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and activate the nodes back again. + /// 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 cluster resource. /// The name of the node type. - /// parameters for restart action. + /// parameters for reimage action. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Restart(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) + public Response Reimage(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -220,11 +915,10 @@ public Response Restart(string subscriptionId, string resourceGroupName, string Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateRestartRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); + using var message = CreateReimageRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: return message.Response; default: @@ -232,7 +926,7 @@ public Response Restart(string subscriptionId, string resourceGroupName, string } } - internal RequestUriBuilder CreateReimageRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + internal RequestUriBuilder CreateRestartRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -244,12 +938,12 @@ internal RequestUriBuilder CreateReimageRequestUri(string subscriptionId, string uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); - uri.AppendPath("/reimage", false); + uri.AppendPath("/restart", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateReimageRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + internal HttpMessage CreateRestartRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -264,7 +958,7 @@ internal HttpMessage CreateReimageRequest(string subscriptionId, string resource uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); - uri.AppendPath("/reimage", false); + uri.AppendPath("/restart", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -276,16 +970,16 @@ internal HttpMessage CreateReimageRequest(string subscriptionId, string resource return message; } - /// Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and activate the nodes back again. - /// The customer subscription identifier. - /// The name of the resource group. + /// Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and activate the nodes back again. + /// 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 cluster resource. /// The name of the node type. - /// parameters for reimage action. + /// parameters for restart action. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task ReimageAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) + public async Task RestartAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -293,11 +987,10 @@ public async Task ReimageAsync(string subscriptionId, string resourceG Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateReimageRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); + using var message = CreateRestartRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: return message.Response; default: @@ -305,16 +998,16 @@ public async Task ReimageAsync(string subscriptionId, string resourceG } } - /// Reimages one or more nodes on the node type. It will disable the fabric nodes, trigger a reimage on the VMs and activate the nodes back again. - /// The customer subscription identifier. - /// The name of the resource group. + /// Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and activate the nodes back again. + /// 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 cluster resource. /// The name of the node type. - /// parameters for reimage action. + /// parameters for restart action. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Reimage(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) + public Response Restart(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -322,11 +1015,10 @@ public Response Reimage(string subscriptionId, string resourceGroupName, string Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateReimageRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); + using var message = CreateRestartRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: return message.Response; default: @@ -334,7 +1026,7 @@ public Response Reimage(string subscriptionId, string resourceGroupName, string } } - internal RequestUriBuilder CreateDeleteNodeRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -346,12 +1038,12 @@ internal RequestUriBuilder CreateDeleteNodeRequestUri(string subscriptionId, str uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); - uri.AppendPath("/deleteNode", false); + uri.AppendPath("/start", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteNodeRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; @@ -366,7 +1058,7 @@ internal HttpMessage CreateDeleteNodeRequest(string subscriptionId, string resou uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); - uri.AppendPath("/deleteNode", false); + uri.AppendPath("/start", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -378,16 +1070,16 @@ internal HttpMessage CreateDeleteNodeRequest(string subscriptionId, string resou return message; } - /// Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and removes the state from the cluster. - /// The customer subscription identifier. - /// The name of the resource group. + /// Starts one or more nodes on the node type. It will trigger an allocation of the fabric node if needed and activate them. + /// 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 cluster resource. /// The name of the node type. - /// parameters for delete action. + /// parameters for start action. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task DeleteNodeAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) + public async Task StartAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -395,11 +1087,10 @@ public async Task DeleteNodeAsync(string subscriptionId, string resour Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateDeleteNodeRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); + using var message = CreateStartRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: return message.Response; default: @@ -407,16 +1098,16 @@ public async Task DeleteNodeAsync(string subscriptionId, string resour } } - /// Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and removes the state from the cluster. - /// The customer subscription identifier. - /// The name of the resource group. + /// Starts one or more nodes on the node type. It will trigger an allocation of the fabric node if needed and activate them. + /// 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 cluster resource. /// The name of the node type. - /// parameters for delete action. + /// parameters for start action. /// The cancellation token to use. /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response DeleteNode(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) + public Response Start(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, NodeTypeActionContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); @@ -424,11 +1115,10 @@ public Response DeleteNode(string subscriptionId, string resourceGroupName, stri Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); Argument.AssertNotNull(content, nameof(content)); - using var message = CreateDeleteNodeRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); + using var message = CreateStartRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: return message.Response; default: @@ -436,7 +1126,7 @@ public Response DeleteNode(string subscriptionId, string resourceGroupName, stri } } - internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) + internal RequestUriBuilder CreateStartFaultSimulationRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, FaultSimulationContentWrapper faultSimulationContentWrapper) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -448,15 +1138,16 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/startFaultSimulation", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) + internal HttpMessage CreateStartFaultSimulationRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, FaultSimulationContentWrapper faultSimulationContentWrapper) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Get; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -467,80 +1158,75 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/startFaultSimulation", 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(faultSimulationContentWrapper, ModelSerializationExtensions.WireOptions); + request.Content = content; _userAgent.Apply(message); return message; } - /// Get a Service Fabric node type of a given managed cluster. - /// The customer subscription identifier. - /// The name of the resource group. + /// Starts a fault simulation on the node type. + /// 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 cluster resource. /// The name of the node type. + /// parameters describing the fault simulation. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task> GetAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) + public async Task StartFaultSimulationAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, FaultSimulationContentWrapper faultSimulationContentWrapper, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + Argument.AssertNotNull(faultSimulationContentWrapper, nameof(faultSimulationContentWrapper)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); + using var message = CreateStartFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, faultSimulationContentWrapper); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: - { - ServiceFabricManagedNodeTypeData value = default; - using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); - value = ServiceFabricManagedNodeTypeData.DeserializeServiceFabricManagedNodeTypeData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ServiceFabricManagedNodeTypeData)null, message.Response); + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - /// Get a Service Fabric node type of a given managed cluster. - /// The customer subscription identifier. - /// The name of the resource group. + /// Starts a fault simulation on the node type. + /// 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 cluster resource. /// The name of the node type. + /// parameters describing the fault simulation. /// The cancellation token to use. - /// , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Get(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) + public Response StartFaultSimulation(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, FaultSimulationContentWrapper faultSimulationContentWrapper, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + Argument.AssertNotNull(faultSimulationContentWrapper, nameof(faultSimulationContentWrapper)); - using var message = CreateGetRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); + using var message = CreateStartFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, faultSimulationContentWrapper); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: - { - ServiceFabricManagedNodeTypeData value = default; - using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); - value = ServiceFabricManagedNodeTypeData.DeserializeServiceFabricManagedNodeTypeData(document.RootElement); - return Response.FromValue(value, message.Response); - } - case 404: - return Response.FromValue((ServiceFabricManagedNodeTypeData)null, message.Response); + case 202: + return message.Response; default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, ServiceFabricManagedNodeTypeData data) + internal RequestUriBuilder CreateStopFaultSimulationRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, FaultSimulationIdContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -552,15 +1238,16 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/stopFaultSimulation", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, ServiceFabricManagedNodeTypeData data) + internal HttpMessage CreateStopFaultSimulationRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, FaultSimulationIdContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Put; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -571,39 +1258,39 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/stopFaultSimulation", 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; + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Create or update a Service Fabric node type of a given managed cluster. - /// The customer subscription identifier. - /// The name of the resource group. + /// Stops a fault simulation on the node type. + /// 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 cluster resource. /// The name of the node type. - /// The node type resource. + /// parameter with fault simulation id. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, ServiceFabricManagedNodeTypeData data, CancellationToken cancellationToken = default) + public async Task StopFaultSimulationAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, FaultSimulationIdContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, data); + using var message = CreateStopFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: return message.Response; default: @@ -611,28 +1298,27 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } } - /// Create or update a Service Fabric node type of a given managed cluster. - /// The customer subscription identifier. - /// The name of the resource group. + /// Stops a fault simulation on the node type. + /// 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 cluster resource. /// The name of the node type. - /// The node type resource. + /// parameter with fault simulation id. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, ServiceFabricManagedNodeTypeData data, CancellationToken cancellationToken = default) + public Response StopFaultSimulation(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, FaultSimulationIdContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); - Argument.AssertNotNull(data, nameof(data)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, data); + using var message = CreateStopFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: return message.Response; default: @@ -640,7 +1326,7 @@ public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, } } - internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, ServiceFabricManagedNodeTypePatch patch) + internal RequestUriBuilder CreateGetFaultSimulationRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, FaultSimulationIdContent content) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -652,15 +1338,16 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/getFaultSimulation", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, ServiceFabricManagedNodeTypePatch patch) + internal HttpMessage CreateGetFaultSimulationRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, FaultSimulationIdContent content) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Patch; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -671,76 +1358,85 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/getFaultSimulation", 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; + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; _userAgent.Apply(message); return message; } - /// Update the configuration of a node type of a given managed cluster, only updating tags. - /// The customer subscription identifier. - /// The name of the resource group. + /// Gets a fault simulation by the simulationId. + /// 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 cluster resource. /// The name of the node type. - /// The parameters to update the node type configuration. + /// parameter with fault simulation id. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, ServiceFabricManagedNodeTypePatch patch, CancellationToken cancellationToken = default) + public async Task> GetFaultSimulationAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, FaultSimulationIdContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, patch); + using var message = CreateGetFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + FaultSimulation value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FaultSimulation.DeserializeFaultSimulation(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Update the configuration of a node type of a given managed cluster, only updating tags. - /// The customer subscription identifier. - /// The name of the resource group. + /// Gets a fault simulation by the simulationId. + /// 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 cluster resource. /// The name of the node type. - /// The parameters to update the node type configuration. + /// parameter with fault simulation id. /// The cancellation token to use. - /// , , , or is null. + /// , , , or is null. /// , , or is an empty string, and was expected to be non-empty. - public Response Update(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, ServiceFabricManagedNodeTypePatch patch, CancellationToken cancellationToken = default) + public Response GetFaultSimulation(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, FaultSimulationIdContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); - Argument.AssertNotNull(patch, nameof(patch)); + Argument.AssertNotNull(content, nameof(content)); - using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, patch); + using var message = CreateGetFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName, content); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - return message.Response; + { + FaultSimulation value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FaultSimulation.DeserializeFaultSimulation(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) + internal RequestUriBuilder CreateListFaultSimulationRequestUri(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) { var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); @@ -752,15 +1448,16 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/listFaultSimulation", false); uri.AppendQuery("api-version", _apiVersion, true); return uri; } - internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) + internal HttpMessage CreateListFaultSimulationRequest(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) { var message = _pipeline.CreateMessage(); var request = message.Request; - request.Method = RequestMethod.Delete; + request.Method = RequestMethod.Post; var uri = new RawRequestUriBuilder(); uri.Reset(_endpoint); uri.AppendPath("/subscriptions/", false); @@ -771,6 +1468,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(clusterName, true); uri.AppendPath("/nodeTypes/", false); uri.AppendPath(nodeTypeName, true); + uri.AppendPath("/listFaultSimulation", false); uri.AppendQuery("api-version", _apiVersion, true); request.Uri = uri; request.Headers.Add("Accept", "application/json"); @@ -778,57 +1476,63 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG return message; } - /// Delete a Service Fabric node type of a given managed cluster. - /// The customer subscription identifier. - /// The name of the resource group. + /// Gets the list of recent fault simulations for the node type. + /// 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 cluster resource. /// The name of the node type. /// 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 clusterName, string nodeTypeName, CancellationToken cancellationToken = default) + public async Task> ListFaultSimulationAsync(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); + using var message = CreateListFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + FaultSimulationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FaultSimulationListResult.DeserializeFaultSimulationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } } - /// Delete a Service Fabric node type of a given managed cluster. - /// The customer subscription identifier. - /// The name of the resource group. + /// Gets the list of recent fault simulations for the node type. + /// 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 cluster resource. /// The name of the node type. /// 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 clusterName, string nodeTypeName, CancellationToken cancellationToken = default) + public Response ListFaultSimulation(string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) { Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); - using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); + using var message = CreateListFaultSimulationRequest(subscriptionId, resourceGroupName, clusterName, nodeTypeName); _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { case 200: - case 202: - case 204: - return message.Response; + { + FaultSimulationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FaultSimulationListResult.DeserializeFaultSimulationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } default: throw new RequestFailedException(message.Response); } @@ -858,8 +1562,8 @@ internal HttpMessage CreateListByManagedClustersNextPageRequest(string nextLink, /// Gets all Node types of the specified managed cluster. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The cancellation token to use. /// , , or is null. @@ -889,8 +1593,8 @@ public async Task> ListByManagedClustersNextPageAsy /// Gets all Node types of the specified managed cluster. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The cancellation token to use. /// , , or is null. @@ -917,5 +1621,93 @@ public Response ListByManagedClustersNextPage(string nextLin throw new RequestFailedException(message.Response); } } + + internal RequestUriBuilder CreateListFaultSimulationNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListFaultSimulationNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the list of recent fault simulations for the node type. + /// 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 cluster resource. + /// The name of the node type. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> ListFaultSimulationNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + + using var message = CreateListFaultSimulationNextPageRequest(nextLink, subscriptionId, resourceGroupName, clusterName, nodeTypeName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FaultSimulationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = FaultSimulationListResult.DeserializeFaultSimulationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the list of recent fault simulations for the node type. + /// 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 cluster resource. + /// The name of the node type. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response ListFaultSimulationNextPage(string nextLink, string subscriptionId, string resourceGroupName, string clusterName, string nodeTypeName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(clusterName, nameof(clusterName)); + Argument.AssertNotNullOrEmpty(nodeTypeName, nameof(nodeTypeName)); + + using var message = CreateListFaultSimulationNextPageRequest(nextLink, subscriptionId, resourceGroupName, clusterName, nodeTypeName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FaultSimulationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = FaultSimulationListResult.DeserializeFaultSimulationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/OperationResultsRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/OperationResultsRestOperations.cs new file mode 100644 index 000000000000..b033ef044bbf --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/OperationResultsRestOperations.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.Pipeline; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters +{ + internal partial class OperationResultsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of OperationResultsRestOperations. + /// 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 OperationResultsRestOperations(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-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string operationId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/managedClusterOperationResults/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string operationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/managedClusterOperationResults/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get long running operation result. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// operation identifier. + /// 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 operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, location, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get long running operation result. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// operation identifier. + /// 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 operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, location, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/OperationStatusRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/OperationStatusRestOperations.cs new file mode 100644 index 000000000000..25b7afe5e718 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/OperationStatusRestOperations.cs @@ -0,0 +1,129 @@ +// 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.ServiceFabricManagedClusters.Models; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters +{ + internal partial class OperationStatusRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of OperationStatusRestOperations. + /// 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 OperationStatusRestOperations(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-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, AzureLocation location, string operationId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/managedClusterOperations/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, AzureLocation location, string operationId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.ServiceFabric/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/managedClusterOperations/", false); + uri.AppendPath(operationId, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get long running operation status. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// operation identifier. + /// 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 operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, location, operationId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + LongRunningOperationResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = LongRunningOperationResult.DeserializeLongRunningOperationResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get long running operation status. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// operation identifier. + /// 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 operationId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(operationId, nameof(operationId)); + + using var message = CreateGetRequest(subscriptionId, location, operationId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + LongRunningOperationResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = LongRunningOperationResult.DeserializeLongRunningOperationResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/OperationsRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/OperationsRestOperations.cs new file mode 100644 index 000000000000..2b297ac70ffe --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/OperationsRestOperations.cs @@ -0,0 +1,173 @@ +// 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.ServiceFabricManagedClusters.Models; + +namespace Azure.ResourceManager.ServiceFabricManagedClusters +{ + internal partial class OperationsRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of OperationsRestOperations. + /// 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 OperationsRestOperations(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-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateListRequestUri() + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.ServiceFabric/operations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest() + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/providers/Microsoft.ServiceFabric/operations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the list of available Service Fabric resource provider API operations. + /// The cancellation token to use. + public async Task> ListAsync(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperationListResult.DeserializeOperationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the list of available Service Fabric resource provider API operations. + /// The cancellation token to use. + public Response List(CancellationToken cancellationToken = default) + { + using var message = CreateListRequest(); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperationListResult.DeserializeOperationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Get the list of available Service Fabric resource provider API operations. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public async Task> ListNextPageAsync(string nextLink, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + + using var message = CreateListNextPageRequest(nextLink); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + OperationListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = OperationListResult.DeserializeOperationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the list of available Service Fabric resource provider API operations. + /// The URL to the next page of results. + /// The cancellation token to use. + /// is null. + public Response ListNextPage(string nextLink, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + + using var message = CreateListNextPageRequest(nextLink); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + OperationListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = OperationListResult.DeserializeOperationListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ServicesRestOperations.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ServicesRestOperations.cs index 24d70faa8dc8..8e07e995b535 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ServicesRestOperations.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/RestOperations/ServicesRestOperations.cs @@ -25,14 +25,14 @@ internal partial class ServicesRestOperations /// Initializes a new instance of ServicesRestOperations. /// The HTTP pipeline for sending and receiving REST requests and responses. /// The application id to use for user agent. - /// server parameter. - /// Api Version. + /// Service host. + /// The API version to use for this operation. /// or is null. public ServicesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2024-09-01-preview"; + _apiVersion = apiVersion ?? "2025-03-01-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -44,7 +44,7 @@ internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string res uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); @@ -65,7 +65,7 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); @@ -79,8 +79,8 @@ internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGrou } /// Get a Service Fabric service resource created or in the process of being created in the Service Fabric managed application resource. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application resource. /// The name of the service resource in the format of {applicationName}~{serviceName}. @@ -114,8 +114,8 @@ public async Task> GetAsync(string sub } /// Get a Service Fabric service resource created or in the process of being created in the Service Fabric managed application resource. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application resource. /// The name of the service resource in the format of {applicationName}~{serviceName}. @@ -156,7 +156,7 @@ internal RequestUriBuilder CreateCreateOrUpdateRequestUri(string subscriptionId, uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); @@ -177,7 +177,7 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); @@ -195,8 +195,8 @@ internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string r } /// Create or update a Service Fabric managed service resource with the specified name. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application resource. /// The name of the service resource in the format of {applicationName}~{serviceName}. @@ -226,8 +226,8 @@ public async Task CreateOrUpdateAsync(string subscriptionId, string re } /// Create or update a Service Fabric managed service resource with the specified name. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application resource. /// The name of the service resource in the format of {applicationName}~{serviceName}. @@ -264,7 +264,7 @@ internal RequestUriBuilder CreateUpdateRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); @@ -285,7 +285,7 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); @@ -303,8 +303,8 @@ internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceG } /// Updates the tags of a service resource of a given managed cluster. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application resource. /// The name of the service resource in the format of {applicationName}~{serviceName}. @@ -338,8 +338,8 @@ public async Task> UpdateAsync(string } /// Updates the tags of a service resource of a given managed cluster. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application resource. /// The name of the service resource in the format of {applicationName}~{serviceName}. @@ -380,7 +380,7 @@ internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); @@ -401,7 +401,7 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); @@ -415,8 +415,8 @@ internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceG } /// Delete a Service Fabric managed service resource with the specified name. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application resource. /// The name of the service resource in the format of {applicationName}~{serviceName}. @@ -435,7 +435,6 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; @@ -445,8 +444,8 @@ public async Task DeleteAsync(string subscriptionId, string resourceGr } /// Delete a Service Fabric managed service resource with the specified name. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application resource. /// The name of the service resource in the format of {applicationName}~{serviceName}. @@ -465,7 +464,6 @@ public Response Delete(string subscriptionId, string resourceGroupName, string c _pipeline.Send(message, cancellationToken); switch (message.Response.Status) { - case 200: case 202: case 204: return message.Response; @@ -482,7 +480,7 @@ internal RequestUriBuilder CreateListByApplicationsRequestUri(string subscriptio uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); @@ -502,7 +500,7 @@ internal HttpMessage CreateListByApplicationsRequest(string subscriptionId, stri uri.AppendPath(subscriptionId, true); uri.AppendPath("/resourceGroups/", false); uri.AppendPath(resourceGroupName, true); - uri.AppendPath("/providers/Microsoft.ServiceFabric/managedclusters/", false); + uri.AppendPath("/providers/Microsoft.ServiceFabric/managedClusters/", false); uri.AppendPath(clusterName, true); uri.AppendPath("/applications/", false); uri.AppendPath(applicationName, true); @@ -515,8 +513,8 @@ internal HttpMessage CreateListByApplicationsRequest(string subscriptionId, stri } /// Gets all service resources created or in the process of being created in the Service Fabric managed application resource. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application resource. /// The cancellation token to use. @@ -546,8 +544,8 @@ public async Task> ListByApplicationsAsync(string } /// Gets all service resources created or in the process of being created in the Service Fabric managed application resource. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application resource. /// The cancellation token to use. @@ -600,8 +598,8 @@ internal HttpMessage CreateListByApplicationsNextPageRequest(string nextLink, st /// Gets all service resources created or in the process of being created in the Service Fabric managed application resource. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application resource. /// The cancellation token to use. @@ -633,8 +631,8 @@ public async Task> ListByApplicationsNextPageAsync /// Gets all service resources created or in the process of being created in the Service Fabric managed application resource. /// The URL to the next page of results. - /// The customer subscription identifier. - /// The name of the 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 name of the cluster resource. /// The name of the application resource. /// The cancellation token to use. diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationCollection.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationCollection.cs index 059dab1723da..37f00cc1b983 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationCollection.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationCollection.cs @@ -56,15 +56,15 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_CreateOrUpdate + /// ApplicationResource_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -105,15 +105,15 @@ public virtual async Task> /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_CreateOrUpdate + /// ApplicationResource_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -154,15 +154,15 @@ public virtual ArmOperation CreateOrUpd /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -199,15 +199,15 @@ public virtual async Task> Get /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -244,15 +244,15 @@ public virtual Response Get(string appl /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications /// /// /// Operation Id - /// Applications_List + /// ApplicationResource_List /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -274,15 +274,15 @@ public virtual AsyncPageable GetAllAsyn /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications /// /// /// Operation Id - /// Applications_List + /// ApplicationResource_List /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -304,15 +304,15 @@ public virtual Pageable GetAll(Cancella /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -347,15 +347,15 @@ public virtual async Task> ExistsAsync(string applicationName, Ca /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -390,15 +390,15 @@ public virtual Response Exists(string applicationName, CancellationToken c /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -435,15 +435,15 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationData.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationData.Serialization.cs index 3b9e03751b61..ea45ffbc19fb 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationData.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationData.Serialization.cs @@ -243,12 +243,12 @@ internal static ServiceFabricManagedApplicationData DeserializeServiceFabricMana systemData, tags ?? new ChangeTrackingDictionary(), location, - identity, provisioningState, version, parameters ?? new ChangeTrackingDictionary(), upgradePolicy, managedIdentities ?? new ChangeTrackingList(), + identity, serializedAdditionalRawData); } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationData.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationData.cs index 2a875e2e4af5..202514061bec 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationData.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationData.cs @@ -66,25 +66,24 @@ public ServiceFabricManagedApplicationData(AzureLocation location) : base(locati /// The systemData. /// The tags. /// The location. - /// Describes the managed identities for an Azure resource. /// The current deployment or provisioning state, which only appears in the response. /// /// The version of the application type as defined in the application manifest. /// This name must be the full Arm Resource ID for the referenced application type version. - /// /// /// List of application parameters with overridden values from their default values specified in the application manifest. /// Describes the policy for a monitored application upgrade. /// List of user assigned identities for the application, each mapped to a friendly name. + /// Describes the managed identities for an Azure resource. /// Keeps track of any properties unknown to the library. - internal ServiceFabricManagedApplicationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ManagedServiceIdentity identity, string provisioningState, string version, IDictionary parameters, ApplicationUpgradePolicy upgradePolicy, IList managedIdentities, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ServiceFabricManagedApplicationData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string provisioningState, string version, IDictionary parameters, ApplicationUpgradePolicy upgradePolicy, IList managedIdentities, ManagedServiceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Identity = identity; ProvisioningState = provisioningState; Version = version; Parameters = parameters; UpgradePolicy = upgradePolicy; ManagedIdentities = managedIdentities; + Identity = identity; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -93,14 +92,11 @@ internal ServiceFabricManagedApplicationData() { } - /// Describes the managed identities for an Azure resource. - public ManagedServiceIdentity Identity { get; set; } /// The current deployment or provisioning state, which only appears in the response. public string ProvisioningState { get; } /// /// The version of the application type as defined in the application manifest. /// This name must be the full Arm Resource ID for the referenced application type version. - /// /// public string Version { get; set; } /// List of application parameters with overridden values from their default values specified in the application manifest. @@ -109,5 +105,7 @@ internal ServiceFabricManagedApplicationData() public ApplicationUpgradePolicy UpgradePolicy { get; set; } /// List of user assigned identities for the application, each mapped to a friendly name. public IList ManagedIdentities { get; } + /// Describes the managed identities for an Azure resource. + public ManagedServiceIdentity Identity { get; set; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationResource.cs index c0e1f5dbfcb6..660dd857eb45 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationResource.cs @@ -31,7 +31,7 @@ public partial class ServiceFabricManagedApplicationResource : ArmResource /// The applicationName. public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string clusterName, string applicationName) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}"; return new ResourceIdentifier(resourceId); } @@ -40,7 +40,7 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ServiceFabricManagedApplicationData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ServiceFabric/managedclusters/applications"; + public static readonly ResourceType ResourceType = "Microsoft.ServiceFabric/managedClusters/applications"; /// Initializes a new instance of the class for mocking. protected ServiceFabricManagedApplicationResource() @@ -102,15 +102,15 @@ public virtual ServiceFabricManagedServiceCollection GetServiceFabricManagedServ /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -133,15 +133,15 @@ public virtual async Task> GetServ /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -164,15 +164,15 @@ public virtual Response GetServiceFabricMan /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -204,15 +204,15 @@ public virtual async Task> Get /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -244,15 +244,15 @@ public virtual Response Get(Cancellatio /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Delete + /// ApplicationResource_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -286,15 +286,15 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Delete + /// ApplicationResource_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -328,15 +328,15 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Update + /// ApplicationResource_Update /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -370,15 +370,15 @@ public virtual async Task> Upd /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Update + /// ApplicationResource_Update /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -420,7 +420,7 @@ public virtual Response Update(ServiceF /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -462,7 +462,7 @@ public virtual async Task ReadUpgradeAsync(WaitUntil waitUntil, Ca /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -492,19 +492,19 @@ public virtual ArmOperation ReadUpgrade(WaitUntil waitUntil, CancellationToken c } /// - /// Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version. + /// Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/startRollback + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/resumeUpgrade /// /// /// Operation Id - /// Applications_StartRollback + /// Applications_ResumeUpgrade /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -513,15 +513,19 @@ public virtual ArmOperation ReadUpgrade(WaitUntil waitUntil, CancellationToken c /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for resuming an application upgrade. /// The cancellation token to use. - public virtual async Task StartRollbackAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual async Task ResumeUpgradeAsync(WaitUntil waitUntil, RuntimeResumeApplicationUpgradeContent content, CancellationToken cancellationToken = default) { - using var scope = _serviceFabricManagedApplicationApplicationsClientDiagnostics.CreateScope("ServiceFabricManagedApplicationResource.StartRollback"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedApplicationApplicationsClientDiagnostics.CreateScope("ServiceFabricManagedApplicationResource.ResumeUpgrade"); scope.Start(); try { - var response = await _serviceFabricManagedApplicationApplicationsRestClient.StartRollbackAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); - var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedApplicationApplicationsClientDiagnostics, Pipeline, _serviceFabricManagedApplicationApplicationsRestClient.CreateStartRollbackRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = await _serviceFabricManagedApplicationApplicationsRestClient.ResumeUpgradeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedApplicationApplicationsClientDiagnostics, Pipeline, _serviceFabricManagedApplicationApplicationsRestClient.CreateResumeUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -534,19 +538,19 @@ public virtual async Task StartRollbackAsync(WaitUntil waitUntil, } /// - /// Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version. + /// Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/startRollback + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/resumeUpgrade /// /// /// Operation Id - /// Applications_StartRollback + /// Applications_ResumeUpgrade /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -555,15 +559,19 @@ public virtual async Task StartRollbackAsync(WaitUntil waitUntil, /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for resuming an application upgrade. /// The cancellation token to use. - public virtual ArmOperation StartRollback(WaitUntil waitUntil, CancellationToken cancellationToken = default) + /// is null. + public virtual ArmOperation ResumeUpgrade(WaitUntil waitUntil, RuntimeResumeApplicationUpgradeContent content, CancellationToken cancellationToken = default) { - using var scope = _serviceFabricManagedApplicationApplicationsClientDiagnostics.CreateScope("ServiceFabricManagedApplicationResource.StartRollback"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedApplicationApplicationsClientDiagnostics.CreateScope("ServiceFabricManagedApplicationResource.ResumeUpgrade"); scope.Start(); try { - var response = _serviceFabricManagedApplicationApplicationsRestClient.StartRollback(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); - var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedApplicationApplicationsClientDiagnostics, Pipeline, _serviceFabricManagedApplicationApplicationsRestClient.CreateStartRollbackRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + var response = _serviceFabricManagedApplicationApplicationsRestClient.ResumeUpgrade(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedApplicationApplicationsClientDiagnostics, Pipeline, _serviceFabricManagedApplicationApplicationsRestClient.CreateResumeUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -576,19 +584,19 @@ public virtual ArmOperation StartRollback(WaitUntil waitUntil, CancellationToken } /// - /// Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused. + /// Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/resumeUpgrade + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/startRollback /// /// /// Operation Id - /// Applications_ResumeUpgrade + /// Applications_StartRollback /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -597,19 +605,15 @@ public virtual ArmOperation StartRollback(WaitUntil waitUntil, CancellationToken /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for resuming an application upgrade. /// The cancellation token to use. - /// is null. - public virtual async Task ResumeUpgradeAsync(WaitUntil waitUntil, RuntimeResumeApplicationUpgradeContent content, CancellationToken cancellationToken = default) + public virtual async Task StartRollbackAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _serviceFabricManagedApplicationApplicationsClientDiagnostics.CreateScope("ServiceFabricManagedApplicationResource.ResumeUpgrade"); + using var scope = _serviceFabricManagedApplicationApplicationsClientDiagnostics.CreateScope("ServiceFabricManagedApplicationResource.StartRollback"); scope.Start(); try { - var response = await _serviceFabricManagedApplicationApplicationsRestClient.ResumeUpgradeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedApplicationApplicationsClientDiagnostics, Pipeline, _serviceFabricManagedApplicationApplicationsRestClient.CreateResumeUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _serviceFabricManagedApplicationApplicationsRestClient.StartRollbackAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedApplicationApplicationsClientDiagnostics, Pipeline, _serviceFabricManagedApplicationApplicationsRestClient.CreateStartRollbackRequest(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; @@ -622,19 +626,19 @@ public virtual async Task ResumeUpgradeAsync(WaitUntil waitUntil, } /// - /// Send a request to resume the current application upgrade. This will resume the application upgrade from where it was paused. + /// Send a request to start a rollback of the current application upgrade. This will start rolling back the application to the previous version. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/resumeUpgrade + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/startRollback /// /// /// Operation Id - /// Applications_ResumeUpgrade + /// Applications_StartRollback /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -643,19 +647,15 @@ public virtual async Task ResumeUpgradeAsync(WaitUntil waitUntil, /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// The parameters for resuming an application upgrade. /// The cancellation token to use. - /// is null. - public virtual ArmOperation ResumeUpgrade(WaitUntil waitUntil, RuntimeResumeApplicationUpgradeContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation StartRollback(WaitUntil waitUntil, CancellationToken cancellationToken = default) { - Argument.AssertNotNull(content, nameof(content)); - - using var scope = _serviceFabricManagedApplicationApplicationsClientDiagnostics.CreateScope("ServiceFabricManagedApplicationResource.ResumeUpgrade"); + using var scope = _serviceFabricManagedApplicationApplicationsClientDiagnostics.CreateScope("ServiceFabricManagedApplicationResource.StartRollback"); scope.Start(); try { - var response = _serviceFabricManagedApplicationApplicationsRestClient.ResumeUpgrade(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedApplicationApplicationsClientDiagnostics, Pipeline, _serviceFabricManagedApplicationApplicationsRestClient.CreateResumeUpgradeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _serviceFabricManagedApplicationApplicationsRestClient.StartRollback(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedApplicationApplicationsClientDiagnostics, Pipeline, _serviceFabricManagedApplicationApplicationsRestClient.CreateStartRollbackRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -672,15 +672,15 @@ public virtual ArmOperation ResumeUpgrade(WaitUntil waitUntil, RuntimeResumeAppl /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -734,15 +734,15 @@ public virtual async Task> Add /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -796,15 +796,15 @@ public virtual Response AddTag(string k /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -853,15 +853,15 @@ public virtual async Task> Set /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -910,15 +910,15 @@ public virtual Response SetTags(IDictio /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -970,15 +970,15 @@ public virtual async Task> Rem /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeCollection.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeCollection.cs index 0e58fb49da28..73d37518ceb5 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeCollection.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeCollection.cs @@ -56,15 +56,15 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_CreateOrUpdate + /// ApplicationTypeResource_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -107,15 +107,15 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_CreateOrUpdate + /// ApplicationTypeResource_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -158,15 +158,15 @@ public virtual ArmOperation CreateO /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -203,15 +203,15 @@ public virtual async Task> /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -248,15 +248,15 @@ public virtual Response Get(string /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes /// /// /// Operation Id - /// ApplicationTypes_List + /// ApplicationTypeResource_List /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -278,15 +278,15 @@ public virtual AsyncPageable GetAll /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes /// /// /// Operation Id - /// ApplicationTypes_List + /// ApplicationTypeResource_List /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -308,15 +308,15 @@ public virtual Pageable GetAll(Canc /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -351,15 +351,15 @@ public virtual async Task> ExistsAsync(string applicationTypeName /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -394,15 +394,15 @@ public virtual Response Exists(string applicationTypeName, CancellationTok /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -439,15 +439,15 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeResource.cs index 5ce658a99c6b..40d605a876eb 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeResource.cs @@ -31,7 +31,7 @@ public partial class ServiceFabricManagedApplicationTypeResource : ArmResource /// The applicationTypeName. public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string clusterName, string applicationTypeName) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}"; return new ResourceIdentifier(resourceId); } @@ -40,7 +40,7 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ServiceFabricManagedApplicationTypeData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ServiceFabric/managedclusters/applicationTypes"; + public static readonly ResourceType ResourceType = "Microsoft.ServiceFabric/managedClusters/applicationTypes"; /// Initializes a new instance of the class for mocking. protected ServiceFabricManagedApplicationTypeResource() @@ -102,15 +102,15 @@ public virtual ServiceFabricManagedApplicationTypeVersionCollection GetServiceFa /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -133,15 +133,15 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -164,15 +164,15 @@ public virtual Response GetS /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -204,15 +204,15 @@ public virtual async Task> /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -244,15 +244,15 @@ public virtual Response Get(Cancell /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Delete + /// ApplicationTypeResource_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -286,15 +286,15 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Delete + /// ApplicationTypeResource_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -328,15 +328,15 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Update + /// ApplicationTypeResource_Update /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -370,15 +370,15 @@ public virtual async Task> /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Update + /// ApplicationTypeResource_Update /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -412,15 +412,15 @@ public virtual Response Update(Serv /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -474,15 +474,15 @@ public virtual async Task> /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -536,15 +536,15 @@ public virtual Response AddTag(stri /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -593,15 +593,15 @@ public virtual async Task> /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -650,15 +650,15 @@ public virtual Response SetTags(IDi /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -710,15 +710,15 @@ public virtual async Task> /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeVersionCollection.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeVersionCollection.cs index 62d8d8ef5c70..a3a494f8d3a3 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeVersionCollection.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeVersionCollection.cs @@ -56,15 +56,15 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_CreateOrUpdate + /// ApplicationTypeVersionResource_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -105,15 +105,15 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_CreateOrUpdate + /// ApplicationTypeVersionResource_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -154,15 +154,15 @@ public virtual ArmOperation /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -199,15 +199,15 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -244,15 +244,15 @@ public virtual Response Get( /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions /// /// /// Operation Id - /// ApplicationTypeVersions_ListByApplicationTypes + /// ApplicationTypeVersionResource_ListByApplicationTypes /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -274,15 +274,15 @@ public virtual AsyncPageable /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions /// /// /// Operation Id - /// ApplicationTypeVersions_ListByApplicationTypes + /// ApplicationTypeVersionResource_ListByApplicationTypes /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -304,15 +304,15 @@ public virtual Pageable GetA /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -347,15 +347,15 @@ public virtual async Task> ExistsAsync(string version, Cancellati /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -390,15 +390,15 @@ public virtual Response Exists(string version, CancellationToken cancellat /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -435,15 +435,15 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeVersionResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeVersionResource.cs index 1aa2bfc2e67b..6e62d07ed77a 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeVersionResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedApplicationTypeVersionResource.cs @@ -32,7 +32,7 @@ public partial class ServiceFabricManagedApplicationTypeVersionResource : ArmRes /// The version. public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string clusterName, string applicationTypeName, string version) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version}"; return new ResourceIdentifier(resourceId); } @@ -41,7 +41,7 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ServiceFabricManagedApplicationTypeVersionData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ServiceFabric/managedclusters/applicationTypes/versions"; + public static readonly ResourceType ResourceType = "Microsoft.ServiceFabric/managedClusters/applicationTypes/versions"; /// Initializes a new instance of the class for mocking. protected ServiceFabricManagedApplicationTypeVersionResource() @@ -96,15 +96,15 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -136,15 +136,15 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -176,15 +176,15 @@ public virtual Response Get( /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Delete + /// ApplicationTypeVersionResource_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -218,15 +218,15 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Delete + /// ApplicationTypeVersionResource_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -260,15 +260,15 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Update + /// ApplicationTypeVersionResource_Update /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -302,15 +302,15 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Update + /// ApplicationTypeVersionResource_Update /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -344,15 +344,15 @@ public virtual Response Upda /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -406,15 +406,15 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -468,15 +468,15 @@ public virtual Response AddT /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -525,15 +525,15 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -582,15 +582,15 @@ public virtual Response SetT /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -642,15 +642,15 @@ public virtual async Task /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName}/versions/{version} /// /// /// Operation Id - /// ApplicationTypeVersions_Get + /// ApplicationTypeVersionResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterCollection.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterCollection.cs index 6df765faf4f4..de543cc4096c 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterCollection.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterCollection.cs @@ -61,11 +61,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// ManagedClusters_CreateOrUpdate + /// ManagedCluster_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -110,11 +110,11 @@ public virtual async Task> Cre /// /// /// Operation Id - /// ManagedClusters_CreateOrUpdate + /// ManagedCluster_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -159,11 +159,11 @@ public virtual ArmOperation CreateOrUpdate( /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -204,11 +204,11 @@ public virtual async Task> GetAsyn /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -249,11 +249,11 @@ public virtual Response Get(string clusterN /// /// /// Operation Id - /// ManagedClusters_ListByResourceGroup + /// ManagedCluster_ListByResourceGroup /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -279,11 +279,11 @@ public virtual AsyncPageable GetAllAsync(Ca /// /// /// Operation Id - /// ManagedClusters_ListByResourceGroup + /// ManagedCluster_ListByResourceGroup /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -309,11 +309,11 @@ public virtual Pageable GetAll(Cancellation /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -352,11 +352,11 @@ public virtual async Task> ExistsAsync(string clusterName, Cancel /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -395,11 +395,11 @@ public virtual Response Exists(string clusterName, CancellationToken cance /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -440,11 +440,11 @@ public virtual async Task> /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterData.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterData.Serialization.cs index 8141224b5138..5adb7a336f18 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterData.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterData.Serialization.cs @@ -38,13 +38,13 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - writer.WritePropertyName("sku"u8); - writer.WriteObjectValue(Sku, options); if (options.Format != "W" && Optional.IsDefined(ETag)) { writer.WritePropertyName("etag"u8); - writer.WriteStringValue(ETag.Value.ToString()); + writer.WriteStringValue(ETag); } + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(DnsName)) @@ -62,35 +62,23 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("ipv4Address"u8); writer.WriteStringValue(IPv4Address.ToString()); } - if (options.Format != "W" && Optional.IsDefined(ClusterId)) + if (options.Format != "W" && Optional.IsDefined(Uuid)) { writer.WritePropertyName("clusterId"u8); - writer.WriteStringValue(ClusterId.Value); + writer.WriteStringValue(Uuid.Value); } if (options.Format != "W" && Optional.IsDefined(ClusterState)) { writer.WritePropertyName("clusterState"u8); writer.WriteStringValue(ClusterState.Value.ToString()); } - if (options.Format != "W" && Optional.IsCollectionDefined(ClusterCertificateThumbprints)) + if (options.Format != "W" && Optional.IsCollectionDefined(Any)) { writer.WritePropertyName("clusterCertificateThumbprints"u8); writer.WriteStartArray(); - foreach (var item in ClusterCertificateThumbprints) + foreach (var item in Any) { - if (item == null) - { - writer.WriteNullValue(); - continue; - } -#if NET6_0_OR_GREATER - writer.WriteRawValue(item); -#else - using (JsonDocument document = JsonDocument.Parse(item, ModelSerializationExtensions.JsonDocumentOptions)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif + writer.WriteStringValue(item); } writer.WriteEndArray(); } @@ -309,6 +297,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("allocatedOutboundPorts"u8); writer.WriteNumberValue(AllocatedOutboundPorts.Value); } + if (Optional.IsDefined(VmImage)) + { + writer.WritePropertyName("VMImage"u8); + writer.WriteStringValue(VmImage); + } writer.WriteEndObject(); } @@ -332,8 +325,8 @@ internal static ServiceFabricManagedClusterData DeserializeServiceFabricManagedC { return null; } + string etag = default; ServiceFabricManagedClustersSku sku = default; - ETag? etag = default; IDictionary tags = default; AzureLocation location = default; ResourceIdentifier id = default; @@ -345,7 +338,7 @@ internal static ServiceFabricManagedClusterData DeserializeServiceFabricManagedC IPAddress ipv4Address = default; Guid? clusterId = default; ServiceFabricManagedClusterState? clusterState = default; - IReadOnlyList clusterCertificateThumbprints = default; + IReadOnlyList clusterCertificateThumbprints = default; int? clientConnectionPort = default; int? httpGatewayConnectionPort = default; string adminUserName = default; @@ -381,22 +374,19 @@ internal static ServiceFabricManagedClusterData DeserializeServiceFabricManagedC bool? enableHttpGatewayExclusiveAuthMode = default; AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope = default; int? allocatedOutboundPorts = default; + string vmImage = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("sku"u8)) + if (property.NameEquals("etag"u8)) { - sku = ServiceFabricManagedClustersSku.DeserializeServiceFabricManagedClustersSku(property.Value, options); + etag = property.Value.GetString(); continue; } - if (property.NameEquals("etag"u8)) + if (property.NameEquals("sku"u8)) { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - etag = new ETag(property.Value.GetString()); + sku = ServiceFabricManagedClustersSku.DeserializeServiceFabricManagedClustersSku(property.Value, options); continue; } if (property.NameEquals("tags"u8)) @@ -472,7 +462,7 @@ internal static ServiceFabricManagedClusterData DeserializeServiceFabricManagedC } if (property0.NameEquals("clusterId"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) + if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } @@ -494,17 +484,10 @@ internal static ServiceFabricManagedClusterData DeserializeServiceFabricManagedC { continue; } - List array = new List(); + List array = new List(); foreach (var item in property0.Value.EnumerateArray()) { - if (item.ValueKind == JsonValueKind.Null) - { - array.Add(null); - } - else - { - array.Add(BinaryData.FromString(item.GetRawText())); - } + array.Add(item.GetString()); } clusterCertificateThumbprints = array; continue; @@ -778,7 +761,7 @@ internal static ServiceFabricManagedClusterData DeserializeServiceFabricManagedC } if (property0.NameEquals("publicIPPrefixId"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) + if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } @@ -787,7 +770,7 @@ internal static ServiceFabricManagedClusterData DeserializeServiceFabricManagedC } if (property0.NameEquals("publicIPv6PrefixId"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) + if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } @@ -796,7 +779,7 @@ internal static ServiceFabricManagedClusterData DeserializeServiceFabricManagedC } if (property0.NameEquals("ddosProtectionPlanId"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) + if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } @@ -848,6 +831,11 @@ internal static ServiceFabricManagedClusterData DeserializeServiceFabricManagedC allocatedOutboundPorts = property0.Value.GetInt32(); continue; } + if (property0.NameEquals("VMImage"u8)) + { + vmImage = property0.Value.GetString(); + continue; + } } continue; } @@ -864,13 +852,12 @@ internal static ServiceFabricManagedClusterData DeserializeServiceFabricManagedC systemData, tags ?? new ChangeTrackingDictionary(), location, - sku, dnsName, fqdn, ipv4Address, clusterId, clusterState, - clusterCertificateThumbprints ?? new ChangeTrackingList(), + clusterCertificateThumbprints ?? new ChangeTrackingList(), clientConnectionPort, httpGatewayConnectionPort, adminUserName, @@ -906,7 +893,9 @@ internal static ServiceFabricManagedClusterData DeserializeServiceFabricManagedC enableHttpGatewayExclusiveAuthMode, autoGeneratedDomainNameLabelScope, allocatedOutboundPorts, + vmImage, etag, + sku, serializedAdditionalRawData); } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterData.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterData.cs index 090cde8c1615..30a5c6195856 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterData.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterData.cs @@ -17,7 +17,6 @@ namespace Azure.ResourceManager.ServiceFabricManagedClusters /// /// A class representing the ServiceFabricManagedCluster data model. /// The managed cluster resource - /// /// public partial class ServiceFabricManagedClusterData : TrackedResourceData { @@ -61,8 +60,7 @@ public ServiceFabricManagedClusterData(AzureLocation location, ServiceFabricMana { Argument.AssertNotNull(sku, nameof(sku)); - Sku = sku; - ClusterCertificateThumbprints = new ChangeTrackingList(); + Any = new ChangeTrackingList(); LoadBalancingRules = new ChangeTrackingList(); NetworkSecurityRules = new ChangeTrackingList(); Clients = new ChangeTrackingList(); @@ -71,6 +69,7 @@ public ServiceFabricManagedClusterData(AzureLocation location, ServiceFabricMana IPTags = new ChangeTrackingList(); AuxiliarySubnets = new ChangeTrackingList(); ServiceEndpoints = new ChangeTrackingList(); + Sku = sku; } /// Initializes a new instance of . @@ -80,13 +79,12 @@ public ServiceFabricManagedClusterData(AzureLocation location, ServiceFabricMana /// The systemData. /// The tags. /// The location. - /// The sku of the managed cluster. /// The cluster dns name. /// The fully qualified domain name associated with the public load balancer of the cluster. /// The IPv4 address associated with the public load balancer of the cluster. - /// A service generated unique identifier for the cluster resource. + /// A service generated unique identifier for the cluster resource. /// The current state of the cluster. - /// List of thumbprints of the cluster certificates. + /// List of thumbprints of the cluster certificates. /// The port used for client connections to the cluster. /// The port used for HTTP connections to the cluster. /// VM admin user name. @@ -99,10 +97,7 @@ public ServiceFabricManagedClusterData(AzureLocation location, ServiceFabricMana /// The list of custom fabric settings to configure the cluster. /// The provisioning state of the managed cluster resource. /// The Service Fabric runtime version of the cluster. This property is required when **clusterUpgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. - /// - /// The upgrade mode of the cluster when new Service Fabric runtime version is available. - /// - /// + /// The upgrade mode of the cluster when new Service Fabric runtime version is available. /// Indicates when new cluster runtime version upgrades will be applied after they are released. By default is Wave0. Only applies when **clusterUpgradeMode** is set to 'Automatic'. /// List of add-on features to enable on the cluster. /// Enables automatic OS upgrade for node types created using OS images with version 'latest'. The default value for this setting is false. @@ -125,17 +120,18 @@ public ServiceFabricManagedClusterData(AzureLocation location, ServiceFabricMana /// If true, token-based authentication is not allowed on the HttpGatewayEndpoint. This is required to support TLS versions 1.3 and above. If token-based authentication is used, HttpGatewayTokenAuthConnectionPort must be defined. /// This property is the entry point to using a public CA cert for your cluster cert. It specifies the level of reuse allowed for the custom FQDN created, matching the subject of the public CA cert. /// The number of outbound ports allocated for SNAT for each node in the backend pool of the default load balancer. The default value is 0 which provides dynamic port allocation based on pool size. - /// Azure resource etag. + /// The VM image the node types are configured with. This property controls the Service Fabric component packages to be used for the cluster. Allowed values are: 'Windows'. The default value is 'Windows'. + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.",. + /// The sku of the managed cluster. /// Keeps track of any properties unknown to the library. - internal ServiceFabricManagedClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, ServiceFabricManagedClustersSku sku, string dnsName, string fqdn, IPAddress ipv4Address, Guid? clusterId, ServiceFabricManagedClusterState? clusterState, IReadOnlyList clusterCertificateThumbprints, int? clientConnectionPort, int? httpGatewayConnectionPort, string adminUserName, string adminPassword, IList loadBalancingRules, bool? isRdpAccessAllowed, IList networkSecurityRules, IList clients, ManagedClusterAzureActiveDirectory azureActiveDirectory, IList fabricSettings, ServiceFabricManagedResourceProvisioningState? provisioningState, string clusterCodeVersion, ManagedClusterUpgradeMode? clusterUpgradeMode, ManagedClusterUpgradeCadence? clusterUpgradeCadence, IList addOnFeatures, bool? isAutoOSUpgradeEnabled, bool? hasZoneResiliency, ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy, bool? isIPv6Enabled, string subnetId, IList ipTags, IPAddress ipv6Address, bool? isServicePublicIPEnabled, IList auxiliarySubnets, IList serviceEndpoints, ZonalUpdateMode? zonalUpdateMode, bool? useCustomVnet, ResourceIdentifier publicIPPrefixId, ResourceIdentifier publicIPv6PrefixId, ResourceIdentifier ddosProtectionPlanId, ManagedClusterUpgradePolicy upgradeDescription, int? httpGatewayTokenAuthConnectionPort, bool? isHttpGatewayExclusiveAuthModeEnabled, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, int? allocatedOutboundPorts, ETag? etag, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + internal ServiceFabricManagedClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, string dnsName, string fqdn, IPAddress ipv4Address, Guid? uuid, ServiceFabricManagedClusterState? clusterState, IReadOnlyList any, int? clientConnectionPort, int? httpGatewayConnectionPort, string adminUserName, string adminPassword, IList loadBalancingRules, bool? isRdpAccessAllowed, IList networkSecurityRules, IList clients, ManagedClusterAzureActiveDirectory azureActiveDirectory, IList fabricSettings, ServiceFabricManagedResourceProvisioningState? provisioningState, string clusterCodeVersion, ManagedClusterUpgradeMode? clusterUpgradeMode, ManagedClusterUpgradeCadence? clusterUpgradeCadence, IList addOnFeatures, bool? isAutoOSUpgradeEnabled, bool? hasZoneResiliency, ApplicationTypeVersionsCleanupPolicy applicationTypeVersionsCleanupPolicy, bool? isIPv6Enabled, string subnetId, IList ipTags, IPAddress ipv6Address, bool? isServicePublicIPEnabled, IList auxiliarySubnets, IList serviceEndpoints, ZonalUpdateMode? zonalUpdateMode, bool? useCustomVnet, ResourceIdentifier publicIPPrefixId, ResourceIdentifier publicIPv6PrefixId, ResourceIdentifier ddosProtectionPlanId, ManagedClusterUpgradePolicy upgradeDescription, int? httpGatewayTokenAuthConnectionPort, bool? isHttpGatewayExclusiveAuthModeEnabled, AutoGeneratedDomainNameLabelScope? autoGeneratedDomainNameLabelScope, int? allocatedOutboundPorts, string vmImage, string etag, ServiceFabricManagedClustersSku sku, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) { - Sku = sku; DnsName = dnsName; Fqdn = fqdn; IPv4Address = ipv4Address; - ClusterId = clusterId; + Uuid = uuid; ClusterState = clusterState; - ClusterCertificateThumbprints = clusterCertificateThumbprints; + Any = any; ClientConnectionPort = clientConnectionPort; HttpGatewayConnectionPort = httpGatewayConnectionPort; AdminUserName = adminUserName; @@ -171,7 +167,9 @@ internal ServiceFabricManagedClusterData(ResourceIdentifier id, string name, Res IsHttpGatewayExclusiveAuthModeEnabled = isHttpGatewayExclusiveAuthModeEnabled; AutoGeneratedDomainNameLabelScope = autoGeneratedDomainNameLabelScope; AllocatedOutboundPorts = allocatedOutboundPorts; + VmImage = vmImage; ETag = etag; + Sku = sku; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -180,18 +178,6 @@ internal ServiceFabricManagedClusterData() { } - /// The sku of the managed cluster. - internal ServiceFabricManagedClustersSku Sku { get; set; } - /// Sku Name. - public ServiceFabricManagedClustersSkuName? SkuName - { - get => Sku is null ? default(ServiceFabricManagedClustersSkuName?) : Sku.Name; - set - { - Sku = value.HasValue ? new ServiceFabricManagedClustersSku(value.Value) : null; - } - } - /// The cluster dns name. public string DnsName { get; set; } /// The fully qualified domain name associated with the public load balancer of the cluster. @@ -199,40 +185,11 @@ public ServiceFabricManagedClustersSkuName? SkuName /// The IPv4 address associated with the public load balancer of the cluster. public IPAddress IPv4Address { get; } /// A service generated unique identifier for the cluster resource. - public Guid? ClusterId { get; } + public Guid? Uuid { get; } /// The current state of the cluster. public ServiceFabricManagedClusterState? ClusterState { get; } - /// - /// List of thumbprints of the cluster certificates. - /// - /// To assign an object to the element of this property use . - /// - /// - /// To assign an already formatted json string to this property use . - /// - /// - /// Examples: - /// - /// - /// BinaryData.FromObjectAsJson("foo") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromString("\"foo\"") - /// Creates a payload of "foo". - /// - /// - /// BinaryData.FromObjectAsJson(new { key = "value" }) - /// Creates a payload of { "key": "value" }. - /// - /// - /// BinaryData.FromString("{\"key\": \"value\"}") - /// Creates a payload of { "key": "value" }. - /// - /// - /// - /// - public IReadOnlyList ClusterCertificateThumbprints { get; } + /// List of thumbprints of the cluster certificates. + public IReadOnlyList Any { get; } /// The port used for client connections to the cluster. public int? ClientConnectionPort { get; set; } /// The port used for HTTP connections to the cluster. @@ -257,10 +214,7 @@ public ServiceFabricManagedClustersSkuName? SkuName public ServiceFabricManagedResourceProvisioningState? ProvisioningState { get; } /// The Service Fabric runtime version of the cluster. This property is required when **clusterUpgradeMode** is set to 'Manual'. To get list of available Service Fabric versions for new clusters use [ClusterVersion API](./ClusterVersion.md). To get the list of available version for existing clusters use **availableClusterVersions**. public string ClusterCodeVersion { get; set; } - /// - /// The upgrade mode of the cluster when new Service Fabric runtime version is available. - /// - /// + /// The upgrade mode of the cluster when new Service Fabric runtime version is available. public ManagedClusterUpgradeMode? ClusterUpgradeMode { get; set; } /// Indicates when new cluster runtime version upgrades will be applied after they are released. By default is Wave0. Only applies when **clusterUpgradeMode** is set to 'Automatic'. public ManagedClusterUpgradeCadence? ClusterUpgradeCadence { get; set; } @@ -316,7 +270,20 @@ public int? MaxUnusedVersionsToKeep public AutoGeneratedDomainNameLabelScope? AutoGeneratedDomainNameLabelScope { get; set; } /// The number of outbound ports allocated for SNAT for each node in the backend pool of the default load balancer. The default value is 0 which provides dynamic port allocation based on pool size. public int? AllocatedOutboundPorts { get; set; } - /// Azure resource etag. - public ETag? ETag { get; } + /// The VM image the node types are configured with. This property controls the Service Fabric component packages to be used for the cluster. Allowed values are: 'Windows'. The default value is 'Windows'. + public string VmImage { get; set; } + /// If eTag is provided in the response body, it may also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields.",. + public string ETag { get; } + /// The sku of the managed cluster. + internal ServiceFabricManagedClustersSku Sku { get; set; } + /// Sku Name. + public ServiceFabricManagedClustersSkuName? SkuName + { + get => Sku is null ? default(ServiceFabricManagedClustersSkuName?) : Sku.Name; + set + { + Sku = value.HasValue ? new ServiceFabricManagedClustersSku(value.Value) : null; + } + } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterResource.cs index 6feca7d956ef..4b51515864da 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedClusterResource.cs @@ -10,6 +10,7 @@ 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; @@ -39,10 +40,10 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ManagedClustersRestOperations _serviceFabricManagedClusterManagedClustersRestClient; private readonly ClientDiagnostics _managedAzResiliencyStatusClientDiagnostics; private readonly ManagedAzResiliencyStatusRestOperations _managedAzResiliencyStatusRestClient; - private readonly ClientDiagnostics _managedMaintenanceWindowStatusClientDiagnostics; - private readonly ManagedMaintenanceWindowStatusRestOperations _managedMaintenanceWindowStatusRestClient; private readonly ClientDiagnostics _managedApplyMaintenanceWindowClientDiagnostics; private readonly ManagedApplyMaintenanceWindowRestOperations _managedApplyMaintenanceWindowRestClient; + private readonly ClientDiagnostics _managedMaintenanceWindowStatusClientDiagnostics; + private readonly ManagedMaintenanceWindowStatusRestOperations _managedMaintenanceWindowStatusRestClient; private readonly ServiceFabricManagedClusterData _data; /// Gets the resource type for the operations. @@ -72,10 +73,10 @@ internal ServiceFabricManagedClusterResource(ArmClient client, ResourceIdentifie _serviceFabricManagedClusterManagedClustersRestClient = new ManagedClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, serviceFabricManagedClusterManagedClustersApiVersion); _managedAzResiliencyStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceFabricManagedClusters", ProviderConstants.DefaultProviderNamespace, Diagnostics); _managedAzResiliencyStatusRestClient = new ManagedAzResiliencyStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); - _managedMaintenanceWindowStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceFabricManagedClusters", ProviderConstants.DefaultProviderNamespace, Diagnostics); - _managedMaintenanceWindowStatusRestClient = new ManagedMaintenanceWindowStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); _managedApplyMaintenanceWindowClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceFabricManagedClusters", ProviderConstants.DefaultProviderNamespace, Diagnostics); _managedApplyMaintenanceWindowRestClient = new ManagedApplyMaintenanceWindowRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); + _managedMaintenanceWindowStatusClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.ServiceFabricManagedClusters", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _managedMaintenanceWindowStatusRestClient = new ManagedMaintenanceWindowStatusRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -102,142 +103,142 @@ 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 ServiceFabricManagedApplicationTypeResources in the ServiceFabricManagedCluster. - /// An object representing collection of ServiceFabricManagedApplicationTypeResources and their operations over a ServiceFabricManagedApplicationTypeResource. - public virtual ServiceFabricManagedApplicationTypeCollection GetServiceFabricManagedApplicationTypes() + /// Gets a collection of ServiceFabricManagedApplicationResources in the ServiceFabricManagedCluster. + /// An object representing collection of ServiceFabricManagedApplicationResources and their operations over a ServiceFabricManagedApplicationResource. + public virtual ServiceFabricManagedApplicationCollection GetServiceFabricManagedApplications() { - return GetCachedClient(client => new ServiceFabricManagedApplicationTypeCollection(client, Id)); + return GetCachedClient(client => new ServiceFabricManagedApplicationCollection(client, Id)); } /// - /// Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric managed cluster resource. + /// Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the application type name resource. + /// The name of the application resource. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetServiceFabricManagedApplicationTypeAsync(string applicationTypeName, CancellationToken cancellationToken = default) + public virtual async Task> GetServiceFabricManagedApplicationAsync(string applicationName, CancellationToken cancellationToken = default) { - return await GetServiceFabricManagedApplicationTypes().GetAsync(applicationTypeName, cancellationToken).ConfigureAwait(false); + return await GetServiceFabricManagedApplications().GetAsync(applicationName, cancellationToken).ConfigureAwait(false); } /// - /// Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric managed cluster resource. + /// Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applicationTypes/{applicationTypeName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName} /// /// /// Operation Id - /// ApplicationTypes_Get + /// ApplicationResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the application type name resource. + /// The name of the application resource. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetServiceFabricManagedApplicationType(string applicationTypeName, CancellationToken cancellationToken = default) + public virtual Response GetServiceFabricManagedApplication(string applicationName, CancellationToken cancellationToken = default) { - return GetServiceFabricManagedApplicationTypes().Get(applicationTypeName, cancellationToken); + return GetServiceFabricManagedApplications().Get(applicationName, cancellationToken); } - /// Gets a collection of ServiceFabricManagedApplicationResources in the ServiceFabricManagedCluster. - /// An object representing collection of ServiceFabricManagedApplicationResources and their operations over a ServiceFabricManagedApplicationResource. - public virtual ServiceFabricManagedApplicationCollection GetServiceFabricManagedApplications() + /// Gets a collection of ServiceFabricManagedApplicationTypeResources in the ServiceFabricManagedCluster. + /// An object representing collection of ServiceFabricManagedApplicationTypeResources and their operations over a ServiceFabricManagedApplicationTypeResource. + public virtual ServiceFabricManagedApplicationTypeCollection GetServiceFabricManagedApplicationTypes() { - return GetCachedClient(client => new ServiceFabricManagedApplicationCollection(client, Id)); + return GetCachedClient(client => new ServiceFabricManagedApplicationTypeCollection(client, Id)); } /// - /// Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource. + /// Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric managed cluster resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the application resource. + /// The name of the application type name resource. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual async Task> GetServiceFabricManagedApplicationAsync(string applicationName, CancellationToken cancellationToken = default) + public virtual async Task> GetServiceFabricManagedApplicationTypeAsync(string applicationTypeName, CancellationToken cancellationToken = default) { - return await GetServiceFabricManagedApplications().GetAsync(applicationName, cancellationToken).ConfigureAwait(false); + return await GetServiceFabricManagedApplicationTypes().GetAsync(applicationTypeName, cancellationToken).ConfigureAwait(false); } /// - /// Get a Service Fabric managed application resource created or in the process of being created in the Service Fabric cluster resource. + /// Get a Service Fabric application type name resource created or in the process of being created in the Service Fabric managed cluster resource. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applicationTypes/{applicationTypeName} /// /// /// Operation Id - /// Applications_Get + /// ApplicationTypeResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource - /// + /// /// /// /// - /// The name of the application resource. + /// The name of the application type name resource. /// The cancellation token to use. - /// is null. - /// is an empty string, and was expected to be non-empty. + /// is null. + /// is an empty string, and was expected to be non-empty. [ForwardsClientCalls] - public virtual Response GetServiceFabricManagedApplication(string applicationName, CancellationToken cancellationToken = default) + public virtual Response GetServiceFabricManagedApplicationType(string applicationTypeName, CancellationToken cancellationToken = default) { - return GetServiceFabricManagedApplications().Get(applicationName, cancellationToken); + return GetServiceFabricManagedApplicationTypes().Get(applicationTypeName, cancellationToken); } /// Gets a collection of ServiceFabricManagedNodeTypeResources in the ServiceFabricManagedCluster. @@ -256,11 +257,11 @@ public virtual ServiceFabricManagedNodeTypeCollection GetServiceFabricManagedNod /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -287,11 +288,11 @@ public virtual async Task> GetSer /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -318,11 +319,11 @@ public virtual Response GetServiceFabricMa /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -358,11 +359,11 @@ public virtual async Task> GetAsyn /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -398,11 +399,11 @@ public virtual Response Get(CancellationTok /// /// /// Operation Id - /// ManagedClusters_Delete + /// ManagedCluster_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -440,11 +441,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// ManagedClusters_Delete + /// ManagedCluster_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -482,11 +483,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// ManagedClusters_Update + /// ManagedCluster_Update /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -524,11 +525,11 @@ public virtual async Task> UpdateA /// /// /// Operation Id - /// ManagedClusters_Update + /// ManagedCluster_Update /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -558,30 +559,38 @@ public virtual Response Update(ServiceFabri } /// - /// Action to get Az Resiliency Status of all the Base resources constituting Service Fabric Managed Clusters. + /// Gets a fault simulation by the simulationId. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/getazresiliencystatus + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/getFaultSimulation /// /// /// Operation Id - /// managedAzResiliencyStatus_Get + /// ManagedClusters_GetFaultSimulation /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview + /// + /// + /// Resource + /// /// /// /// + /// parameter with fault simulation id. /// The cancellation token to use. - public virtual async Task> GetManagedAzResiliencyStatusAsync(CancellationToken cancellationToken = default) + /// is null. + public virtual async Task> GetFaultSimulationAsync(FaultSimulationIdContent content, CancellationToken cancellationToken = default) { - using var scope = _managedAzResiliencyStatusClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.GetManagedAzResiliencyStatus"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedClusterManagedClustersClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.GetFaultSimulation"); scope.Start(); try { - var response = await _managedAzResiliencyStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _serviceFabricManagedClusterManagedClustersRestClient.GetFaultSimulationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -592,30 +601,38 @@ public virtual async Task> GetManagedAzResil } /// - /// Action to get Az Resiliency Status of all the Base resources constituting Service Fabric Managed Clusters. + /// Gets a fault simulation by the simulationId. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/getazresiliencystatus + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/getFaultSimulation /// /// /// Operation Id - /// managedAzResiliencyStatus_Get + /// ManagedClusters_GetFaultSimulation /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview + /// + /// + /// Resource + /// /// /// /// + /// parameter with fault simulation id. /// The cancellation token to use. - public virtual Response GetManagedAzResiliencyStatus(CancellationToken cancellationToken = default) + /// is null. + public virtual Response GetFaultSimulation(FaultSimulationIdContent content, CancellationToken cancellationToken = default) { - using var scope = _managedAzResiliencyStatusClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.GetManagedAzResiliencyStatus"); + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedClusterManagedClustersClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.GetFaultSimulation"); scope.Start(); try { - var response = _managedAzResiliencyStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _serviceFabricManagedClusterManagedClustersRestClient.GetFaultSimulation(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); return response; } catch (Exception e) @@ -626,30 +643,274 @@ public virtual Response GetManagedAzResiliencyStatus( } /// - /// Action to get Maintenance Window Status of the Service Fabric Managed Clusters. + /// Gets the list of recent fault simulations for the cluster. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/getMaintenanceWindowStatus + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/listFaultSimulation /// /// /// Operation Id - /// managedMaintenanceWindowStatus_Get + /// ManagedClusters_ListFaultSimulation /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview + /// + /// + /// Resource + /// /// /// /// /// The cancellation token to use. - public virtual async Task> GetManagedMaintenanceWindowStatuAsync(CancellationToken cancellationToken = default) + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetFaultSimulationAsync(CancellationToken cancellationToken = default) { - using var scope = _managedMaintenanceWindowStatusClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.GetManagedMaintenanceWindowStatu"); + HttpMessage FirstPageRequest(int? pageSizeHint) => _serviceFabricManagedClusterManagedClustersRestClient.CreateListFaultSimulationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceFabricManagedClusterManagedClustersRestClient.CreateListFaultSimulationNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => FaultSimulation.DeserializeFaultSimulation(e), _serviceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, "ServiceFabricManagedClusterResource.GetFaultSimulation", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of recent fault simulations for the cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/listFaultSimulation + /// + /// + /// Operation Id + /// ManagedClusters_ListFaultSimulation + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetFaultSimulation(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _serviceFabricManagedClusterManagedClustersRestClient.CreateListFaultSimulationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceFabricManagedClusterManagedClustersRestClient.CreateListFaultSimulationNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => FaultSimulation.DeserializeFaultSimulation(e), _serviceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, "ServiceFabricManagedClusterResource.GetFaultSimulation", "value", "nextLink", cancellationToken); + } + + /// + /// Starts a fault simulation on the cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/startFaultSimulation + /// + /// + /// Operation Id + /// ManagedClusters_StartFaultSimulation + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameters describing the fault simulation. + /// The cancellation token to use. + /// is null. + public virtual async Task> StartFaultSimulationAsync(WaitUntil waitUntil, FaultSimulationContentWrapper faultSimulationContentWrapper, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(faultSimulationContentWrapper, nameof(faultSimulationContentWrapper)); + + using var scope = _serviceFabricManagedClusterManagedClustersClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.StartFaultSimulation"); scope.Start(); try { - var response = await _managedMaintenanceWindowStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var response = await _serviceFabricManagedClusterManagedClustersRestClient.StartFaultSimulationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, faultSimulationContentWrapper, cancellationToken).ConfigureAwait(false); + var operation = new ServiceFabricManagedClustersArmOperation(new FaultSimulationOperationSource(), _serviceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, _serviceFabricManagedClusterManagedClustersRestClient.CreateStartFaultSimulationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, faultSimulationContentWrapper).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts a fault simulation on the cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/startFaultSimulation + /// + /// + /// Operation Id + /// ManagedClusters_StartFaultSimulation + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameters describing the fault simulation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation StartFaultSimulation(WaitUntil waitUntil, FaultSimulationContentWrapper faultSimulationContentWrapper, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(faultSimulationContentWrapper, nameof(faultSimulationContentWrapper)); + + using var scope = _serviceFabricManagedClusterManagedClustersClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.StartFaultSimulation"); + scope.Start(); + try + { + var response = _serviceFabricManagedClusterManagedClustersRestClient.StartFaultSimulation(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, faultSimulationContentWrapper, cancellationToken); + var operation = new ServiceFabricManagedClustersArmOperation(new FaultSimulationOperationSource(), _serviceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, _serviceFabricManagedClusterManagedClustersRestClient.CreateStartFaultSimulationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, faultSimulationContentWrapper).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops a fault simulation on the cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/stopFaultSimulation + /// + /// + /// Operation Id + /// ManagedClusters_StopFaultSimulation + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameter with fault simulation id. + /// The cancellation token to use. + /// is null. + public virtual async Task> StopFaultSimulationAsync(WaitUntil waitUntil, FaultSimulationIdContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedClusterManagedClustersClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.StopFaultSimulation"); + scope.Start(); + try + { + var response = await _serviceFabricManagedClusterManagedClustersRestClient.StopFaultSimulationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ServiceFabricManagedClustersArmOperation(new FaultSimulationOperationSource(), _serviceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, _serviceFabricManagedClusterManagedClustersRestClient.CreateStopFaultSimulationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops a fault simulation on the cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/stopFaultSimulation + /// + /// + /// Operation Id + /// ManagedClusters_StopFaultSimulation + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameter with fault simulation id. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation StopFaultSimulation(WaitUntil waitUntil, FaultSimulationIdContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedClusterManagedClustersClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.StopFaultSimulation"); + scope.Start(); + try + { + var response = _serviceFabricManagedClusterManagedClustersRestClient.StopFaultSimulation(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new ServiceFabricManagedClustersArmOperation(new FaultSimulationOperationSource(), _serviceFabricManagedClusterManagedClustersClientDiagnostics, Pipeline, _serviceFabricManagedClusterManagedClustersRestClient.CreateStopFaultSimulationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Action to get Az Resiliency Status of all the Base resources constituting Service Fabric Managed Clusters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/getazresiliencystatus + /// + /// + /// Operation Id + /// ManagedAzResiliencyStatus_GetManagedAzResiliencyStatus + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetManagedAzResiliencyStatusAsync(CancellationToken cancellationToken = default) + { + using var scope = _managedAzResiliencyStatusClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.GetManagedAzResiliencyStatus"); + scope.Start(); + try + { + var response = await _managedAzResiliencyStatusRestClient.GetManagedAzResiliencyStatusAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); return response; } catch (Exception e) @@ -660,30 +921,30 @@ public virtual async Task> GetManagedMa } /// - /// Action to get Maintenance Window Status of the Service Fabric Managed Clusters. + /// Action to get Az Resiliency Status of all the Base resources constituting Service Fabric Managed Clusters. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/getMaintenanceWindowStatus + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/getazresiliencystatus /// /// /// Operation Id - /// managedMaintenanceWindowStatus_Get + /// ManagedAzResiliencyStatus_GetManagedAzResiliencyStatus /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// /// The cancellation token to use. - public virtual Response GetManagedMaintenanceWindowStatu(CancellationToken cancellationToken = default) + public virtual Response GetManagedAzResiliencyStatus(CancellationToken cancellationToken = default) { - using var scope = _managedMaintenanceWindowStatusClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.GetManagedMaintenanceWindowStatu"); + using var scope = _managedAzResiliencyStatusClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.GetManagedAzResiliencyStatus"); scope.Start(); try { - var response = _managedMaintenanceWindowStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var response = _managedAzResiliencyStatusRestClient.GetManagedAzResiliencyStatus(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); return response; } catch (Exception e) @@ -702,11 +963,11 @@ public virtual Response GetManagedMaintenanceWin /// /// /// Operation Id - /// managedApplyMaintenanceWindow_Post + /// ManagedApplyMaintenanceWindow_Post /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// @@ -736,11 +997,11 @@ public virtual async Task PostManagedApplyMaintenanceWindowAsync(Cance /// /// /// Operation Id - /// managedApplyMaintenanceWindow_Post + /// ManagedApplyMaintenanceWindow_Post /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// @@ -761,6 +1022,74 @@ public virtual Response PostManagedApplyMaintenanceWindow(CancellationToken canc } } + /// + /// Action to get Maintenance Window Status of the Service Fabric Managed Clusters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/getMaintenanceWindowStatus + /// + /// + /// Operation Id + /// ManagedMaintenanceWindowStatus_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetManagedMaintenanceWindowStatuAsync(CancellationToken cancellationToken = default) + { + using var scope = _managedMaintenanceWindowStatusClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.GetManagedMaintenanceWindowStatu"); + scope.Start(); + try + { + var response = await _managedMaintenanceWindowStatusRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Action to get Maintenance Window Status of the Service Fabric Managed Clusters. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/getMaintenanceWindowStatus + /// + /// + /// Operation Id + /// ManagedMaintenanceWindowStatus_Get + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetManagedMaintenanceWindowStatu(CancellationToken cancellationToken = default) + { + using var scope = _managedMaintenanceWindowStatusClientDiagnostics.CreateScope("ServiceFabricManagedClusterResource.GetManagedMaintenanceWindowStatu"); + scope.Start(); + try + { + var response = _managedMaintenanceWindowStatusRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Add a tag to the current resource. /// @@ -770,11 +1099,11 @@ public virtual Response PostManagedApplyMaintenanceWindow(CancellationToken canc /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -832,11 +1161,11 @@ public virtual async Task> AddTagA /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -894,11 +1223,11 @@ public virtual Response AddTag(string key, /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -951,11 +1280,11 @@ public virtual async Task> SetTags /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -1008,11 +1337,11 @@ public virtual Response SetTags(IDictionary /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -1068,11 +1397,11 @@ public virtual async Task> RemoveT /// /// /// Operation Id - /// ManagedClusters_Get + /// ManagedCluster_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeCollection.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeCollection.cs index 0b72e38e5e2e..9c1d9a9d939b 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeCollection.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeCollection.cs @@ -60,11 +60,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// NodeTypes_CreateOrUpdate + /// NodeType_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -109,11 +109,11 @@ public virtual async Task> Cr /// /// /// Operation Id - /// NodeTypes_CreateOrUpdate + /// NodeType_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -158,11 +158,11 @@ public virtual ArmOperation CreateOrUpdate /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -203,11 +203,11 @@ public virtual async Task> GetAsy /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -248,11 +248,11 @@ public virtual Response Get(string nodeTyp /// /// /// Operation Id - /// NodeTypes_ListByManagedClusters + /// NodeType_ListByManagedClusters /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -278,11 +278,11 @@ public virtual AsyncPageable GetAllAsync(C /// /// /// Operation Id - /// NodeTypes_ListByManagedClusters + /// NodeType_ListByManagedClusters /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -308,11 +308,11 @@ public virtual Pageable GetAll(Cancellatio /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -351,11 +351,11 @@ public virtual async Task> ExistsAsync(string nodeTypeName, Cance /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -394,11 +394,11 @@ public virtual Response Exists(string nodeTypeName, CancellationToken canc /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -439,11 +439,11 @@ public virtual async Task /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeData.Serialization.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeData.Serialization.cs index 93fe7435a751..0ebc3fd77ac6 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeData.Serialization.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeData.Serialization.cs @@ -37,11 +37,6 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } base.JsonModelWriteCore(writer, options); - if (Optional.IsDefined(Sku)) - { - writer.WritePropertyName("sku"u8); - writer.WriteObjectValue(Sku, options); - } if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -53,6 +48,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndObject(); } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(IsPrimary)) @@ -292,6 +292,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("securityType"u8); writer.WriteStringValue(SecurityType.Value.ToString()); } + if (Optional.IsDefined(SecurityEncryptionType)) + { + writer.WritePropertyName("securityEncryptionType"u8); + writer.WriteStringValue(SecurityEncryptionType.Value.ToString()); + } if (Optional.IsDefined(IsSecureBootEnabled)) { writer.WritePropertyName("secureBootEnabled"u8); @@ -367,6 +372,11 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (Optional.IsDefined(ZoneBalance)) + { + writer.WritePropertyName("zoneBalance"u8); + writer.WriteBooleanValue(ZoneBalance.Value); + } writer.WriteEndObject(); } @@ -390,8 +400,8 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged { return null; } - NodeTypeSku sku = default; IDictionary tags = default; + NodeTypeSku sku = default; ResourceIdentifier id = default; string name = default; ResourceType type = default; @@ -434,6 +444,7 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged ResourceIdentifier subnetId = default; IList vmSetupActions = default; ServiceFabricManagedClusterSecurityType? securityType = default; + SecurityEncryptionType? securityEncryptionType = default; bool? secureBootEnabled = default; bool? enableNodePublicIP = default; bool? enableNodePublicIPv6 = default; @@ -446,19 +457,11 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged IList additionalNetworkInterfaceConfigurations = default; string computerNamePrefix = default; IList vmApplications = default; + bool? zoneBalance = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("sku"u8)) - { - if (property.Value.ValueKind == JsonValueKind.Null) - { - continue; - } - sku = NodeTypeSku.DeserializeNodeTypeSku(property.Value, options); - continue; - } if (property.NameEquals("tags"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -473,6 +476,15 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged tags = dictionary; continue; } + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = NodeTypeSku.DeserializeNodeTypeSku(property.Value, options); + continue; + } if (property.NameEquals("id"u8)) { id = new ResourceIdentifier(property.Value.GetString()); @@ -822,7 +834,7 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged } if (property0.NameEquals("vmImageResourceId"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) + if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } @@ -831,7 +843,7 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged } if (property0.NameEquals("subnetId"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) + if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } @@ -861,6 +873,15 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged securityType = new ServiceFabricManagedClusterSecurityType(property0.Value.GetString()); continue; } + if (property0.NameEquals("securityEncryptionType"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + securityEncryptionType = new SecurityEncryptionType(property0.Value.GetString()); + continue; + } if (property0.NameEquals("secureBootEnabled"u8)) { if (property0.Value.ValueKind == JsonValueKind.Null) @@ -890,7 +911,7 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged } if (property0.NameEquals("vmSharedGalleryImageId"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) + if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } @@ -899,7 +920,7 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged } if (property0.NameEquals("natGatewayId"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) + if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } @@ -931,7 +952,7 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged } if (property0.NameEquals("serviceArtifactReferenceId"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) + if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } @@ -940,7 +961,7 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged } if (property0.NameEquals("dscpConfigurationId"u8)) { - if (property0.Value.ValueKind == JsonValueKind.Null || property0.Value.ValueKind == JsonValueKind.String && property0.Value.GetString().Length == 0) + if (property0.Value.ValueKind == JsonValueKind.Null) { continue; } @@ -980,6 +1001,15 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged vmApplications = array; continue; } + if (property0.NameEquals("zoneBalance"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoneBalance = property0.Value.GetBoolean(); + continue; + } } continue; } @@ -994,7 +1024,6 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged name, type, systemData, - sku, isPrimary, vmInstanceCount, dataDiskSizeGB, @@ -1033,6 +1062,7 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged subnetId, vmSetupActions ?? new ChangeTrackingList(), securityType, + securityEncryptionType, secureBootEnabled, enableNodePublicIP, enableNodePublicIPv6, @@ -1045,7 +1075,9 @@ internal static ServiceFabricManagedNodeTypeData DeserializeServiceFabricManaged additionalNetworkInterfaceConfigurations ?? new ChangeTrackingList(), computerNamePrefix, vmApplications ?? new ChangeTrackingList(), + zoneBalance, tags ?? new ChangeTrackingDictionary(), + sku, serializedAdditionalRawData); } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeData.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeData.cs index dc5a7d9c304d..90b3c64382aa 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeData.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeData.cs @@ -74,9 +74,8 @@ public ServiceFabricManagedNodeTypeData() /// The name. /// The resourceType. /// The systemData. - /// The node type sku. /// Indicates the Service Fabric system services for the cluster will run on this node type. This setting cannot be changed once the node type is created. - /// The number of nodes in the node type. <br /><br />**Values:** <br />-1 - Use when auto scale rules are configured or sku.capacity is defined <br /> 0 - Not supported <br /> >0 - Use for manual scale. + /// The number of nodes in the node type. **Values:** -1 - Use when auto scale rules are configured or sku.capacity is defined 0 - Not supported >0 - Use for manual scale. /// Disk size for the managed disk attached to the vms on the node type in GBs. /// Managed data disk type. Specifies the storage account type for the managed disk. /// Managed data disk letter. It can not use the reserved letter C or D and it can not change after created. @@ -112,8 +111,9 @@ public ServiceFabricManagedNodeTypeData() /// Indicates the resource id of the vm image. This parameter is used for custom vm image. /// Indicates the resource id of the subnet for the node type. /// Specifies the actions to be performed on the vms before bootstrapping the service fabric runtime. - /// Specifies the security type of the nodeType. Only Standard and TrustedLaunch are currently supported. - /// Specifies whether secure boot should be enabled on the nodeType. Can only be used with TrustedLaunch SecurityType. + /// Specifies the security type of the nodeType. Supported values include Standard, TrustedLaunch and ConfidentialVM. + /// Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob and VMGuestStateOnly for encryption of just the VMGuestState blob. Note: It can be set for only Confidential VMs. + /// Specifies whether secure boot should be enabled on the nodeType. Can only be used with TrustedLaunch and ConfidentialVM SecurityType. /// Specifies whether each node is allocated its own public IPv4 address. This is only supported on secondary node types with custom Load Balancers. /// Specifies whether each node is allocated its own public IPv6 address. This is only supported on secondary node types with custom Load Balancers. /// Indicates the resource id of the vm shared galleries image. This parameter is used for custom vm image. @@ -125,11 +125,12 @@ public ServiceFabricManagedNodeTypeData() /// Specifies the settings for any additional secondary network interfaces to attach to the node type. /// Specifies the computer name prefix. Limited to 9 characters. If specified, allows for a longer name to be specified for the node type name. /// Specifies the gallery applications that should be made available to the underlying VMSS. - /// Azure resource tags. + /// Setting this to true allows stateless node types to scale out without equal distribution across zones. + /// Resource tags. + /// The node type sku. /// Keeps track of any properties unknown to the library. - internal ServiceFabricManagedNodeTypeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, NodeTypeSku sku, bool? isPrimary, int? vmInstanceCount, int? dataDiskSizeInGB, ServiceFabricManagedDataDiskType? dataDiskType, string dataDiskLetter, IDictionary placementProperties, IDictionary capacities, EndpointRangeDescription applicationPorts, EndpointRangeDescription ephemeralPorts, string vmSize, string vmImagePublisher, string vmImageOffer, string vmImageSku, string vmImageVersion, IList vmSecrets, IList vmExtensions, VmManagedIdentity vmManagedIdentity, bool? isStateless, bool? hasMultiplePlacementGroups, IList frontendConfigurations, IList networkSecurityRules, IList additionalDataDisks, bool? isEncryptionAtHostEnabled, ServiceFabricManagedResourceProvisioningState? provisioningState, bool? isAcceleratedNetworkingEnabled, bool? useDefaultPublicLoadBalancer, bool? useTempDataDisk, bool? isOverProvisioningEnabled, IList zones, bool? isSpotVm, string hostGroupId, bool? useEphemeralOSDisk, string spotRestoreTimeout, SpotNodeVmEvictionPolicyType? evictionPolicy, ResourceIdentifier vmImageResourceId, ResourceIdentifier subnetId, IList vmSetupActions, ServiceFabricManagedClusterSecurityType? securityType, bool? isSecureBootEnabled, bool? isNodePublicIPEnabled, bool? isNodePublicIPv6Enabled, ResourceIdentifier vmSharedGalleryImageId, ResourceIdentifier natGatewayId, IList natConfigurations, VmImagePlan vmImagePlan, ResourceIdentifier serviceArtifactReferenceId, ResourceIdentifier dscpConfigurationId, IList additionalNetworkInterfaceConfigurations, string computerNamePrefix, IList vmApplications, IDictionary tags, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal ServiceFabricManagedNodeTypeData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, bool? isPrimary, int? vmInstanceCount, int? dataDiskSizeInGB, ServiceFabricManagedDataDiskType? dataDiskType, string dataDiskLetter, IDictionary placementProperties, IDictionary capacities, EndpointRangeDescription applicationPorts, EndpointRangeDescription ephemeralPorts, string vmSize, string vmImagePublisher, string vmImageOffer, string vmImageSku, string vmImageVersion, IList vmSecrets, IList vmExtensions, VmManagedIdentity vmManagedIdentity, bool? isStateless, bool? hasMultiplePlacementGroups, IList frontendConfigurations, IList networkSecurityRules, IList additionalDataDisks, bool? isEncryptionAtHostEnabled, ServiceFabricManagedResourceProvisioningState? provisioningState, bool? isAcceleratedNetworkingEnabled, bool? useDefaultPublicLoadBalancer, bool? useTempDataDisk, bool? isOverProvisioningEnabled, IList zones, bool? isSpotVm, string hostGroupId, bool? useEphemeralOSDisk, string spotRestoreTimeout, SpotNodeVmEvictionPolicyType? evictionPolicy, ResourceIdentifier vmImageResourceId, ResourceIdentifier subnetId, IList vmSetupActions, ServiceFabricManagedClusterSecurityType? securityType, SecurityEncryptionType? securityEncryptionType, bool? isSecureBootEnabled, bool? isNodePublicIPEnabled, bool? isNodePublicIPv6Enabled, ResourceIdentifier vmSharedGalleryImageId, ResourceIdentifier natGatewayId, IList natConfigurations, VmImagePlan vmImagePlan, ResourceIdentifier serviceArtifactReferenceId, ResourceIdentifier dscpConfigurationId, IList additionalNetworkInterfaceConfigurations, string computerNamePrefix, IList vmApplications, bool? zoneBalance, IDictionary tags, NodeTypeSku sku, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { - Sku = sku; IsPrimary = isPrimary; VmInstanceCount = vmInstanceCount; DataDiskSizeInGB = dataDiskSizeInGB; @@ -168,6 +169,7 @@ internal ServiceFabricManagedNodeTypeData(ResourceIdentifier id, string name, Re SubnetId = subnetId; VmSetupActions = vmSetupActions; SecurityType = securityType; + SecurityEncryptionType = securityEncryptionType; IsSecureBootEnabled = isSecureBootEnabled; IsNodePublicIPEnabled = isNodePublicIPEnabled; IsNodePublicIPv6Enabled = isNodePublicIPv6Enabled; @@ -180,15 +182,15 @@ internal ServiceFabricManagedNodeTypeData(ResourceIdentifier id, string name, Re AdditionalNetworkInterfaceConfigurations = additionalNetworkInterfaceConfigurations; ComputerNamePrefix = computerNamePrefix; VmApplications = vmApplications; + ZoneBalance = zoneBalance; Tags = tags; + Sku = sku; _serializedAdditionalRawData = serializedAdditionalRawData; } - /// The node type sku. - public NodeTypeSku Sku { get; set; } /// Indicates the Service Fabric system services for the cluster will run on this node type. This setting cannot be changed once the node type is created. public bool? IsPrimary { get; set; } - /// The number of nodes in the node type. <br /><br />**Values:** <br />-1 - Use when auto scale rules are configured or sku.capacity is defined <br /> 0 - Not supported <br /> >0 - Use for manual scale. + /// The number of nodes in the node type. **Values:** -1 - Use when auto scale rules are configured or sku.capacity is defined 0 - Not supported >0 - Use for manual scale. public int? VmInstanceCount { get; set; } /// Disk size for the managed disk attached to the vms on the node type in GBs. public int? DataDiskSizeInGB { get; set; } @@ -221,13 +223,13 @@ internal ServiceFabricManagedNodeTypeData(ResourceIdentifier id, string name, Re /// Identities to assign to the virtual machine scale set under the node type. internal VmManagedIdentity VmManagedIdentity { get; set; } /// The list of user identities associated with the virtual machine scale set under the node type. Each entry will be an ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - public IList UserAssignedIdentities + public IList VmManagedIdentityArmId { get { if (VmManagedIdentity is null) VmManagedIdentity = new VmManagedIdentity(); - return VmManagedIdentity.UserAssignedIdentities; + return VmManagedIdentity.ArmId; } } @@ -271,9 +273,11 @@ public IList UserAssignedIdentities public ResourceIdentifier SubnetId { get; set; } /// Specifies the actions to be performed on the vms before bootstrapping the service fabric runtime. public IList VmSetupActions { get; } - /// Specifies the security type of the nodeType. Only Standard and TrustedLaunch are currently supported. + /// Specifies the security type of the nodeType. Supported values include Standard, TrustedLaunch and ConfidentialVM. public ServiceFabricManagedClusterSecurityType? SecurityType { get; set; } - /// Specifies whether secure boot should be enabled on the nodeType. Can only be used with TrustedLaunch SecurityType. + /// Specifies the EncryptionType of the managed disk. It is set to DiskWithVMGuestState for encryption of the managed disk along with VMGuestState blob and VMGuestStateOnly for encryption of just the VMGuestState blob. Note: It can be set for only Confidential VMs. + public SecurityEncryptionType? SecurityEncryptionType { get; set; } + /// Specifies whether secure boot should be enabled on the nodeType. Can only be used with TrustedLaunch and ConfidentialVM SecurityType. public bool? IsSecureBootEnabled { get; set; } /// Specifies whether each node is allocated its own public IPv4 address. This is only supported on secondary node types with custom Load Balancers. public bool? IsNodePublicIPEnabled { get; set; } @@ -297,7 +301,11 @@ public IList UserAssignedIdentities public string ComputerNamePrefix { get; set; } /// Specifies the gallery applications that should be made available to the underlying VMSS. public IList VmApplications { get; } - /// Azure resource tags. + /// Setting this to true allows stateless node types to scale out without equal distribution across zones. + public bool? ZoneBalance { get; set; } + /// Resource tags. public IDictionary Tags { get; } + /// The node type sku. + public NodeTypeSku Sku { get; set; } } } diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeResource.cs index 0a16fe386ec3..1a4bf5aa18f0 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedNodeTypeResource.cs @@ -104,11 +104,11 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -144,11 +144,11 @@ public virtual async Task> GetAsy /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -184,11 +184,11 @@ public virtual Response Get(CancellationTo /// /// /// Operation Id - /// NodeTypes_Delete + /// NodeType_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -226,11 +226,11 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Operation Id - /// NodeTypes_Delete + /// NodeType_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -268,11 +268,11 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Operation Id - /// NodeTypes_Update + /// NodeType_Update /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -314,11 +314,11 @@ public virtual async Task> Up /// /// /// Operation Id - /// NodeTypes_Update + /// NodeType_Update /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -352,19 +352,19 @@ public virtual ArmOperation Update(WaitUnt } /// - /// Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and activate the nodes back again. + /// Deallocates one or more nodes on the node type. It will disable the fabric nodes, trigger a shutdown on the VMs and release them from the cluster. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/restart + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deallocate /// /// /// Operation Id - /// NodeTypes_Restart + /// NodeTypes_Deallocate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -373,19 +373,19 @@ public virtual ArmOperation Update(WaitUnt /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// parameters for restart action. + /// parameters for deallocate action. /// The cancellation token to use. /// is null. - public virtual async Task RestartAsync(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) + public virtual async Task DeallocateAsync(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.Restart"); + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.Deallocate"); scope.Start(); try { - var response = await _serviceFabricManagedNodeTypeNodeTypesRestClient.RestartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateRestartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _serviceFabricManagedNodeTypeNodeTypesRestClient.DeallocateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateDeallocateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -398,19 +398,19 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, NodeTy } /// - /// Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and activate the nodes back again. + /// Deallocates one or more nodes on the node type. It will disable the fabric nodes, trigger a shutdown on the VMs and release them from the cluster. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/restart + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deallocate /// /// /// Operation Id - /// NodeTypes_Restart + /// NodeTypes_Deallocate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -419,19 +419,203 @@ public virtual async Task RestartAsync(WaitUntil waitUntil, NodeTy /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// parameters for restart action. + /// parameters for deallocate action. /// The cancellation token to use. /// is null. - public virtual ArmOperation Restart(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation Deallocate(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.Restart"); + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.Deallocate"); scope.Start(); try { - var response = _serviceFabricManagedNodeTypeNodeTypesRestClient.Restart(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateRestartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _serviceFabricManagedNodeTypeNodeTypesRestClient.Deallocate(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateDeallocateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and removes the state from the cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deleteNode + /// + /// + /// Operation Id + /// NodeTypes_DeleteNode + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameters for delete action. + /// The cancellation token to use. + /// is null. + public virtual async Task DeleteNodeAsync(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.DeleteNode"); + scope.Start(); + try + { + var response = await _serviceFabricManagedNodeTypeNodeTypesRestClient.DeleteNodeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateDeleteNodeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and removes the state from the cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deleteNode + /// + /// + /// Operation Id + /// NodeTypes_DeleteNode + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameters for delete action. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation DeleteNode(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.DeleteNode"); + scope.Start(); + try + { + var response = _serviceFabricManagedNodeTypeNodeTypesRestClient.DeleteNode(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateDeleteNodeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Redeploys one or more nodes on the node type. It will disable the fabric nodes, trigger a shut down on the VMs, move them to a new node, and power them back on. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/redeploy + /// + /// + /// Operation Id + /// NodeTypes_Redeploy + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameters for redeploy action. + /// The cancellation token to use. + /// is null. + public virtual async Task RedeployAsync(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.Redeploy"); + scope.Start(); + try + { + var response = await _serviceFabricManagedNodeTypeNodeTypesRestClient.RedeployAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateRedeployRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Redeploys one or more nodes on the node type. It will disable the fabric nodes, trigger a shut down on the VMs, move them to a new node, and power them back on. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/redeploy + /// + /// + /// Operation Id + /// NodeTypes_Redeploy + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameters for redeploy action. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Redeploy(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.Redeploy"); + scope.Start(); + try + { + var response = _serviceFabricManagedNodeTypeNodeTypesRestClient.Redeploy(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateRedeployRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -456,7 +640,7 @@ public virtual ArmOperation Restart(WaitUntil waitUntil, NodeTypeActionContent c /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -502,7 +686,7 @@ public virtual async Task ReimageAsync(WaitUntil waitUntil, NodeTy /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -536,19 +720,19 @@ public virtual ArmOperation Reimage(WaitUntil waitUntil, NodeTypeActionContent c } /// - /// Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and removes the state from the cluster. + /// Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and activate the nodes back again. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deleteNode + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/restart /// /// /// Operation Id - /// NodeTypes_DeleteNode + /// NodeTypes_Restart /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -557,19 +741,19 @@ public virtual ArmOperation Reimage(WaitUntil waitUntil, NodeTypeActionContent c /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// parameters for delete action. + /// parameters for restart action. /// The cancellation token to use. /// is null. - public virtual async Task DeleteNodeAsync(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) + public virtual async Task RestartAsync(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.DeleteNode"); + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.Restart"); scope.Start(); try { - var response = await _serviceFabricManagedNodeTypeNodeTypesRestClient.DeleteNodeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); - var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateDeleteNodeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = await _serviceFabricManagedNodeTypeNodeTypesRestClient.RestartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateRestartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); return operation; @@ -582,19 +766,19 @@ public virtual async Task DeleteNodeAsync(WaitUntil waitUntil, Nod } /// - /// Deletes one or more nodes on the node type. It will disable the fabric nodes, trigger a delete on the VMs and removes the state from the cluster. + /// Restarts one or more nodes on the node type. It will disable the fabric nodes, trigger a restart on the VMs and activate the nodes back again. /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/deleteNode + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/restart /// /// /// Operation Id - /// NodeTypes_DeleteNode + /// NodeTypes_Restart /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -603,19 +787,19 @@ public virtual async Task DeleteNodeAsync(WaitUntil waitUntil, Nod /// /// /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. - /// parameters for delete action. + /// parameters for restart action. /// The cancellation token to use. /// is null. - public virtual ArmOperation DeleteNode(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) + public virtual ArmOperation Restart(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) { Argument.AssertNotNull(content, nameof(content)); - using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.DeleteNode"); + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.Restart"); scope.Start(); try { - var response = _serviceFabricManagedNodeTypeNodeTypesRestClient.DeleteNode(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); - var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateDeleteNodeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + var response = _serviceFabricManagedNodeTypeNodeTypesRestClient.Restart(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateRestartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); if (waitUntil == WaitUntil.Completed) operation.WaitForCompletionResponse(cancellationToken); return operation; @@ -627,6 +811,426 @@ public virtual ArmOperation DeleteNode(WaitUntil waitUntil, NodeTypeActionConten } } + /// + /// Starts one or more nodes on the node type. It will trigger an allocation of the fabric node if needed and activate them. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/start + /// + /// + /// Operation Id + /// NodeTypes_Start + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameters for start action. + /// The cancellation token to use. + /// is null. + public virtual async Task StartAsync(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.Start"); + scope.Start(); + try + { + var response = await _serviceFabricManagedNodeTypeNodeTypesRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts one or more nodes on the node type. It will trigger an allocation of the fabric node if needed and activate them. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/start + /// + /// + /// Operation Id + /// NodeTypes_Start + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameters for start action. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Start(WaitUntil waitUntil, NodeTypeActionContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.Start"); + scope.Start(); + try + { + var response = _serviceFabricManagedNodeTypeNodeTypesRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ServiceFabricManagedClustersArmOperation(_serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts a fault simulation on the node type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/startFaultSimulation + /// + /// + /// Operation Id + /// NodeTypes_StartFaultSimulation + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameters describing the fault simulation. + /// The cancellation token to use. + /// is null. + public virtual async Task> StartFaultSimulationAsync(WaitUntil waitUntil, FaultSimulationContentWrapper faultSimulationContentWrapper, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(faultSimulationContentWrapper, nameof(faultSimulationContentWrapper)); + + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.StartFaultSimulation"); + scope.Start(); + try + { + var response = await _serviceFabricManagedNodeTypeNodeTypesRestClient.StartFaultSimulationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, faultSimulationContentWrapper, cancellationToken).ConfigureAwait(false); + var operation = new ServiceFabricManagedClustersArmOperation(new FaultSimulationOperationSource(), _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateStartFaultSimulationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, faultSimulationContentWrapper).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts a fault simulation on the node type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/startFaultSimulation + /// + /// + /// Operation Id + /// NodeTypes_StartFaultSimulation + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameters describing the fault simulation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation StartFaultSimulation(WaitUntil waitUntil, FaultSimulationContentWrapper faultSimulationContentWrapper, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(faultSimulationContentWrapper, nameof(faultSimulationContentWrapper)); + + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.StartFaultSimulation"); + scope.Start(); + try + { + var response = _serviceFabricManagedNodeTypeNodeTypesRestClient.StartFaultSimulation(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, faultSimulationContentWrapper, cancellationToken); + var operation = new ServiceFabricManagedClustersArmOperation(new FaultSimulationOperationSource(), _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateStartFaultSimulationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, faultSimulationContentWrapper).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops a fault simulation on the node type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/stopFaultSimulation + /// + /// + /// Operation Id + /// NodeTypes_StopFaultSimulation + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameter with fault simulation id. + /// The cancellation token to use. + /// is null. + public virtual async Task> StopFaultSimulationAsync(WaitUntil waitUntil, FaultSimulationIdContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.StopFaultSimulation"); + scope.Start(); + try + { + var response = await _serviceFabricManagedNodeTypeNodeTypesRestClient.StopFaultSimulationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new ServiceFabricManagedClustersArmOperation(new FaultSimulationOperationSource(), _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateStopFaultSimulationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops a fault simulation on the node type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/stopFaultSimulation + /// + /// + /// Operation Id + /// NodeTypes_StopFaultSimulation + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// parameter with fault simulation id. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation StopFaultSimulation(WaitUntil waitUntil, FaultSimulationIdContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.StopFaultSimulation"); + scope.Start(); + try + { + var response = _serviceFabricManagedNodeTypeNodeTypesRestClient.StopFaultSimulation(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new ServiceFabricManagedClustersArmOperation(new FaultSimulationOperationSource(), _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateStopFaultSimulationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fault simulation by the simulationId. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/getFaultSimulation + /// + /// + /// Operation Id + /// NodeTypes_GetFaultSimulation + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// parameter with fault simulation id. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetFaultSimulationAsync(FaultSimulationIdContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.GetFaultSimulation"); + scope.Start(); + try + { + var response = await _serviceFabricManagedNodeTypeNodeTypesRestClient.GetFaultSimulationAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a fault simulation by the simulationId. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/getFaultSimulation + /// + /// + /// Operation Id + /// NodeTypes_GetFaultSimulation + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// parameter with fault simulation id. + /// The cancellation token to use. + /// is null. + public virtual Response GetFaultSimulation(FaultSimulationIdContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics.CreateScope("ServiceFabricManagedNodeTypeResource.GetFaultSimulation"); + scope.Start(); + try + { + var response = _serviceFabricManagedNodeTypeNodeTypesRestClient.GetFaultSimulation(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the list of recent fault simulations for the node type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/listFaultSimulation + /// + /// + /// Operation Id + /// NodeTypes_ListFaultSimulation + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetFaultSimulationAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateListFaultSimulationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateListFaultSimulationNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => FaultSimulation.DeserializeFaultSimulation(e), _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, "ServiceFabricManagedNodeTypeResource.GetFaultSimulation", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the list of recent fault simulations for the node type. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}/listFaultSimulation + /// + /// + /// Operation Id + /// NodeTypes_ListFaultSimulation + /// + /// + /// Default Api Version + /// 2025-03-01-preview + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetFaultSimulation(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateListFaultSimulationRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _serviceFabricManagedNodeTypeNodeTypesRestClient.CreateListFaultSimulationNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => FaultSimulation.DeserializeFaultSimulation(e), _serviceFabricManagedNodeTypeNodeTypesClientDiagnostics, Pipeline, "ServiceFabricManagedNodeTypeResource.GetFaultSimulation", "value", "nextLink", cancellationToken); + } + /// /// Get a Service Fabric node type supported SKUs. /// @@ -636,11 +1240,11 @@ public virtual ArmOperation DeleteNode(WaitUntil waitUntil, NodeTypeActionConten /// /// /// Operation Id - /// NodeTypeSkus_List + /// NodeTypeSkus_GetAvailableSkus /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// @@ -648,8 +1252,8 @@ public virtual ArmOperation DeleteNode(WaitUntil waitUntil, NodeTypeActionConten /// An async collection of that may take multiple service requests to iterate over. public virtual AsyncPageable GetAvailableSkusAsync(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nodeTypeSkusRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nodeTypeSkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _nodeTypeSkusRestClient.CreateGetAvailableSkusRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nodeTypeSkusRestClient.CreateGetAvailableSkusNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => NodeTypeAvailableSku.DeserializeNodeTypeAvailableSku(e), _nodeTypeSkusClientDiagnostics, Pipeline, "ServiceFabricManagedNodeTypeResource.GetAvailableSkus", "value", "nextLink", cancellationToken); } @@ -662,11 +1266,11 @@ public virtual AsyncPageable GetAvailableSkusAsync(Cancell /// /// /// Operation Id - /// NodeTypeSkus_List + /// NodeTypeSkus_GetAvailableSkus /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// @@ -674,8 +1278,8 @@ public virtual AsyncPageable GetAvailableSkusAsync(Cancell /// A collection of that may take multiple service requests to iterate over. public virtual Pageable GetAvailableSkus(CancellationToken cancellationToken = default) { - HttpMessage FirstPageRequest(int? pageSizeHint) => _nodeTypeSkusRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); - HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nodeTypeSkusRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage FirstPageRequest(int? pageSizeHint) => _nodeTypeSkusRestClient.CreateGetAvailableSkusRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _nodeTypeSkusRestClient.CreateGetAvailableSkusNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name); return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => NodeTypeAvailableSku.DeserializeNodeTypeAvailableSku(e), _nodeTypeSkusClientDiagnostics, Pipeline, "ServiceFabricManagedNodeTypeResource.GetAvailableSkus", "value", "nextLink", cancellationToken); } @@ -688,11 +1292,11 @@ public virtual Pageable GetAvailableSkus(CancellationToken /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -750,11 +1354,11 @@ public virtual async Task> AddTag /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -812,11 +1416,11 @@ public virtual Response AddTag(string key, /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -869,11 +1473,11 @@ public virtual async Task> SetTag /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -926,11 +1530,11 @@ public virtual Response SetTags(IDictionar /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -986,11 +1590,11 @@ public virtual async Task> Remove /// /// /// Operation Id - /// NodeTypes_Get + /// NodeType_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedServiceCollection.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedServiceCollection.cs index 63ca0b196ff8..a79bd7357d9d 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedServiceCollection.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedServiceCollection.cs @@ -56,15 +56,15 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_CreateOrUpdate + /// ServiceResource_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -105,15 +105,15 @@ public virtual async Task> Cre /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_CreateOrUpdate + /// ServiceResource_CreateOrUpdate /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -154,15 +154,15 @@ public virtual ArmOperation CreateOrUpdate( /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -199,15 +199,15 @@ public virtual async Task> GetAsyn /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -244,15 +244,15 @@ public virtual Response Get(string serviceN /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services /// /// /// Operation Id - /// Services_ListByApplications + /// ServiceResource_ListByApplications /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -274,15 +274,15 @@ public virtual AsyncPageable GetAllAsync(Ca /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services /// /// /// Operation Id - /// Services_ListByApplications + /// ServiceResource_ListByApplications /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -304,15 +304,15 @@ public virtual Pageable GetAll(Cancellation /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -347,15 +347,15 @@ public virtual async Task> ExistsAsync(string serviceName, Cancel /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -390,15 +390,15 @@ public virtual Response Exists(string serviceName, CancellationToken cance /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -435,15 +435,15 @@ public virtual async Task> /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedServiceResource.cs b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedServiceResource.cs index 710becbf7667..09c689cb7921 100644 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedServiceResource.cs +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/Generated/ServiceFabricManagedServiceResource.cs @@ -32,7 +32,7 @@ public partial class ServiceFabricManagedServiceResource : ArmResource /// The serviceName. public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string clusterName, string applicationName, string serviceName) { - var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName}"; + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName}"; return new ResourceIdentifier(resourceId); } @@ -41,7 +41,7 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ServiceFabricManagedServiceData _data; /// Gets the resource type for the operations. - public static readonly ResourceType ResourceType = "Microsoft.ServiceFabric/managedclusters/applications/services"; + public static readonly ResourceType ResourceType = "Microsoft.ServiceFabric/managedClusters/applications/services"; /// Initializes a new instance of the class for mocking. protected ServiceFabricManagedServiceResource() @@ -96,15 +96,15 @@ internal static void ValidateResourceId(ResourceIdentifier id) /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -136,15 +136,15 @@ public virtual async Task> GetAsyn /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -176,15 +176,15 @@ public virtual Response Get(CancellationTok /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Delete + /// ServiceResource_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -218,15 +218,15 @@ public virtual async Task DeleteAsync(WaitUntil waitUntil, Cancell /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Delete + /// ServiceResource_Delete /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -260,15 +260,15 @@ public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancel /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Update + /// ServiceResource_Update /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -302,15 +302,15 @@ public virtual async Task> UpdateA /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Update + /// ServiceResource_Update /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -344,15 +344,15 @@ public virtual Response Update(ServiceFabri /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -406,15 +406,15 @@ public virtual async Task> AddTagA /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -468,15 +468,15 @@ public virtual Response AddTag(string key, /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -525,15 +525,15 @@ public virtual async Task> SetTags /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -582,15 +582,15 @@ public virtual Response SetTags(IDictionary /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource @@ -642,15 +642,15 @@ public virtual async Task> RemoveT /// /// /// Request Path - /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedclusters/{clusterName}/applications/{applicationName}/services/{serviceName} + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/applications/{applicationName}/services/{serviceName} /// /// /// Operation Id - /// Services_Get + /// ServiceResource_Get /// /// /// Default Api Version - /// 2024-09-01-preview + /// 2025-03-01-preview /// /// /// Resource diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/autorest.md b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/autorest.md deleted file mode 100644 index 4daae1dff57b..000000000000 --- a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/src/autorest.md +++ /dev/null @@ -1,232 +0,0 @@ -# Generated code configuration - -Run `dotnet build /t:GenerateCode` to generate code. - -``` yaml - -azure-arm: true -csharp: true -library-name: ServiceFabricManagedClusters -namespace: Azure.ResourceManager.ServiceFabricManagedClusters -require: https://github.com/Azure/azure-rest-api-specs/blob/f17b769690a46d858134ee68ef0d89635083b560/specification/servicefabricmanagedclusters/resource-manager/readme.md -#tag: package-2024-09-preview -output-folder: $(this-folder)/Generated -clear-output-folder: true -sample-gen: - output-folder: $(this-folder)/../samples/Generated - clear-output-folder: true -skip-csproj: true -modelerfour: - flatten-payloads: false -use-model-reader-writer: true - -#mgmt-debug: -# show-serialized-names: true - -request-path-is-non-resource: -- /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/environments/{environment}/managedClusterVersions/{clusterVersion} -- /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedClusterVersions/{clusterVersion} -- /subscriptions/{subscriptionId}/providers/Microsoft.ServiceFabric/locations/{location}/managedUnsupportedVMSizes/{vmSize} - -format-by-name-rules: - 'tenantId': 'uuid' - 'ETag': 'etag' - 'location': 'azure-location' - '*Uri': 'Uri' - '*Uris': 'Uri' - -models-to-treat-empty-string-as-null: - - ManagedClusterSubnet - - NodeTypeFrontendConfiguration - - ServiceFabricManagedClusterData - - ServiceFabricManagedClusterVersion - - ServiceFabricManagedNodeTypeData - - VmManagedIdentity - -acronym-mapping: - CPU: Cpu - CPUs: Cpus - Os: OS - Ip: IP - Ips: IPs|ips - ID: Id - IDs: Ids - VM: Vm - VMs: Vms - Vmos: VmOS - VMScaleSet: VmScaleSet - DNS: Dns - VPN: Vpn - NAT: Nat - WAN: Wan - Ipv4: IPv4|ipv4 - Ipv6: IPv6|ipv6 - Ipsec: IPsec|ipsec - SSO: Sso - URI: Uri - Etag: ETag|etag - LRS: Lrs - SSD: Ssd - -override-operation-name: - managedAzResiliencyStatus_get: GetManagedAzResiliencyStatus - NodeTypeSkus_List: GetAvailableSkus - managedUnsupportedVMSizes_Get: GetManagedUnsupportedVmSize - managedUnsupportedVMSizes_List: GetManagedUnsupportedVmSizes - ManagedClusterVersion_GetByEnvironment: GetManagedClusterVersionByEnvironment - managedAzResiliencyStatus_Get: GetManagedAzResiliencyStatus - -rename-mapping: - ApplicationResource: ServiceFabricManagedApplication - ApplicationTypeResource: ServiceFabricManagedApplicationType - ApplicationTypeVersionResource: ServiceFabricManagedApplicationTypeVersion - ApplicationUserAssignedIdentity: ApplicationUserAssignedIdentityInfo - ManagedClusterCodeVersionResult: ServiceFabricManagedClusterVersion - ManagedClusterCodeVersionResult.properties.supportExpiryUtc: VersionSupportExpireOn - OsType: ServiceFabricManagedClusterOSType - ManagedCluster: ServiceFabricManagedCluster - ManagedCluster.properties.addonFeatures: AddOnFeatures - ManagedCluster.properties.allowRdpAccess: IsRdpAccessAllowed - ManagedCluster.properties.clusterCertificateThumbprints: -|any - ManagedCluster.properties.clusterId: -|uuid - ManagedCluster.properties.enableAutoOSUpgrade: IsAutoOSUpgradeEnabled - ManagedCluster.properties.enableIpv6: IsIPv6Enabled - ManagedCluster.properties.enableServicePublicIP: IsServicePublicIPEnabled - ManagedCluster.properties.ipv4Address: -|ip-address - ManagedCluster.properties.ipv6Address: -|ip-address - ManagedCluster.properties.zonalResiliency: HasZoneResiliency - ManagedCluster.properties.enableHttpGatewayExclusiveAuthMode: IsHttpGatewayExclusiveAuthModeEnabled - - Subnet: ManagedClusterSubnet - Subnet.enableIpv6: IsIPv6Enabled - Subnet.networkSecurityGroupId: -|arm-id - AzureActiveDirectory: ManagedClusterAzureActiveDirectory - ClientCertificate: ManagedClusterClientCertificate - ClientCertificate.thumbprint: -|any - ClientCertificate.issuerThumbprint: -|any - ClusterState: ServiceFabricManagedClusterState - ClusterUpgradeCadence: ManagedClusterUpgradeCadence - ClusterUpgradeMode: ManagedClusterUpgradeMode - SettingsSectionDescription: ClusterFabricSettingsSection - SettingsParameterDescription: ClusterFabricSettingsParameterDescription - IpTag: ManagedClusterIPTag - LoadBalancingRule: ManagedClusterLoadBalancingRule - NetworkSecurityRule: ServiceFabricManagedNetworkSecurityRule - Direction: ServiceFabricManagedNetworkSecurityRuleDirection - Access: ServiceFabricManagedNetworkTrafficAccess - ManagedResourceProvisioningState: ServiceFabricManagedResourceProvisioningState - ServiceEndpoint: ManagedClusterServiceEndpoint - ServiceEndpoint.locations: -|azure-location - NodeType: ServiceFabricManagedNodeType - NodeType.properties.dataDiskSizeGB: DataDiskSizeInGB - NodeType.properties.enableAcceleratedNetworking: IsAcceleratedNetworkingEnabled - NodeType.properties.enableEncryptionAtHost: IsEncryptionAtHostEnabled - NodeType.properties.enableOverProvisioning: IsOverProvisioningEnabled - NodeType.properties.multiplePlacementGroups: HasMultiplePlacementGroups - NodeType.properties.enableNodePublicIPv6: IsNodePublicIPv6Enabled - VmApplication : ServiceFabricManagedVmApplication - VmssDataDisk: NodeTypeVmssDataDisk - VmssDataDisk.diskSizeGB: DiskSizeInGB - VmssExtension: NodeTypeVmssExtension - VmssExtension.properties.enableAutomaticUpgrade: IsAutomaticUpgradeEnabled - VaultSecretGroup: NodeTypeVaultSecretGroup - VaultCertificate: NodeTypeVaultCertificate - DiskType: ServiceFabricManagedDataDiskType - FrontendConfiguration: NodeTypeFrontendConfiguration - FrontendConfiguration.loadBalancerBackendAddressPoolId: -|arm-id - FrontendConfiguration.loadBalancerInboundNatPoolId: -|arm-id - VmManagedIdentity.userAssignedIdentities: -|arm-id - NodeTypeActionParameters: NodeTypeActionContent - NodeTypeActionParameters.force: IsForced - ServiceResource: ServiceFabricManagedService - ServiceResourceProperties: ManagedServiceProperties - ServiceResourcePropertiesBase: ManagedServiceBaseProperties - ServiceCorrelation: ManagedServiceCorrelation - ServiceCorrelationScheme: ManagedServiceCorrelationScheme - ScalingPolicy: ManagedServiceScalingPolicy - ScalingMechanism: ManagedServiceScalingMechanism - ScalingTrigger: ManagedServiceScalingTrigger - MoveCost: ServiceFabricManagedServiceMoveCost - ApplicationUpgradePolicy.instanceCloseDelayDuration: InstanceCloseDelayDurationInSeconds - FailureAction: PolicyViolationCompensationAction - IPAddressType: NodeTypeFrontendConfigurationIPAddressType - ProbeProtocol: ManagedClusterLoadBalanceProbeProtocol - Protocol: ManagedClusterLoadBalancingRuleTransportProtocol - Partition: ManagedServicePartitionScheme - NsgProtocol: ServiceFabricManagedNsgProtocol - NsgProtocol.ah: AH - NodeTypeAvailableSku.resourceType: -|resource-type - PartitionInstanceCountScaleMechanism: PartitionInstanceCountScalingMechanism - PrivateEndpointNetworkPolicies: ManagedClusterSubnetPrivateEndpointNetworkPoliciesState - PrivateLinkServiceNetworkPolicies: ManagedClusterSubnetPrivateLinkServiceNetworkPoliciesState - ServiceLoadMetric: ManagedServiceLoadMetric - ServiceLoadMetricWeight: ManagedServiceLoadMetricWeight - ServicePackageActivationMode: ManagedServicePackageActivationMode - ServicePlacementPolicy: ManagedServicePlacementPolicy - ManagedVMSize: ServiceFabricManagedUnsupportedVmSize - AddRemoveIncrementalNamedPartitionScalingMechanism: NamedPartitionAddOrRemoveScalingMechanism - NodeType.properties.enableNodePublicIP: IsNodePublicIPEnabled - NodeType.properties.secureBootEnabled: IsSecureBootEnabled - EvictionPolicyType: SpotNodeVmEvictionPolicyType - ResourceAzStatus.resourceType: -|resource-type - SecurityType: ServiceFabricManagedClusterSecurityType - UpdateType: ServiceFabricManagedClusterUpdateType - ClusterHealthPolicy: ManagedClusterHealthPolicy - ClusterUpgradePolicy: ManagedClusterUpgradePolicy - ClusterUpgradeDeltaHealthPolicy: ManagedClusterUpgradeDeltaHealthPolicy - ClusterMonitoringPolicy: ManagedClusterMonitoringPolicy - PrivateIPAddressVersion: ServiceFabricManagedClusterPrivateIPAddressVersion - PublicIPAddressVersion: ServiceFabricManagedClusterPublicIPAddressVersion - IpConfiguration: ServiceFabricManagedClusterIPConfiguration - IpConfigurationPublicIPAddressConfiguration: ServiceFabricManagedClusterPublicIPAddressConfiguration - ManagedMaintenanceWindowStatus.lastWindowStatusUpdateAtUTC: LastWindowStatusUpdatedOn - ManagedMaintenanceWindowStatus.lastWindowStartTimeUTC: LastWindowStartOn - ManagedMaintenanceWindowStatus.lastWindowEndTimeUTC: LastWindowEndOn - -suppress-abstract-base-class: -- ManagedServiceProperties - -directive: - - remove-operation: OperationStatus_Get - - remove-operation: OperationResults_Get - - from: managedapplication.json - where: $.definitions - transform: > - $.HealthCheckWaitDuration['x-ms-format'] = 'duration-constant'; - $.HealthCheckStableDuration['x-ms-format'] = 'duration-constant'; - $.HealthCheckRetryTimeout['x-ms-format'] = 'duration-constant'; - $.UpgradeDomainTimeout['x-ms-format'] = 'duration-constant'; - $.UpgradeTimeout['x-ms-format'] = 'duration-constant'; - $.StatefulServiceProperties.properties.replicaRestartWaitDuration['x-ms-format'] = 'duration-constant'; - $.StatefulServiceProperties.properties.quorumLossWaitDuration['x-ms-format'] = 'duration-constant'; - $.StatefulServiceProperties.properties.standByReplicaKeepDuration['x-ms-format'] = 'duration-constant'; - $.StatefulServiceProperties.properties.servicePlacementTimeLimit['x-ms-format'] = 'duration-constant'; - - from: managedcluster.json - where: $.definitions - transform: > - $.ManagedClusterVersionDetails.properties.supportExpiryUtc['format'] = 'date-time'; - - from: nodetype.json - where: $.paths['/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ServiceFabric/managedClusters/{clusterName}/nodeTypes/{nodeTypeName}'].patch - transform: > - $['responses'] = { - "200": { - "description": "The operation completed successfully.", - "schema": { - "$ref": "#/definitions/NodeType" - } - }, - "202": { - "description": "The operation completed successfully.", - "schema": { - "$ref": "#/definitions/NodeType" - } - }, - "default": { - "description": "The detailed error response.", - "schema": { - "$ref": "#/definitions/ErrorModel" - } - } - } - reason: response status 202 missing -``` diff --git a/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/tsp-location.yaml b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/tsp-location.yaml new file mode 100644 index 000000000000..373163de2696 --- /dev/null +++ b/sdk/servicefabricmanagedclusters/Azure.ResourceManager.ServiceFabricManagedClusters/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/servicefabricmanagedclusters/ServiceFabricManagedClusters.Management +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/api/Azure.ResourceManager.StandbyPool.net8.0.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/api/Azure.ResourceManager.StandbyPool.net8.0.cs index c940003bf49d..26104b7a591c 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/api/Azure.ResourceManager.StandbyPool.net8.0.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/api/Azure.ResourceManager.StandbyPool.net8.0.cs @@ -299,12 +299,8 @@ public static partial class ArmStandbyPoolModelFactory public static Azure.ResourceManager.StandbyPool.StandbyContainerGroupPoolData StandbyContainerGroupPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolProperties properties = null) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolPrediction StandbyContainerGroupPoolPrediction(System.Collections.Generic.IEnumerable forecastValuesInstancesRequestedCount = null, System.DateTimeOffset forecastStartOn = default(System.DateTimeOffset), string forecastInfo = null) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolProperties StandbyContainerGroupPoolProperties(Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolElasticityProfile elasticityProfile = null, Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupProperties containerGroupProperties = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState = default(Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState?)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolProperties StandbyContainerGroupPoolProperties(Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolElasticityProfile elasticityProfile, Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupProperties containerGroupProperties, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState) { throw null; } public static Azure.ResourceManager.StandbyPool.StandbyContainerGroupPoolRuntimeViewData StandbyContainerGroupPoolRuntimeViewData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolRuntimeViewProperties properties = null) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolRuntimeViewProperties StandbyContainerGroupPoolRuntimeViewProperties(System.Collections.Generic.IEnumerable instanceCountSummary = null, Azure.ResourceManager.StandbyPool.Models.StandbyPoolStatus status = null, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState = default(Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState?), Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolPrediction prediction = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolRuntimeViewProperties StandbyContainerGroupPoolRuntimeViewProperties(System.Collections.Generic.IEnumerable instanceCountSummary, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyPoolStatus StandbyPoolStatus(Azure.ResourceManager.StandbyPool.Models.StandbyPoolHealthStateCode code = default(Azure.ResourceManager.StandbyPool.Models.StandbyPoolHealthStateCode), string message = null) { throw null; } public static Azure.ResourceManager.StandbyPool.StandbyVirtualMachineData StandbyVirtualMachineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineProperties properties = null) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineInstanceCountSummary StandbyVirtualMachineInstanceCountSummary(long? zone = default(long?), System.Collections.Generic.IEnumerable instanceCountsByState = null) { throw null; } @@ -314,8 +310,6 @@ public static partial class ArmStandbyPoolModelFactory public static Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolProperties StandbyVirtualMachinePoolProperties(Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolElasticityProfile elasticityProfile = null, Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineState virtualMachineState = default(Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineState), Azure.Core.ResourceIdentifier attachedVirtualMachineScaleSetId = null, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState = default(Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState?)) { throw null; } public static Azure.ResourceManager.StandbyPool.StandbyVirtualMachinePoolRuntimeViewData StandbyVirtualMachinePoolRuntimeViewData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolRuntimeViewProperties properties = null) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolRuntimeViewProperties StandbyVirtualMachinePoolRuntimeViewProperties(System.Collections.Generic.IEnumerable instanceCountSummary = null, Azure.ResourceManager.StandbyPool.Models.StandbyPoolStatus status = null, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState = default(Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState?), Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolPrediction prediction = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolRuntimeViewProperties StandbyVirtualMachinePoolRuntimeViewProperties(System.Collections.Generic.IEnumerable instanceCountSummary, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineProperties StandbyVirtualMachineProperties(Azure.Core.ResourceIdentifier virtualMachineResourceId = null, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState = default(Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState?)) { throw null; } } public partial class ContainerGroupInstanceCountSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/api/Azure.ResourceManager.StandbyPool.netstandard2.0.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/api/Azure.ResourceManager.StandbyPool.netstandard2.0.cs index c940003bf49d..26104b7a591c 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/api/Azure.ResourceManager.StandbyPool.netstandard2.0.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/api/Azure.ResourceManager.StandbyPool.netstandard2.0.cs @@ -299,12 +299,8 @@ public static partial class ArmStandbyPoolModelFactory public static Azure.ResourceManager.StandbyPool.StandbyContainerGroupPoolData StandbyContainerGroupPoolData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolProperties properties = null) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolPrediction StandbyContainerGroupPoolPrediction(System.Collections.Generic.IEnumerable forecastValuesInstancesRequestedCount = null, System.DateTimeOffset forecastStartOn = default(System.DateTimeOffset), string forecastInfo = null) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolProperties StandbyContainerGroupPoolProperties(Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolElasticityProfile elasticityProfile = null, Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupProperties containerGroupProperties = null, System.Collections.Generic.IEnumerable zones = null, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState = default(Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState?)) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolProperties StandbyContainerGroupPoolProperties(Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolElasticityProfile elasticityProfile, Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupProperties containerGroupProperties, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState) { throw null; } public static Azure.ResourceManager.StandbyPool.StandbyContainerGroupPoolRuntimeViewData StandbyContainerGroupPoolRuntimeViewData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolRuntimeViewProperties properties = null) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolRuntimeViewProperties StandbyContainerGroupPoolRuntimeViewProperties(System.Collections.Generic.IEnumerable instanceCountSummary = null, Azure.ResourceManager.StandbyPool.Models.StandbyPoolStatus status = null, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState = default(Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState?), Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolPrediction prediction = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.StandbyPool.Models.StandbyContainerGroupPoolRuntimeViewProperties StandbyContainerGroupPoolRuntimeViewProperties(System.Collections.Generic.IEnumerable instanceCountSummary, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyPoolStatus StandbyPoolStatus(Azure.ResourceManager.StandbyPool.Models.StandbyPoolHealthStateCode code = default(Azure.ResourceManager.StandbyPool.Models.StandbyPoolHealthStateCode), string message = null) { throw null; } public static Azure.ResourceManager.StandbyPool.StandbyVirtualMachineData StandbyVirtualMachineData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineProperties properties = null) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineInstanceCountSummary StandbyVirtualMachineInstanceCountSummary(long? zone = default(long?), System.Collections.Generic.IEnumerable instanceCountsByState = null) { throw null; } @@ -314,8 +310,6 @@ public static partial class ArmStandbyPoolModelFactory public static Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolProperties StandbyVirtualMachinePoolProperties(Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolElasticityProfile elasticityProfile = null, Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineState virtualMachineState = default(Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineState), Azure.Core.ResourceIdentifier attachedVirtualMachineScaleSetId = null, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState = default(Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState?)) { throw null; } public static Azure.ResourceManager.StandbyPool.StandbyVirtualMachinePoolRuntimeViewData StandbyVirtualMachinePoolRuntimeViewData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolRuntimeViewProperties properties = null) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolRuntimeViewProperties StandbyVirtualMachinePoolRuntimeViewProperties(System.Collections.Generic.IEnumerable instanceCountSummary = null, Azure.ResourceManager.StandbyPool.Models.StandbyPoolStatus status = null, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState = default(Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState?), Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolPrediction prediction = null) { throw null; } - [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] - public static Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachinePoolRuntimeViewProperties StandbyVirtualMachinePoolRuntimeViewProperties(System.Collections.Generic.IEnumerable instanceCountSummary, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState) { throw null; } public static Azure.ResourceManager.StandbyPool.Models.StandbyVirtualMachineProperties StandbyVirtualMachineProperties(Azure.Core.ResourceIdentifier virtualMachineResourceId = null, Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState? provisioningState = default(Azure.ResourceManager.StandbyPool.Models.StandbyProvisioningState?)) { throw null; } } public partial class ContainerGroupInstanceCountSummary : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/ArmStandbyPoolModelFactory.cs b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/ArmStandbyPoolModelFactory.cs index 3575cd0b2ffa..5c251223d21d 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/ArmStandbyPoolModelFactory.cs +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/src/Generated/ArmStandbyPoolModelFactory.cs @@ -7,7 +7,6 @@ using System; using System.Collections.Generic; -using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -250,41 +249,5 @@ public static StandbyContainerGroupPoolPrediction StandbyContainerGroupPoolPredi return new StandbyContainerGroupPoolPrediction(forecastValuesInstancesRequestedCount != null ? new StandbyContainerGroupPoolForecastValues(forecastValuesInstancesRequestedCount?.ToList(), serializedAdditionalRawData: null) : null, forecastStartOn, forecastInfo, serializedAdditionalRawData: null); } - - /// Initializes a new instance of . - /// A list containing the counts of container groups in each possible state, as known by the StandbyPool resource provider. - /// Displays the provisioning state of the standby pool. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static StandbyContainerGroupPoolRuntimeViewProperties StandbyContainerGroupPoolRuntimeViewProperties(IEnumerable instanceCountSummary, StandbyProvisioningState? provisioningState) - { - return StandbyContainerGroupPoolRuntimeViewProperties(instanceCountSummary: instanceCountSummary, status: default, provisioningState: provisioningState, prediction: default); - } - - /// Initializes a new instance of . - /// Specifies elasticity profile of standby container group pools. - /// Specifies container group properties of standby container group pools. - /// The status of the last operation. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static StandbyContainerGroupPoolProperties StandbyContainerGroupPoolProperties(StandbyContainerGroupPoolElasticityProfile elasticityProfile, StandbyContainerGroupProperties containerGroupProperties, StandbyProvisioningState? provisioningState) - { - return StandbyContainerGroupPoolProperties(elasticityProfile: elasticityProfile, containerGroupProperties: containerGroupProperties, zones: default, provisioningState: provisioningState); - } - - /// Initializes a new instance of . - /// - /// A list containing the counts of virtual machines in each possible power state for each zone if enabled, as known by the StandbyPool resource provider. - /// If zones are not enabled on the attached VMSS, the list will contain a single entry with null zone values. - /// Note: any updates to pool resources outside of StandbyPoolRP (i.e deleting a VM through portal) are not reflected here. - /// Note: any resources in the Running state may still be installing extensions / not fully provisioned. - /// - /// Displays the provisioning state of the standby pool. - /// A new instance for mocking. - [EditorBrowsable(EditorBrowsableState.Never)] - public static StandbyVirtualMachinePoolRuntimeViewProperties StandbyVirtualMachinePoolRuntimeViewProperties(IEnumerable instanceCountSummary, StandbyProvisioningState? provisioningState) - { - return StandbyVirtualMachinePoolRuntimeViewProperties(instanceCountSummary: instanceCountSummary, status: default, provisioningState: provisioningState, prediction: default); - } } } diff --git a/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml index db59ec6f9183..0757bff6d2c1 100644 --- a/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml +++ b/sdk/standbypool/Azure.ResourceManager.StandbyPool/tsp-location.yaml @@ -1,3 +1,4 @@ -directory: specification\standbypool\StandbyPool.Management -commit: dc4c1eaef16e0bc8b1e96c3d1e014deb96259b35 +directory: specification/standbypool/StandbyPool.Management +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml index 2ca0501b60bd..6d83bf7eebb6 100644 --- a/sdk/storage/ci.yml +++ b/sdk/storage/ci.yml @@ -9,9 +9,17 @@ trigger: paths: include: - sdk/storage/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - sdk/storage/Azure.Storage.DataMovement.Blobs/ + exclude: + - sdk/storage/Azure.ResourceManager.Storage/ - 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/ diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Azure.ResourceManager.SapVirtualInstances.sln b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Azure.ResourceManager.SapVirtualInstances.sln new file mode 100644 index 000000000000..fa67d228e160 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Azure.ResourceManager.SapVirtualInstances.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.SapVirtualInstances.Samples", "samples\Azure.ResourceManager.SapVirtualInstances.Samples.csproj", "{7A2DFF15-5746-49F4-BD0F-C6C35337088A}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.SapVirtualInstances", "src\Azure.ResourceManager.SapVirtualInstances.csproj", "{28FF4005-4467-4E36-92E7-DEA27DEB1519}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Azure.ResourceManager.SapVirtualInstances.Tests", "tests\Azure.ResourceManager.SapVirtualInstances.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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/CHANGELOG.md b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/CHANGELOG.md new file mode 100644 index 000000000000..8b33f0fedccc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Directory.Build.props b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Directory.Build.props new file mode 100644 index 000000000000..63bd836ad44b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/Directory.Build.props @@ -0,0 +1,6 @@ + + + + diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/README.md b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/README.md new file mode 100644 index 000000000000..bcc48b7af026 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/README.md @@ -0,0 +1,80 @@ +# Microsoft Azure SapVirtualInstances 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 SapVirtualInstances management library for .NET with [NuGet](https://www.nuget.org/): + +```dotnetcli +dotnet add package Azure.ResourceManager.SapVirtualInstances --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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/assets.json b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/assets.json new file mode 100644 index 000000000000..e269976e380b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/assets.json @@ -0,0 +1,7 @@ + +{ + "AssetsRepo": "Azure/azure-sdk-assets", + "AssetsRepoPrefixPath": "net", + "TagPrefix": "net/sapvirtualinstances/Azure.ResourceManager.SapVirtualInstances", + "Tag": "" +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Azure.ResourceManager.SapVirtualInstances.Samples.csproj b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Azure.ResourceManager.SapVirtualInstances.Samples.csproj new file mode 100644 index 000000000000..5507e60845be --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Azure.ResourceManager.SapVirtualInstances.Samples.csproj @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceCollection.cs new file mode 100644 index 000000000000..70a19c898099 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceCollection.cs @@ -0,0 +1,241 @@ +// 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.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapApplicationServerInstanceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SAPApplicationServerInstancesCreate() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Create.json + // this example is just showing the usage of "SAPApplicationServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapApplicationServerInstanceResource + SapApplicationServerInstanceCollection collection = sapVirtualInstance.GetSapApplicationServerInstances(); + + // invoke the operation + string applicationInstanceName = "app01"; + SapApplicationServerInstanceData data = new SapApplicationServerInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapApplicationServerProperties(), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, applicationInstanceName, data); + SapApplicationServerInstanceResource 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 + SapApplicationServerInstanceData 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_CreateSAPApplicationServerInstancesForHASystemWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_CreateForHaWithAvailabilitySet.json + // this example is just showing the usage of "SAPApplicationServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapApplicationServerInstanceResource + SapApplicationServerInstanceCollection collection = sapVirtualInstance.GetSapApplicationServerInstances(); + + // invoke the operation + string applicationInstanceName = "app01"; + SapApplicationServerInstanceData data = new SapApplicationServerInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapApplicationServerProperties(), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, applicationInstanceName, data); + SapApplicationServerInstanceResource 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 + SapApplicationServerInstanceData 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_SAPApplicationServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Get.json + // this example is just showing the usage of "SAPApplicationServerInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapApplicationServerInstanceResource + SapApplicationServerInstanceCollection collection = sapVirtualInstance.GetSapApplicationServerInstances(); + + // invoke the operation + string applicationInstanceName = "app01"; + SapApplicationServerInstanceResource result = await collection.GetAsync(applicationInstanceName); + + // 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 + SapApplicationServerInstanceData 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_SapApplicationServerInstancesListBySAPVirtualInstance() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_ListBySapVirtualInstance.json + // this example is just showing the usage of "SAPApplicationServerInstance_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapApplicationServerInstanceResource + SapApplicationServerInstanceCollection collection = sapVirtualInstance.GetSapApplicationServerInstances(); + + // invoke the operation and iterate over the result + await foreach (SapApplicationServerInstanceResource 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 + SapApplicationServerInstanceData 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_SAPApplicationServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Get.json + // this example is just showing the usage of "SAPApplicationServerInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapApplicationServerInstanceResource + SapApplicationServerInstanceCollection collection = sapVirtualInstance.GetSapApplicationServerInstances(); + + // invoke the operation + string applicationInstanceName = "app01"; + bool result = await collection.ExistsAsync(applicationInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SAPApplicationServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Get.json + // this example is just showing the usage of "SAPApplicationServerInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapApplicationServerInstanceResource + SapApplicationServerInstanceCollection collection = sapVirtualInstance.GetSapApplicationServerInstances(); + + // invoke the operation + string applicationInstanceName = "app01"; + NullableResponse response = await collection.GetIfExistsAsync(applicationInstanceName); + SapApplicationServerInstanceResource 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 + SapApplicationServerInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceResource.cs new file mode 100644 index 000000000000..a754e7233cd3 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapApplicationServerInstanceResource.cs @@ -0,0 +1,306 @@ +// 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.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapApplicationServerInstanceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SAPApplicationServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Get.json + // this example is just showing the usage of "SAPApplicationServerInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + SapApplicationServerInstanceResource result = await sapApplicationServerInstance.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 + SapApplicationServerInstanceData 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_SAPApplicationServerInstancesDelete() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Delete.json + // this example is just showing the usage of "SAPApplicationServerInstance_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 SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + await sapApplicationServerInstance.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SAPApplicationServerInstancesUpdate() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_Update.json + // this example is just showing the usage of "SAPApplicationServerInstance_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 SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + SapApplicationServerInstancePatch patch = new SapApplicationServerInstancePatch + { + Tags = +{ +["tag1"] = "value1" +}, + }; + SapApplicationServerInstanceResource result = await sapApplicationServerInstance.UpdateAsync(patch); + + // 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 + SapApplicationServerInstanceData 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 Start_StartTheSAPApplicationServerInstance() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_StartInstance.json + // this example is just showing the usage of "SAPApplicationServerInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent(); + ArmOperation lro = await sapApplicationServerInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Start_StartVirtualMachineAndTheSAPApplicationServerInstanceOnIt() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_StartInstanceVM.json + // this example is just showing the usage of "SAPApplicationServerInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent + { + StartVm = true, + }; + ArmOperation lro = await sapApplicationServerInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheSAPApplicationServerInstance() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_StopInstance.json + // this example is just showing the usage of "SAPApplicationServerInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 0L, + }; + ArmOperation lro = await sapApplicationServerInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheSAPApplicationServerInstanceAndItSInfrastructure() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_StopInstanceInfrastructure.json + // this example is just showing the usage of "SAPApplicationServerInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 0L, + DeallocateVm = true, + }; + ArmOperation lro = await sapApplicationServerInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SoftStopTheSAPApplicationServerInstance() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_StopInstanceSoft.json + // this example is just showing the usage of "SAPApplicationServerInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 300L, + }; + ArmOperation lro = await sapApplicationServerInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SoftStopTheSAPApplicationServerInstanceAndItSInfrastructure() + { + // Generated from example definition: 2024-09-01/SapApplicationServerInstances_StopInstanceSoftInfrastructure.json + // this example is just showing the usage of "SAPApplicationServerInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapApplicationServerInstanceResource created on azure + // for more information of creating SapApplicationServerInstanceResource, please refer to the document of SapApplicationServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string applicationInstanceName = "app01"; + ResourceIdentifier sapApplicationServerInstanceResourceId = SapApplicationServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + SapApplicationServerInstanceResource sapApplicationServerInstance = client.GetSapApplicationServerInstanceResource(sapApplicationServerInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 300L, + DeallocateVm = true, + }; + ArmOperation lro = await sapApplicationServerInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceCollection.cs new file mode 100644 index 000000000000..6984bc34d5d5 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceCollection.cs @@ -0,0 +1,241 @@ +// 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.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapCentralServerInstanceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SapCentralServerInstancesCreate() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Create.json + // this example is just showing the usage of "SAPCentralServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapCentralServerInstanceResource + SapCentralServerInstanceCollection collection = sapVirtualInstance.GetSapCentralServerInstances(); + + // invoke the operation + string centralInstanceName = "centralServer"; + SapCentralServerInstanceData data = new SapCentralServerInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapCentralServerProperties(), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, centralInstanceName, data); + SapCentralServerInstanceResource 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 + SapCentralServerInstanceData 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_CreateSAPCentralInstancesForHASystemWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_CreateForHaWithAvailabilitySet.json + // this example is just showing the usage of "SAPCentralServerInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapCentralServerInstanceResource + SapCentralServerInstanceCollection collection = sapVirtualInstance.GetSapCentralServerInstances(); + + // invoke the operation + string centralInstanceName = "centralServer"; + SapCentralServerInstanceData data = new SapCentralServerInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapCentralServerProperties(), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, centralInstanceName, data); + SapCentralServerInstanceResource 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 + SapCentralServerInstanceData 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_SapCentralServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Get.json + // this example is just showing the usage of "SAPCentralServerInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapCentralServerInstanceResource + SapCentralServerInstanceCollection collection = sapVirtualInstance.GetSapCentralServerInstances(); + + // invoke the operation + string centralInstanceName = "centralServer"; + SapCentralServerInstanceResource result = await collection.GetAsync(centralInstanceName); + + // 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 + SapCentralServerInstanceData 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_SAPCentralInstancesListBySAPVirtualInstance() + { + // Generated from example definition: 2024-09-01/SapCentralServerInstances_ListBySapVirtualInstance.json + // this example is just showing the usage of "SAPCentralServerInstance_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapCentralServerInstanceResource + SapCentralServerInstanceCollection collection = sapVirtualInstance.GetSapCentralServerInstances(); + + // invoke the operation and iterate over the result + await foreach (SapCentralServerInstanceResource 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 + SapCentralServerInstanceData 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_SapCentralServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Get.json + // this example is just showing the usage of "SAPCentralServerInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapCentralServerInstanceResource + SapCentralServerInstanceCollection collection = sapVirtualInstance.GetSapCentralServerInstances(); + + // invoke the operation + string centralInstanceName = "centralServer"; + bool result = await collection.ExistsAsync(centralInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SapCentralServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Get.json + // this example is just showing the usage of "SAPCentralServerInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapCentralServerInstanceResource + SapCentralServerInstanceCollection collection = sapVirtualInstance.GetSapCentralServerInstances(); + + // invoke the operation + string centralInstanceName = "centralServer"; + NullableResponse response = await collection.GetIfExistsAsync(centralInstanceName); + SapCentralServerInstanceResource 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 + SapCentralServerInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceResource.cs new file mode 100644 index 000000000000..c51a9b913e79 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapCentralServerInstanceResource.cs @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Identity; +using Azure.ResourceManager.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapCentralServerInstanceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SapCentralServerInstancesGet() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Get.json + // this example is just showing the usage of "SAPCentralServerInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + SapCentralServerInstanceResource result = await sapCentralServerInstance.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 + SapCentralServerInstanceData 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_SapCentralServerInstancesDelete() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Delete.json + // this example is just showing the usage of "SAPCentralServerInstance_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 SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + await sapCentralServerInstance.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SapCentralServerInstancesUpdate() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_Update.json + // this example is just showing the usage of "SAPCentralServerInstance_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 SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + SapCentralServerInstancePatch patch = new SapCentralServerInstancePatch + { + Tags = +{ +["tag1"] = "value1" +}, + }; + SapCentralServerInstanceResource result = await sapCentralServerInstance.UpdateAsync(patch); + + // 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 + SapCentralServerInstanceData 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 Start_StartTheSAPCentralServicesInstance() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_StartInstance.json + // this example is just showing the usage of "SAPCentralServerInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent(); + ArmOperation lro = await sapCentralServerInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Start_StartTheVirtualMachineSAndTheSAPCentralServicesInstanceOnIt() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_StartInstanceVM.json + // this example is just showing the usage of "SAPCentralServerInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent + { + StartVm = true, + }; + ArmOperation lro = await sapCentralServerInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheSAPCentralServicesInstance() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_StopInstance.json + // this example is just showing the usage of "SAPCentralServerInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 1200L, + }; + ArmOperation lro = await sapCentralServerInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheSAPCentralServicesInstanceAndItsUnderlyingVirtualMachineS() + { + // Generated from example definition: 2024-09-01/SapCentralInstances_StopInstanceVM.json + // this example is just showing the usage of "SAPCentralServerInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapCentralServerInstanceResource created on azure + // for more information of creating SapCentralServerInstanceResource, please refer to the document of SapCentralServerInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string centralInstanceName = "centralServer"; + ResourceIdentifier sapCentralServerInstanceResourceId = SapCentralServerInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + SapCentralServerInstanceResource sapCentralServerInstance = client.GetSapCentralServerInstanceResource(sapCentralServerInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + DeallocateVm = true, + }; + ArmOperation lro = await sapCentralServerInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceCollection.cs new file mode 100644 index 000000000000..57e19fd4683b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceCollection.cs @@ -0,0 +1,241 @@ +// 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.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapDatabaseInstanceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_SAPDatabaseInstancesCreate() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Create.json + // this example is just showing the usage of "SAPDatabaseInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapDatabaseInstanceResource + SapDatabaseInstanceCollection collection = sapVirtualInstance.GetSapDatabaseInstances(); + + // invoke the operation + string databaseInstanceName = "databaseServer"; + SapDatabaseInstanceData data = new SapDatabaseInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapDatabaseProperties(), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseInstanceName, data); + SapDatabaseInstanceResource 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 + SapDatabaseInstanceData 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_CreateSAPDatabaseInstancesForHASystemWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_CreateForHaWithAvailabilitySet.json + // this example is just showing the usage of "SAPDatabaseInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapDatabaseInstanceResource + SapDatabaseInstanceCollection collection = sapVirtualInstance.GetSapDatabaseInstances(); + + // invoke the operation + string databaseInstanceName = "databaseServer"; + SapDatabaseInstanceData data = new SapDatabaseInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapDatabaseProperties(), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, databaseInstanceName, data); + SapDatabaseInstanceResource 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 + SapDatabaseInstanceData 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_SAPDatabaseInstancesGet() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Get.json + // this example is just showing the usage of "SAPDatabaseInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapDatabaseInstanceResource + SapDatabaseInstanceCollection collection = sapVirtualInstance.GetSapDatabaseInstances(); + + // invoke the operation + string databaseInstanceName = "databaseServer"; + SapDatabaseInstanceResource result = await collection.GetAsync(databaseInstanceName); + + // 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 + SapDatabaseInstanceData 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_SAPDatabaseInstancesListBySAPVirtualInstance() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_List.json + // this example is just showing the usage of "SAPDatabaseInstance_List" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapDatabaseInstanceResource + SapDatabaseInstanceCollection collection = sapVirtualInstance.GetSapDatabaseInstances(); + + // invoke the operation and iterate over the result + await foreach (SapDatabaseInstanceResource 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 + SapDatabaseInstanceData 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_SAPDatabaseInstancesGet() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Get.json + // this example is just showing the usage of "SAPDatabaseInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapDatabaseInstanceResource + SapDatabaseInstanceCollection collection = sapVirtualInstance.GetSapDatabaseInstances(); + + // invoke the operation + string databaseInstanceName = "databaseServer"; + bool result = await collection.ExistsAsync(databaseInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SAPDatabaseInstancesGet() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Get.json + // this example is just showing the usage of "SAPDatabaseInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // get the collection of this SapDatabaseInstanceResource + SapDatabaseInstanceCollection collection = sapVirtualInstance.GetSapDatabaseInstances(); + + // invoke the operation + string databaseInstanceName = "databaseServer"; + NullableResponse response = await collection.GetIfExistsAsync(databaseInstanceName); + SapDatabaseInstanceResource 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 + SapDatabaseInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceResource.cs new file mode 100644 index 000000000000..de8c748921e3 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapDatabaseInstanceResource.cs @@ -0,0 +1,306 @@ +// 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.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapDatabaseInstanceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SAPDatabaseInstancesGet() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Get.json + // this example is just showing the usage of "SAPDatabaseInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "databaseServer"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + SapDatabaseInstanceResource result = await sapDatabaseInstance.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 + SapDatabaseInstanceData 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_SAPDatabaseInstancesDelete() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Delete.json + // this example is just showing the usage of "SAPDatabaseInstance_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 SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "databaseServer"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + await sapDatabaseInstance.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SAPDatabaseInstancesUpdate() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_Update.json + // this example is just showing the usage of "SAPDatabaseInstance_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 SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "databaseServer"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + SapDatabaseInstancePatch patch = new SapDatabaseInstancePatch + { + Tags = +{ +["key1"] = "value1" +}, + }; + SapDatabaseInstanceResource result = await sapDatabaseInstance.UpdateAsync(patch); + + // 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 + SapDatabaseInstanceData 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 Start_StartTheDatabaseInstanceOfTheSAPSystem() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_StartInstance.json + // this example is just showing the usage of "SAPDatabaseInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "db0"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent(); + ArmOperation lro = await sapDatabaseInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Start_StartVirtualMachineAndTheDatabaseInstanceOfTheSAPSystemOnIt() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_StartInstanceVM.json + // this example is just showing the usage of "SAPDatabaseInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "db0"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent + { + StartVm = true, + }; + ArmOperation lro = await sapDatabaseInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheDatabaseInstanceOfTheSAPSystem() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_StopInstance.json + // this example is just showing the usage of "SAPDatabaseInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "db0"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 0L, + }; + ArmOperation lro = await sapDatabaseInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SoftStopTheDatabaseInstanceOfTheSAPSystem() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_StopInstanceSoft.json + // this example is just showing the usage of "SAPDatabaseInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "db0"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 300L, + }; + ArmOperation lro = await sapDatabaseInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SoftStopTheDatabaseInstanceOfTheSAPSystemAndTheUnderlyingVirtualMachineS() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_StopInstanceSoftVM.json + // this example is just showing the usage of "SAPDatabaseInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "db0"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 300L, + DeallocateVm = true, + }; + ArmOperation lro = await sapDatabaseInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheDatabaseInstanceOfTheSAPSystemAndTheUnderlyingVirtualMachineS() + { + // Generated from example definition: 2024-09-01/SapDatabaseInstances_StopInstanceVM.json + // this example is just showing the usage of "SAPDatabaseInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapDatabaseInstanceResource created on azure + // for more information of creating SapDatabaseInstanceResource, please refer to the document of SapDatabaseInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + string databaseInstanceName = "db0"; + ResourceIdentifier sapDatabaseInstanceResourceId = SapDatabaseInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + SapDatabaseInstanceResource sapDatabaseInstance = client.GetSapDatabaseInstanceResource(sapDatabaseInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 0L, + DeallocateVm = true, + }; + ArmOperation lro = await sapDatabaseInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceCollection.cs new file mode 100644 index 000000000000..9bfc4d5ca023 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceCollection.cs @@ -0,0 +1,3485 @@ +// 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 Azure.ResourceManager.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapVirtualInstanceCollection + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task CreateOrUpdate_DetectSAPSoftwareInstallationOnADistributedSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateDetectDS.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("eastus2")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("{{resourcegrp}}", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", new VirtualMachineConfiguration("Standard_E4ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "azureuser", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", new VirtualMachineConfiguration("Standard_E4ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "azureuser", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + }), 2L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "azureuser", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + }), 1L)) + { + IsSecondaryIPEnabled = true, + }, + SoftwareConfiguration = new ExternalInstallationSoftwareConfiguration + { + CentralServerVmId = "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "sap.bpaas.com", + }, + }), + Tags = +{ +["created by"] = "azureuser" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_DetectSAPSoftwareInstallationOnAnHASystemWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateDetectHaAvailabilitySet.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + }, + SoftwareConfiguration = new ExternalInstallationSoftwareConfiguration + { + CentralServerVmId = "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_DetectSAPSoftwareInstallationOnAnHASystemWithAvailabilityZone() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateDetectHaAvailabilityZone.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }, + SoftwareConfiguration = new ExternalInstallationSoftwareConfiguration + { + CentralServerVmId = "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_DetectSAPSoftwareInstallationOnASingleServerSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateDetectSingleServer.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new SingleServerConfiguration("X00-RG", "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + })) + { + IsSecondaryIPEnabled = true, + DatabaseType = SapDatabaseType.HANA, + }, + SoftwareConfiguration = new ExternalInstallationSoftwareConfiguration + { + CentralServerVmId = "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureOnlyForDistributedSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraDS.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }), + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithDiskAndOSConfigurationForDistributedSystemRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraDiskOsDSRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + DiskVolumeConfigurations = +{ +["backup"] = new DiskVolumeConfiguration +{ +Count = 2L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["hana/data"] = new DiskVolumeConfiguration +{ +Count = 4L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/log"] = new DiskVolumeConfiguration +{ +Count = 3L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/shared"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["os"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 64L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["usr/sap"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +} +}, + }), + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithDiskAndOSConfigurationForHASystemWithAvailabilitySetRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraDiskOsHaAvailabilitySetRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + DiskVolumeConfigurations = +{ +["backup"] = new DiskVolumeConfiguration +{ +Count = 2L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["hana/data"] = new DiskVolumeConfiguration +{ +Count = 4L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/log"] = new DiskVolumeConfiguration +{ +Count = 3L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/shared"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["os"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 64L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["usr/sap"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +} +}, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithDiskAndOSConfigurationForHASystemWithAvailabilityZoneRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraDiskOsHaAvailabilityZoneRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + DiskVolumeConfigurations = +{ +["backup"] = new DiskVolumeConfiguration +{ +Count = 2L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["hana/data"] = new DiskVolumeConfiguration +{ +Count = 4L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/log"] = new DiskVolumeConfiguration +{ +Count = 3L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/shared"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["os"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 64L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["usr/sap"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +} +}, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithDiskAndOSConfigurationsForSingleServerSystemRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraDiskOsSingleServerRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new SingleServerConfiguration("X00-RG", "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/dindurkhya-e2etesting/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + })) + { + IsSecondaryIPEnabled = true, + DatabaseType = SapDatabaseType.HANA, + DiskVolumeConfigurations = +{ +["backup"] = new DiskVolumeConfiguration +{ +Count = 2L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["hana/data"] = new DiskVolumeConfiguration +{ +Count = 4L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/log"] = new DiskVolumeConfiguration +{ +Count = 3L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +}, +["hana/shared"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 256L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["os"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 64L, +SkuName = DiskSkuName.StandardSSDLRS, +}, +["usr/sap"] = new DiskVolumeConfiguration +{ +Count = 1L, +SizeGB = 128L, +SkuName = DiskSkuName.PremiumLRS, +} +}, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureOnlyForHASystemWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraHaAvailabilitySet.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 5L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureOnlyForHASystemWithAvailabilityZone() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraHaAvailabilityZone.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithOSConfigurationWithAzureComputeGalleryImage() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsComputeGalleryImage.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Id = new ResourceIdentifier("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/galleries/testgallery/images/rhelimagetest/versions/0.0.1"), + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Id = new ResourceIdentifier("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/galleries/testgallery/images/rhelimagetest/versions/0.0.1"), + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Id = new ResourceIdentifier("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Compute/galleries/testgallery/images/rhelimagetest/versions/0.0.1"), + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithOSConfigurationWithCustomResourceNamesForDistributedSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsCustomResourceNamesDS.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + CustomResourceNames = new ThreeTierFullResourceNames + { + CentralServer = new CentralServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "ascsvm", +HostName = "ascshostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "ascsnic", +}}, +OSDiskName = "ascsosdisk", +DataDiskNames = +{ +["default"] = new string[]{"ascsdisk0"} +}, +}}, + }, + ApplicationServer = new ApplicationServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "appvm0", +HostName = "apphostName0", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "appnic0", +}}, +OSDiskName = "app0osdisk", +DataDiskNames = +{ +["default"] = new string[]{"app0disk0"} +}, +}, new VirtualMachineResourceNames +{ +VmName = "appvm1", +HostName = "apphostName1", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "appnic1", +}}, +OSDiskName = "app1osdisk", +DataDiskNames = +{ +["default"] = new string[]{"app1disk0"} +}, +}}, + AvailabilitySetName = "appAvSet", + }, + DatabaseServer = new DatabaseServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "dbvm", +HostName = "dbhostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "dbnic", +}}, +OSDiskName = "dbosdisk", +DataDiskNames = +{ +["hanaData"] = new string[]{"hanadata0", "hanadata1"}, +["hanaLog"] = new string[]{"hanalog0", "hanalog1", "hanalog2"}, +["hanaShared"] = new string[]{"hanashared0", "hanashared1"}, +["usrSap"] = new string[]{"usrsap0"} +}, +}}, + }, + SharedStorage = new SharedStorageResourceNames + { + SharedStorageAccountName = "storageacc", + SharedStorageAccountPrivateEndPointName = "peForxNFS", + }, + }, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithOSConfigurationWithCustomResourceNamesForHASystemWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsCustomResourceNamesHaAvailabilitySet.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + CustomResourceNames = new ThreeTierFullResourceNames + { + CentralServer = new CentralServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "ascsvm", +HostName = "ascshostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "ascsnic", +}}, +OSDiskName = "ascsosdisk", +}, new VirtualMachineResourceNames +{ +VmName = "ersvm", +HostName = "ershostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "ersnic", +}}, +OSDiskName = "ersosdisk", +}}, + AvailabilitySetName = "csAvSet", + LoadBalancer = new LoadBalancerResourceNames + { + LoadBalancerName = "ascslb", + FrontendIPConfigurationNames = { "ascsip0", "ersip0" }, + BackendPoolNames = { "ascsBackendPool" }, + HealthProbeNames = { "ascsHealthProbe", "ersHealthProbe" }, + }, + }, + ApplicationServer = new ApplicationServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "appvm0", +HostName = "apphostName0", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "appnic0", +}}, +OSDiskName = "app0osdisk", +DataDiskNames = +{ +["default"] = new string[]{"app0disk0"} +}, +}, new VirtualMachineResourceNames +{ +VmName = "appvm1", +HostName = "apphostName1", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "appnic1", +}}, +OSDiskName = "app1osdisk", +DataDiskNames = +{ +["default"] = new string[]{"app1disk0"} +}, +}}, + AvailabilitySetName = "appAvSet", + }, + DatabaseServer = new DatabaseServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "dbvmpr", +HostName = "dbprhostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "dbprnic", +}}, +OSDiskName = "dbprosdisk", +DataDiskNames = +{ +["hanaData"] = new string[]{"hanadatapr0", "hanadatapr1"}, +["hanaLog"] = new string[]{"hanalogpr0", "hanalogpr1", "hanalogpr2"}, +["hanaShared"] = new string[]{"hanasharedpr0", "hanasharedpr1"}, +["usrSap"] = new string[]{"usrsappr0"} +}, +}, new VirtualMachineResourceNames +{ +VmName = "dbvmsr", +HostName = "dbsrhostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "dbsrnic", +}}, +OSDiskName = "dbsrosdisk", +DataDiskNames = +{ +["hanaData"] = new string[]{"hanadatasr0", "hanadatasr1"}, +["hanaLog"] = new string[]{"hanalogsr0", "hanalogsr1", "hanalogsr2"}, +["hanaShared"] = new string[]{"hanasharedsr0", "hanasharedsr1"}, +["usrSap"] = new string[]{"usrsapsr0"} +}, +}}, + AvailabilitySetName = "dbAvSet", + LoadBalancer = new LoadBalancerResourceNames + { + LoadBalancerName = "dblb", + FrontendIPConfigurationNames = { "dbip" }, + BackendPoolNames = { "dbBackendPool" }, + HealthProbeNames = { "dbHealthProbe" }, + }, + }, + SharedStorage = new SharedStorageResourceNames + { + SharedStorageAccountName = "storageacc", + SharedStorageAccountPrivateEndPointName = "peForxNFS", + }, + }, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithOSConfigurationWithCustomResourceNamesForHASystemWithAvailabilityZone() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsCustomResourceNamesHaAvailabilityZone.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + CustomResourceNames = new ThreeTierFullResourceNames + { + CentralServer = new CentralServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "ascsvm", +HostName = "ascshostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "ascsnic", +}}, +OSDiskName = "ascsosdisk", +}, new VirtualMachineResourceNames +{ +VmName = "ersvm", +HostName = "ershostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "ersnic", +}}, +OSDiskName = "ersosdisk", +}}, + LoadBalancer = new LoadBalancerResourceNames + { + LoadBalancerName = "ascslb", + FrontendIPConfigurationNames = { "ascsip0", "ersip0" }, + BackendPoolNames = { "ascsBackendPool" }, + HealthProbeNames = { "ascsHealthProbe", "ersHealthProbe" }, + }, + }, + ApplicationServer = new ApplicationServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "appvm0", +HostName = "apphostName0", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "appnic0", +}}, +OSDiskName = "app0osdisk", +DataDiskNames = +{ +["default"] = new string[]{"app0disk0"} +}, +}, new VirtualMachineResourceNames +{ +VmName = "appvm1", +HostName = "apphostName1", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "appnic1", +}}, +OSDiskName = "app1osdisk", +DataDiskNames = +{ +["default"] = new string[]{"app1disk0"} +}, +}}, + }, + DatabaseServer = new DatabaseServerFullResourceNames + { + VirtualMachines = {new VirtualMachineResourceNames +{ +VmName = "dbvmpr", +HostName = "dbprhostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "dbprnic", +}}, +OSDiskName = "dbprosdisk", +DataDiskNames = +{ +["hanaData"] = new string[]{"hanadatapr0", "hanadatapr1"}, +["hanaLog"] = new string[]{"hanalogpr0", "hanalogpr1", "hanalogpr2"}, +["hanaShared"] = new string[]{"hanasharedpr0", "hanasharedpr1"}, +["usrSap"] = new string[]{"usrsappr0"} +}, +}, new VirtualMachineResourceNames +{ +VmName = "dbvmsr", +HostName = "dbsrhostName", +NetworkInterfaces = {new NetworkInterfaceResourceNames +{ +NetworkInterfaceName = "dbsrnic", +}}, +OSDiskName = "dbsrosdisk", +DataDiskNames = +{ +["hanaData"] = new string[]{"hanadatasr0", "hanadatasr1"}, +["hanaLog"] = new string[]{"hanalogsr0", "hanalogsr1", "hanalogsr2"}, +["hanaShared"] = new string[]{"hanasharedsr0", "hanasharedsr1"}, +["usrSap"] = new string[]{"usrsapsr0"} +}, +}}, + LoadBalancer = new LoadBalancerResourceNames + { + LoadBalancerName = "dblb", + FrontendIPConfigurationNames = { "dbip" }, + BackendPoolNames = { "dbBackendPool" }, + HealthProbeNames = { "dbHealthProbe" }, + }, + }, + SharedStorage = new SharedStorageResourceNames + { + SharedStorageAccountName = "storageacc", + SharedStorageAccountPrivateEndPointName = "peForxNFS", + }, + }, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithOSConfigurationWithCustomResourceNamesForSingleServerSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsCustomResourceNamesSingleServer.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new SingleServerConfiguration("X00-RG", "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + })) + { + IsSecondaryIPEnabled = true, + DatabaseType = SapDatabaseType.HANA, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithOSConfigurationForDistributedSystemRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsDSRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }), + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithOSConfigurationForHASystemWithAvailabilitySetRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsHaAvailabilitySetRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithOSConfigurationForHASystemWithAvailabilityZoneRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsHaAvailabilityZoneRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 2L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithOSConfigurationForSingleServerSystemRecommended() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraOsSIngleServerRecommended.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new SingleServerConfiguration("X00-RG", "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + })) + { + IsSecondaryIPEnabled = true, + DatabaseType = SapDatabaseType.HANA, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureOnlyForSingleServerSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraSingleServer.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DeploymentConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new SingleServerConfiguration("X00-RG", "/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshPublicKeys = {new SshPublicKey +{ +KeyData = "ssh-rsa public key", +}}, + }, + })) + { + IsSecondaryIPEnabled = true, + DatabaseType = SapDatabaseType.HANA, + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithAnExistingSAPTransportDirectoryFileshare() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraWithExistingFileshare.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + StorageTransportFileShareConfiguration = new MountFileShareConfiguration("/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint", "/subscriptions/49d64d54-e888-4c46-a868-1936802b762c/resourceGroups/testrg/providers/Microsoft.Network/privateEndpoints/endpoint"), + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithANewSAPTransportDirectoryFileshare() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraWithNewFileshare.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + StorageTransportFileShareConfiguration = new CreateAndMountFileShareConfiguration + { + ResourceGroup = "rgName", + StorageAccountName = "storageName", + }, + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithOSConfigurationWithTrustedAccessEnabled() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraWithOsTrustedAccess.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }), + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }) + { + ManagedResourcesNetworkAccessType = ManagedResourcesNetworkAccessType.Private, + }, + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_CreateInfrastructureWithoutASAPTransportDirectoryFileshare() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInfraWithoutFileshare.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("westcentralus")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("X00-RG", new CentralServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E16ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/appsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 6L), new DatabaseConfiguration("/subscriptions/49d64d54-e966-4c46-a868-1999802b762c/resourceGroups/test-rg/providers/Microsoft.Networks/virtualNetworks/test-vnet/subnets/dbsubnet", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP", + Sku = "84sapha-gen2", + Version = "latest", + }, new OSProfile + { + AdminUsername = "{your-username}", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "abc", + PrivateKey = "xyz", + }, + }, + }), 1L) + { + DatabaseType = SapDatabaseType.HANA, + }) + { + StorageTransportFileShareConfiguration = new SkipFileShareConfiguration(), + }, + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "xyz.test.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_InstallSAPSoftwareOnDistributedSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInstallDS.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("eastus2")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.Prod, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new ThreeTierConfiguration("{{resourcegrp}}", new CentralServerConfiguration("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", new VirtualMachineConfiguration("Standard_E4ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "8.2", + Version = "8.2.2021091201", + }, new OSProfile + { + AdminUsername = "azureuser", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + }), 1L), new ApplicationServerConfiguration("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", new VirtualMachineConfiguration("Standard_E4ds_v4", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "8.2", + Version = "8.2.2021091201", + }, new OSProfile + { + AdminUsername = "azureuser", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + }), 2L), new DatabaseConfiguration("/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/app", new VirtualMachineConfiguration("Standard_M32ts", new ImageReference + { + Publisher = "RedHat", + Offer = "RHEL-SAP-HA", + Sku = "8.2", + Version = "8.2.2021091201", + }, new OSProfile + { + AdminUsername = "azureuser", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + }), 1L)) + { + IsSecondaryIPEnabled = true, + }, + SoftwareConfiguration = new SapInstallWithoutOSConfigSoftwareConfiguration("https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml", "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount", "SAP S/4HANA 1909 SPS 03"), + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "sap.bpaas.com", + }, + }), + Tags = +{ +["created by"] = "azureuser" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_InstallSAPSoftwareOnSingleServerSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateInstallSingleServer.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("eastus2")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DeploymentWithOSConfiguration + { + AppLocation = "eastus", + InfrastructureConfiguration = new SingleServerConfiguration("test-rg", "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Network/virtualNetworks/test-vnet/subnets/testsubnet", new VirtualMachineConfiguration("Standard_E32ds_v4", new ImageReference + { + Publisher = "SUSE", + Offer = "SLES-SAP", + Sku = "12-sp4-gen2", + Version = "2022.02.01", + }, new OSProfile + { + AdminUsername = "azureappadmin", + OSConfiguration = new LinuxConfiguration + { + DisablePasswordAuthentication = true, + SshKeyPair = new SshKeyPair + { + PublicKey = "{{sshkey}}", + PrivateKey = "{{privateKey}}", + }, + }, + })), + SoftwareConfiguration = new SapInstallWithoutOSConfigSoftwareConfiguration("https://teststorageaccount.blob.core.windows.net/sapbits/sapfiles/boms/S41909SPS03_v0011ms/S41909SPS03_v0011ms.yaml", "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Storage/storageAccounts/teststorageaccount", "SAP S/4HANA 1909 SPS 03"), + OSSapConfiguration = new OSSapConfiguration + { + SapFqdn = "sap.bpaas.com", + }, + }), + Tags = { }, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_RegisterExistingSAPSystemAsVirtualInstanceForSAPSolutions() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateRegisterSapSolutions.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("northeurope")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DiscoveryConfiguration + { + CentralServerVmId = "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + }), + Tags = +{ +["createdby"] = "abc@microsoft.com", +["test"] = "abc" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_RegisterExistingSAPSystemAsVirtualInstanceForSAPSolutionsWithOptionalCustomizations() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateRegisterSapSolutionsCustom.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("northeurope")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DiscoveryConfiguration + { + CentralServerVmId = "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + ManagedRgStorageAccountName = "q20saacssgrs", + }), + Tags = +{ +["createdby"] = "abc@microsoft.com", +["test"] = "abc" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_RegisterWithTrustedAccessEnabled() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_CreateRegisterWithTrustedAccess.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceData data = new SapVirtualInstanceData(new AzureLocation("northeurope")) + { + Properties = new SapVirtualInstanceProperties(SapEnvironmentType.NonProd, SapProductType.S4HANA, new DiscoveryConfiguration + { + CentralServerVmId = "/subscriptions/8e17e36c-42e9-4cd5-a078-7b44883414e0/resourceGroups/test-rg/providers/Microsoft.Compute/virtualMachines/sapq20scsvm0", + }) + { + ManagedResourcesNetworkAccessType = ManagedResourcesNetworkAccessType.Private, + }, + Tags = +{ +["createdby"] = "abc@microsoft.com", +["test"] = "abc" +}, + }; + ArmOperation lro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, sapVirtualInstanceName, data); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_SAPVirtualInstancesGet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Get.json + // this example is just showing the usage of "SAPVirtualInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceResource result = await collection.GetAsync(sapVirtualInstanceName); + + // 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 + SapVirtualInstanceData 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_SAPVirtualInstancesGetWithACSSInstallationBlocked() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_GetAcssInstallationBlocked.json + // this example is just showing the usage of "SAPVirtualInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + SapVirtualInstanceResource result = await collection.GetAsync(sapVirtualInstanceName); + + // 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 + SapVirtualInstanceData 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_SAPVirtualInstancesListByResourceGroup() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_ListByResourceGroup.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation and iterate over the result + await foreach (SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_SAPVirtualInstancesGet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Get.json + // this example is just showing the usage of "SAPVirtualInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + bool result = await collection.ExistsAsync(sapVirtualInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Exists_SAPVirtualInstancesGetWithACSSInstallationBlocked() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_GetAcssInstallationBlocked.json + // this example is just showing the usage of "SAPVirtualInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + bool result = await collection.ExistsAsync(sapVirtualInstanceName); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetIfExists_SAPVirtualInstancesGet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Get.json + // this example is just showing the usage of "SAPVirtualInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + NullableResponse response = await collection.GetIfExistsAsync(sapVirtualInstanceName); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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_SAPVirtualInstancesGetWithACSSInstallationBlocked() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_GetAcssInstallationBlocked.json + // this example is just showing the usage of "SAPVirtualInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + ResourceIdentifier resourceGroupResourceId = ResourceGroupResource.CreateResourceIdentifier(subscriptionId, resourceGroupName); + ResourceGroupResource resourceGroupResource = client.GetResourceGroupResource(resourceGroupResourceId); + + // get the collection of this SapVirtualInstanceResource + SapVirtualInstanceCollection collection = resourceGroupResource.GetSapVirtualInstances(); + + // invoke the operation + string sapVirtualInstanceName = "X00"; + NullableResponse response = await collection.GetIfExistsAsync(sapVirtualInstanceName); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceResource.cs new file mode 100644 index 000000000000..e9b0f6980c31 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SapVirtualInstanceResource.cs @@ -0,0 +1,372 @@ +// 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.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SapVirtualInstanceResource + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Get_SAPVirtualInstancesGet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Get.json + // this example is just showing the usage of "SAPVirtualInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + SapVirtualInstanceResource result = await sapVirtualInstance.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 + SapVirtualInstanceData 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_SAPVirtualInstancesGetWithACSSInstallationBlocked() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_GetAcssInstallationBlocked.json + // this example is just showing the usage of "SAPVirtualInstance_Get" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + SapVirtualInstanceResource result = await sapVirtualInstance.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 + SapVirtualInstanceData 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_SAPVirtualInstancesDelete() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Delete.json + // this example is just showing the usage of "SAPVirtualInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "6d875e77-e412-4d7d-9af4-8895278b4443"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + await sapVirtualInstance.DeleteAsync(WaitUntil.Completed); + + Console.WriteLine("Succeeded"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SAPVirtualInstancesUpdate() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Update.json + // this example is just showing the usage of "SAPVirtualInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + SapVirtualInstancePatch patch = new SapVirtualInstancePatch + { + Tags = +{ +["key1"] = "svi1" +}, + Identity = new SAPVirtualInstanceIdentity(SAPVirtualInstanceIdentityType.None), + }; + ArmOperation lro = await sapVirtualInstance.UpdateAsync(WaitUntil.Completed, patch); + SapVirtualInstanceResource 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 + SapVirtualInstanceData resourceData = result.Data; + // for demo we just print out the id + Console.WriteLine($"Succeeded on id: {resourceData.Id}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Update_SAPVirtualInstancesTrustedAccessEnableUpdate() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_UpdateTrustedAccess.json + // this example is just showing the usage of "SAPVirtualInstance_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 SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + SapVirtualInstancePatch patch = new SapVirtualInstancePatch + { + Tags = +{ +["key1"] = "svi1" +}, + Identity = new SAPVirtualInstanceIdentity(SAPVirtualInstanceIdentityType.None), + UpdateSapVirtualInstanceManagedResourcesNetworkAccessType = ManagedResourcesNetworkAccessType.Private, + }; + ArmOperation lro = await sapVirtualInstance.UpdateAsync(WaitUntil.Completed, patch); + SapVirtualInstanceResource 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 + SapVirtualInstanceData 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 Start_SAPVirtualInstancesStart() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Start.json + // this example is just showing the usage of "SAPVirtualInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent + { + StartVm = true, + }; + ArmOperation lro = await sapVirtualInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Start_SAPVirtualInstancesStartWithInfraOperations() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_StartWithInfraOperations.json + // this example is just showing the usage of "SAPVirtualInstances_Start" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + StartContent content = new StartContent + { + StartVm = true, + }; + ArmOperation lro = await sapVirtualInstance.StartAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SoftStopOfSapVirtualInstancesStop() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_SoftStop.json + // this example is just showing the usage of "SAPVirtualInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 300L, + }; + ArmOperation lro = await sapVirtualInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SoftStopTheVirtualMachineSAndTheSAPSystemOnIt() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_SoftStopVMAndSystem.json + // this example is just showing the usage of "SAPVirtualInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 300L, + DeallocateVm = true, + }; + ArmOperation lro = await sapVirtualInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_SAPVirtualInstancesStop() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_Stop.json + // this example is just showing the usage of "SAPVirtualInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 0L, + }; + ArmOperation lro = await sapVirtualInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task Stop_StopTheVirtualMachineSAndTheSAPSystemOnIt() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_StopVMAndSystem.json + // this example is just showing the usage of "SAPVirtualInstances_Stop" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/sdk/authentication?tabs=command-line + TokenCredential cred = new DefaultAzureCredential(); + // authenticate your client + ArmClient client = new ArmClient(cred); + + // this example assumes you already have this SapVirtualInstanceResource created on azure + // for more information of creating SapVirtualInstanceResource, please refer to the document of SapVirtualInstanceResource + string subscriptionId = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + string resourceGroupName = "test-rg"; + string sapVirtualInstanceName = "X00"; + ResourceIdentifier sapVirtualInstanceResourceId = SapVirtualInstanceResource.CreateResourceIdentifier(subscriptionId, resourceGroupName, sapVirtualInstanceName); + SapVirtualInstanceResource sapVirtualInstance = client.GetSapVirtualInstanceResource(sapVirtualInstanceResourceId); + + // invoke the operation + StopContent content = new StopContent + { + SoftStopTimeoutSeconds = 0L, + DeallocateVm = true, + }; + ArmOperation lro = await sapVirtualInstance.StopAsync(WaitUntil.Completed, content: content); + OperationStatusResult result = lro.Value; + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs new file mode 100644 index 000000000000..69c4c67630cd --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/samples/Generated/Samples/Sample_SubscriptionResourceExtensions.cs @@ -0,0 +1,423 @@ +// 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 Azure.ResourceManager.SapVirtualInstances.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.SapVirtualInstances.Samples +{ + public partial class Sample_SubscriptionResourceExtensions + { + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSapVirtualInstances_SAPVirtualInstancesListBySubscription() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_ListBySubscription.json + // this example is just showing the usage of "SAPVirtualInstance_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 = "6d875e77-e412-4d7d-9af4-8895278b4443"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation and iterate over the result + await foreach (SapVirtualInstanceResource item in subscriptionResource.GetSapVirtualInstancesAsync()) + { + // 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 + SapVirtualInstanceData 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 GetSizingRecommendationsSapVirtualInstance_SAPSizingRecommendationsForNonHADistributedSystem() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSizingRecommendations_S4HANA_Distributed.json + // this example is just showing the usage of "SAPVirtualInstances_GetSizingRecommendations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSizingRecommendationContent content = new SapSizingRecommendationContent( + "eastus", + SapEnvironmentType.Prod, + SapProductType.S4HANA, + SapDeploymentType.ThreeTier, + 20000L, + 1024L, + SapDatabaseType.HANA) + { + DbScaleMethod = SapDatabaseScaleMethod.ScaleUp, + }; + SapSizingRecommendationResult result = await subscriptionResource.GetSizingRecommendationsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSizingRecommendationsSapVirtualInstance_SAPSizingRecommendationsForHAWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSizingRecommendations_S4HANA_HA_AvSet.json + // this example is just showing the usage of "SAPVirtualInstances_GetSizingRecommendations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSizingRecommendationContent content = new SapSizingRecommendationContent( + "eastus", + SapEnvironmentType.Prod, + SapProductType.S4HANA, + SapDeploymentType.ThreeTier, + 75000L, + 1024L, + SapDatabaseType.HANA) + { + DbScaleMethod = SapDatabaseScaleMethod.ScaleUp, + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + }; + SapSizingRecommendationResult result = await subscriptionResource.GetSizingRecommendationsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSizingRecommendationsSapVirtualInstance_SAPSizingRecommendationsForHAWithAvailabilityZone() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSizingRecommendations_S4HANA_HA_AvZone.json + // this example is just showing the usage of "SAPVirtualInstances_GetSizingRecommendations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSizingRecommendationContent content = new SapSizingRecommendationContent( + "eastus", + SapEnvironmentType.Prod, + SapProductType.S4HANA, + SapDeploymentType.ThreeTier, + 75000L, + 1024L, + SapDatabaseType.HANA) + { + DbScaleMethod = SapDatabaseScaleMethod.ScaleUp, + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }; + SapSizingRecommendationResult result = await subscriptionResource.GetSizingRecommendationsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSizingRecommendationsSapVirtualInstance_SAPSizingRecommendationsForSingleServer() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSizingRecommendations_S4HANA_SingleServer.json + // this example is just showing the usage of "SAPVirtualInstances_GetSizingRecommendations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSizingRecommendationContent content = new SapSizingRecommendationContent( + "eastus", + SapEnvironmentType.NonProd, + SapProductType.S4HANA, + SapDeploymentType.SingleServer, + 60000L, + 2000L, + SapDatabaseType.HANA) + { + DbScaleMethod = SapDatabaseScaleMethod.ScaleUp, + }; + SapSizingRecommendationResult result = await subscriptionResource.GetSizingRecommendationsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSapSupportedSkuSapVirtualInstance_SAPSupportedSKUsForDistributedNonHAEnvironment() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSapSupportedSku_Distributed.json + // this example is just showing the usage of "SAPVirtualInstances_GetSapSupportedSku" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSupportedSkusContent content = new SapSupportedSkusContent("eastus", SapEnvironmentType.Prod, SapProductType.S4HANA, SapDeploymentType.ThreeTier, SapDatabaseType.HANA); + SapSupportedResourceSkusResult result = await subscriptionResource.GetSapSupportedSkuSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSapSupportedSkuSapVirtualInstance_SAPSupportedSKUsForDistributedHAEnvironmentWithAvailabilitySet() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSapSupportedSku_DistributedHA_AvSet.json + // this example is just showing the usage of "SAPVirtualInstances_GetSapSupportedSku" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSupportedSkusContent content = new SapSupportedSkusContent("eastus", SapEnvironmentType.Prod, SapProductType.S4HANA, SapDeploymentType.ThreeTier, SapDatabaseType.HANA) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilitySet, + }; + SapSupportedResourceSkusResult result = await subscriptionResource.GetSapSupportedSkuSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSapSupportedSkuSapVirtualInstance_SAPSupportedSkusForHAWithAvailabilityZone() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSapSupportedSku_DistributedHA_AvZone.json + // this example is just showing the usage of "SAPVirtualInstances_GetSapSupportedSku" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSupportedSkusContent content = new SapSupportedSkusContent("eastus", SapEnvironmentType.Prod, SapProductType.S4HANA, SapDeploymentType.ThreeTier, SapDatabaseType.HANA) + { + HighAvailabilityType = SapHighAvailabilityType.AvailabilityZone, + }; + SapSupportedResourceSkusResult result = await subscriptionResource.GetSapSupportedSkuSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetSapSupportedSkuSapVirtualInstance_SAPSupportedSKUsForSingleServer() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeSapSupportedSku_SingleServer.json + // this example is just showing the usage of "SAPVirtualInstances_GetSapSupportedSku" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapSupportedSkusContent content = new SapSupportedSkusContent("eastus", SapEnvironmentType.NonProd, SapProductType.S4HANA, SapDeploymentType.SingleServer, SapDatabaseType.HANA); + SapSupportedResourceSkusResult result = await subscriptionResource.GetSapSupportedSkuSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetDiskConfigurationsSapVirtualInstance_SAPDiskConfigurationsForInputEnvironmentNonProd() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeDiskConfigurations_NonProd.json + // this example is just showing the usage of "SAPVirtualInstances_GetDiskConfigurations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapDiskConfigurationsContent content = new SapDiskConfigurationsContent( + "eastus", + SapEnvironmentType.NonProd, + SapProductType.S4HANA, + SapDatabaseType.HANA, + SapDeploymentType.ThreeTier, + "Standard_M32ts"); + SapDiskConfigurationsResult result = await subscriptionResource.GetDiskConfigurationsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetDiskConfigurationsSapVirtualInstance_SAPDiskConfigurationsForInputEnvironmentProd() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeDiskConfigurations_Prod.json + // this example is just showing the usage of "SAPVirtualInstances_GetDiskConfigurations" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("centralus"); + SapDiskConfigurationsContent content = new SapDiskConfigurationsContent( + "eastus", + SapEnvironmentType.Prod, + SapProductType.S4HANA, + SapDatabaseType.HANA, + SapDeploymentType.ThreeTier, + "Standard_M32ts"); + SapDiskConfigurationsResult result = await subscriptionResource.GetDiskConfigurationsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAvailabilityZoneDetailsSapVirtualInstance_SAPAvailabilityZoneDetailsInEastUs() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeAvailabilityZoneDetails_eastus.json + // this example is just showing the usage of "SAPVirtualInstances_GetAvailabilityZoneDetails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("eastus"); + SapAvailabilityZoneDetailsContent content = new SapAvailabilityZoneDetailsContent("eastus", SapProductType.S4HANA, SapDatabaseType.HANA); + SapAvailabilityZoneDetailsResult result = await subscriptionResource.GetAvailabilityZoneDetailsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + + [Test] + [Ignore("Only validating compilation of examples")] + public async Task GetAvailabilityZoneDetailsSapVirtualInstance_SAPAvailabilityZoneDetailsInNorthEurope() + { + // Generated from example definition: 2024-09-01/SapVirtualInstances_InvokeAvailabilityZoneDetails_northeurope.json + // this example is just showing the usage of "SAPVirtualInstances_GetAvailabilityZoneDetails" operation, for the dependent resources, they will have to be created separately. + + // get your azure access token, for more details of how Azure SDK get your access token, please refer to https://learn.microsoft.com/en-us/dotnet/azure/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 = "8e17e36c-42e9-4cd5-a078-7b44883414e0"; + ResourceIdentifier subscriptionResourceId = SubscriptionResource.CreateResourceIdentifier(subscriptionId); + SubscriptionResource subscriptionResource = client.GetSubscriptionResource(subscriptionResourceId); + + // invoke the operation + AzureLocation location = new AzureLocation("northeurope"); + SapAvailabilityZoneDetailsContent content = new SapAvailabilityZoneDetailsContent("northeurope", SapProductType.S4HANA, SapDatabaseType.HANA); + SapAvailabilityZoneDetailsResult result = await subscriptionResource.GetAvailabilityZoneDetailsSapVirtualInstanceAsync(location, content); + + Console.WriteLine($"Succeeded: {result}"); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Azure.ResourceManager.SapVirtualInstances.csproj b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Azure.ResourceManager.SapVirtualInstances.csproj new file mode 100644 index 000000000000..03db45f9d8cf --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Azure.ResourceManager.SapVirtualInstances.csproj @@ -0,0 +1,8 @@ + + + Azure Resource Manager client SDK for Azure resource provider SapVirtualInstances. + 1.0.0-beta.1 + azure;management;arm;resource manager;sapvirtualinstances + Azure.ResourceManager.SapVirtualInstances + + diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/ArmSapVirtualInstancesModelFactory.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/ArmSapVirtualInstancesModelFactory.cs new file mode 100644 index 000000000000..8a0b50590953 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/ArmSapVirtualInstancesModelFactory.cs @@ -0,0 +1,565 @@ +// 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.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Model factory for models. + public static partial class ArmSapVirtualInstancesModelFactory + { + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. + /// A new instance for mocking. + public static SapVirtualInstanceData SapVirtualInstanceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SapVirtualInstanceProperties properties = null, SAPVirtualInstanceIdentity identity = null) + { + tags ??= new Dictionary(); + + return new SapVirtualInstanceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + identity, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the managed resource group storage account. This setting is currently applicable only to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + /// + /// Defines if the SAP system is being created using Azure Center for SAP solutions (ACSS) or if an existing SAP system is being registered with ACSS + /// 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 . + /// + /// Managed resource group configuration. + /// Defines the SAP Instance status. + /// Defines the health of SAP Instances. + /// Defines the Virtual Instance for SAP state. + /// Defines the provisioning states. + /// Indicates any errors on the Virtual Instance for SAP solutions resource. + /// A new instance for mocking. + public static SapVirtualInstanceProperties SapVirtualInstanceProperties(SapEnvironmentType environment = default, SapProductType sapProduct = default, ManagedResourcesNetworkAccessType? managedResourcesNetworkAccessType = null, SapConfiguration configuration = null, string managedResourceGroupName = null, SapVirtualInstanceStatus? status = null, SapHealthState? health = null, SapVirtualInstanceState? state = null, SapVirtualInstanceProvisioningState? provisioningState = null, ErrorInformation errorsProperties = null) + { + return new SapVirtualInstanceProperties( + environment, + sapProduct, + managedResourcesNetworkAccessType, + configuration, + managedResourceGroupName != null ? new ManagedRGConfiguration(managedResourceGroupName, serializedAdditionalRawData: null) : null, + status, + health, + state, + provisioningState, + errorsProperties != null ? new SapVirtualInstanceError(errorsProperties, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The virtual machine ID of the Central Server. + /// The custom storage account name for the storage account created by the service in the managed resource group created as part of VIS deployment.<br><br>Refer to the storage account naming rules [here](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage).<br><br>If not provided, the service will create the storage account with a random name. + /// The geo-location where the SAP system exists. + /// A new instance for mocking. + public static DiscoveryConfiguration DiscoveryConfiguration(string centralServerVmId = null, string managedRgStorageAccountName = null, string appLocation = null) + { + return new DiscoveryConfiguration(SapConfigurationType.Discovery, serializedAdditionalRawData: null, centralServerVmId, managedRgStorageAccountName, appLocation); + } + + /// Initializes a new instance of . + /// Service specific error code which serves as the substatus for the HTTP error code. + /// Description of the error. + /// Internal error details. + /// A new instance for mocking. + public static ErrorInformation ErrorInformation(string code = null, string message = null, IEnumerable details = null) + { + details ??= new List(); + + return new ErrorInformation(code, message, details?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Fully qualified ID for the async operation. + /// Name of the async operation. + /// Operation status. + /// Percent of the operation that is complete. + /// The start time of the operation. + /// The end time of the operation. + /// The operations list. + /// If present, details of the operation error. + /// Fully qualified ID of the resource against which the original async operation was started. + /// A new instance for mocking. + public static OperationStatusResult OperationStatusResult(ResourceIdentifier id = null, string name = null, string status = null, double? percentComplete = null, DateTimeOffset? startOn = null, DateTimeOffset? endOn = null, IEnumerable operations = null, ResponseError error = null, string resourceId = null) + { + operations ??= new List(); + + return new OperationStatusResult( + id, + name, + status, + percentComplete, + startOn, + endOn, + operations?.ToList(), + error, + resourceId, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The geo-location where the resource is to be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The SAP Application Performance Standard measurement. + /// The database memory configuration. + /// The database type. + /// The DB scale method. + /// The high availability type. + /// A new instance for mocking. + public static SapSizingRecommendationContent SapSizingRecommendationContent(string appLocation = null, SapEnvironmentType environment = default, SapProductType sapProduct = default, SapDeploymentType deploymentType = default, long saps = default, long dbMemory = default, SapDatabaseType databaseType = default, SapDatabaseScaleMethod? dbScaleMethod = null, SapHighAvailabilityType? highAvailabilityType = null) + { + return new SapSizingRecommendationContent( + appLocation, + environment, + sapProduct, + deploymentType, + saps, + dbMemory, + databaseType, + dbScaleMethod, + highAvailabilityType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The recommended VM SKU for single server. + /// A new instance for mocking. + public static SingleServerRecommendationResult SingleServerRecommendationResult(string vmSku = null) + { + return new SingleServerRecommendationResult(SapDeploymentType.SingleServer, serializedAdditionalRawData: null, vmSku); + } + + /// Initializes a new instance of . + /// The database VM SKU. + /// The database server instance count. + /// The central server VM SKU. + /// The central server instance count. + /// The application server VM SKU. + /// The application server instance count. + /// A new instance for mocking. + public static ThreeTierRecommendationResult ThreeTierRecommendationResult(string dbVmSku = null, long? databaseInstanceCount = null, string centralServerVmSku = null, long? centralServerInstanceCount = null, string applicationServerVmSku = null, long? applicationServerInstanceCount = null) + { + return new ThreeTierRecommendationResult( + SapDeploymentType.ThreeTier, + serializedAdditionalRawData: null, + dbVmSku, + databaseInstanceCount, + centralServerVmSku, + centralServerInstanceCount, + applicationServerVmSku, + applicationServerInstanceCount); + } + + /// Initializes a new instance of . + /// The geo-location where the resource is to be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The database type. Eg: HANA, DB2, etc. + /// The high availability type. + /// A new instance for mocking. + public static SapSupportedSkusContent SapSupportedSkusContent(string appLocation = null, SapEnvironmentType environment = default, SapProductType sapProduct = default, SapDeploymentType deploymentType = default, SapDatabaseType databaseType = default, SapHighAvailabilityType? highAvailabilityType = null) + { + return new SapSupportedSkusContent( + appLocation, + environment, + sapProduct, + deploymentType, + databaseType, + highAvailabilityType, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the list of SAP supported SKUs. + /// A new instance for mocking. + public static SapSupportedResourceSkusResult SapSupportedResourceSkusResult(IEnumerable supportedSkus = null) + { + supportedSkus ??= new List(); + + return new SapSupportedResourceSkusResult(supportedSkus?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The VM Sku. + /// True if the Sku is certified for App server in the SAP system. + /// True if the Sku is certified for Database server in the SAP system. + /// A new instance for mocking. + public static SapSupportedSku SapSupportedSku(string vmSku = null, bool? isAppServerCertified = null, bool? isDatabaseCertified = null) + { + return new SapSupportedSku(vmSku, isAppServerCertified, isDatabaseCertified, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + /// A new instance for mocking. + public static SapDiskConfigurationsResult SapDiskConfigurationsResult(IReadOnlyDictionary volumeConfigurations = null) + { + volumeConfigurations ??= new Dictionary(); + + return new SapDiskConfigurationsResult(volumeConfigurations, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The recommended disk details for a given VM Sku. + /// The list of supported disks for a given VM Sku. + /// A new instance for mocking. + public static SapDiskConfiguration SapDiskConfiguration(DiskVolumeConfiguration recommendedConfiguration = null, IEnumerable supportedConfigurations = null) + { + supportedConfigurations ??= new List(); + + return new SapDiskConfiguration(recommendedConfiguration, supportedConfigurations?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. + /// The disk size in GB. + /// The minimum supported disk count. + /// The maximum supported disk count. + /// The disk Iops. + /// The disk provisioned throughput in MBps. + /// The disk tier, e.g. P10, E10. + /// A new instance for mocking. + public static DiskDetails DiskDetails(DiskSkuName? skuName = null, long? sizeGB = null, long? minimumSupportedDiskCount = null, long? maximumSupportedDiskCount = null, long? iopsReadWrite = null, long? mbpsReadWrite = null, string diskTier = null) + { + return new DiskDetails( + skuName != null ? new DiskSku(skuName, serializedAdditionalRawData: null) : null, + sizeGB, + minimumSupportedDiskCount, + maximumSupportedDiskCount, + iopsReadWrite, + mbpsReadWrite, + diskTier, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gets the list of availability zone pairs. + /// A new instance for mocking. + public static SapAvailabilityZoneDetailsResult SapAvailabilityZoneDetailsResult(IEnumerable availabilityZonePairs = null) + { + availabilityZonePairs ??= new List(); + + return new SapAvailabilityZoneDetailsResult(availabilityZonePairs?.ToList(), serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The zone A. + /// The zone B. + /// A new instance for mocking. + public static SapAvailabilityZonePair SapAvailabilityZonePair(long? zoneA = null, long? zoneB = null) + { + return new SapAvailabilityZonePair(zoneA, zoneB, 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 SapCentralServerInstanceData SapCentralServerInstanceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SapCentralServerProperties properties = null) + { + tags ??= new Dictionary(); + + return new SapCentralServerInstanceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The central services instance number. + /// The central services instance subnet. + /// Defines the SAP message server properties. + /// Defines the SAP Enqueue Server properties. + /// Defines the SAP Gateway Server properties. + /// Defines the SAP Enqueue Replication Server (ERS) properties. + /// The central services instance Kernel Version. + /// The central services instance Kernel Patch level. + /// The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual Machines. + /// The list of virtual machines corresponding to the Central Services instance. + /// Defines the SAP Instance status. + /// Defines the health of SAP Instances. + /// Defines the provisioning states. + /// Defines the errors related to SAP Central Services Instance resource. + /// A new instance for mocking. + public static SapCentralServerProperties SapCentralServerProperties(string instanceNo = null, string subnet = null, MessageServerProperties messageServerProperties = null, EnqueueServerProperties enqueueServerProperties = null, GatewayServerProperties gatewayServerProperties = null, EnqueueReplicationServerProperties enqueueReplicationServerProperties = null, string kernelVersion = null, string kernelPatch = null, ResourceIdentifier loadBalancerDetailsId = null, IEnumerable vmDetails = null, SapVirtualInstanceStatus? status = null, SapHealthState? health = null, SapVirtualInstanceProvisioningState? provisioningState = null, ErrorInformation errorsProperties = null) + { + vmDetails ??= new List(); + + return new SapCentralServerProperties( + instanceNo, + subnet, + messageServerProperties, + enqueueServerProperties, + gatewayServerProperties, + enqueueReplicationServerProperties, + kernelVersion, + kernelPatch, + loadBalancerDetailsId != null ? ResourceManagerModelFactory.SubResource(loadBalancerDetailsId) : null, + vmDetails?.ToList(), + status, + health, + provisioningState, + errorsProperties != null ? new SapVirtualInstanceError(errorsProperties, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// message server port. + /// message server internal MS port. + /// message server HTTP Port. + /// message server HTTPS Port. + /// message server SAP Hostname. + /// message server IP Address. + /// Defines the health of SAP Instances. + /// A new instance for mocking. + public static MessageServerProperties MessageServerProperties(long? msPort = null, long? internalMsPort = null, long? httpPort = null, long? httpsPort = null, string hostname = null, string ipAddress = null, SapHealthState? health = null) + { + return new MessageServerProperties( + msPort, + internalMsPort, + httpPort, + httpsPort, + hostname, + ipAddress, + health, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Enqueue Server SAP Hostname. + /// Enqueue Server SAP IP Address. + /// Enqueue Server Port. + /// Defines the health of SAP Instances. + /// A new instance for mocking. + public static EnqueueServerProperties EnqueueServerProperties(string hostname = null, string ipAddress = null, long? port = null, SapHealthState? health = null) + { + return new EnqueueServerProperties(hostname, ipAddress, port, health, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Gateway Port. + /// Defines the health of SAP Instances. + /// A new instance for mocking. + public static GatewayServerProperties GatewayServerProperties(long? port = null, SapHealthState? health = null) + { + return new GatewayServerProperties(port, health, serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Defines the type of Enqueue Replication Server. + /// ERS Instance Number. + /// ERS SAP Hostname. + /// ERS SAP Kernel Version. + /// ERS SAP Kernel Patch level. + /// ERS SAP IP Address. + /// Defines the health of SAP Instances. + /// A new instance for mocking. + public static EnqueueReplicationServerProperties EnqueueReplicationServerProperties(EnqueueReplicationServerType? ersVersion = null, string instanceNo = null, string hostname = null, string kernelVersion = null, string kernelPatch = null, string ipAddress = null, SapHealthState? health = null) + { + return new EnqueueReplicationServerProperties( + ersVersion, + instanceNo, + hostname, + kernelVersion, + kernelPatch, + ipAddress, + health, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Defines the type of central server VM. + /// The virtual machine id. + /// Storage details of all the Storage Accounts attached to the ASCS Virtual Machine. For e.g. NFS on AFS Shared Storage. + /// A new instance for mocking. + public static CentralServerVmDetails CentralServerVmDetails(CentralServerVirtualMachineType? type = null, string virtualMachineId = null, IEnumerable storageDetails = null) + { + storageDetails ??= new List(); + + return new CentralServerVmDetails(type, virtualMachineId, storageDetails?.ToList(), 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 SapDatabaseInstanceData SapDatabaseInstanceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SapDatabaseProperties properties = null) + { + tags ??= new Dictionary(); + + return new SapDatabaseInstanceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Database subnet. + /// Database SID name. + /// Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL Server. + /// Database IP Address. + /// The Load Balancer details such as LoadBalancer ID attached to Database Virtual Machines. + /// The list of virtual machines corresponding to the Database resource. + /// Defines the SAP Instance status. + /// Defines the provisioning states. + /// Defines the errors related to Database resource. + /// A new instance for mocking. + public static SapDatabaseProperties SapDatabaseProperties(string subnet = null, string databaseSid = null, string databaseType = null, string ipAddress = null, ResourceIdentifier loadBalancerDetailsId = null, IEnumerable vmDetails = null, SapVirtualInstanceStatus? status = null, SapVirtualInstanceProvisioningState? provisioningState = null, ErrorInformation errorsProperties = null) + { + vmDetails ??= new List(); + + return new SapDatabaseProperties( + subnet, + databaseSid, + databaseType, + ipAddress, + loadBalancerDetailsId != null ? ResourceManagerModelFactory.SubResource(loadBalancerDetailsId) : null, + vmDetails?.ToList(), + status, + provisioningState, + errorsProperties != null ? new SapVirtualInstanceError(errorsProperties, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// The virtual machine id. + /// Defines the SAP Instance status. + /// Storage details of all the Storage Accounts attached to the Database Virtual Machine. For e.g. NFS on AFS Shared Storage. + /// A new instance for mocking. + public static DatabaseVmDetails DatabaseVmDetails(string virtualMachineId = null, SapVirtualInstanceStatus? status = null, IEnumerable storageDetails = null) + { + storageDetails ??= new List(); + + return new DatabaseVmDetails(virtualMachineId, status, storageDetails?.ToList(), 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 SapApplicationServerInstanceData SapApplicationServerInstanceData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, SapApplicationServerProperties properties = null) + { + tags ??= new Dictionary(); + + return new SapApplicationServerInstanceData( + id, + name, + resourceType, + systemData, + tags, + location, + properties, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Application server Instance Number. + /// Application server Subnet. + /// Application server instance SAP hostname. + /// Application server instance SAP Kernel Version. + /// Application server instance SAP Kernel Patch level. + /// Application server instance SAP IP Address. + /// Application server instance gateway Port. + /// Application server instance ICM HTTP Port. + /// Application server instance ICM HTTPS Port. + /// Application server instance dispatcher status. + /// The Load Balancer details such as LoadBalancer ID attached to Application Server Virtual Machines. + /// The list of virtual machines. + /// Defines the SAP Instance status. + /// Defines the health of SAP Instances. + /// Defines the provisioning states. + /// Defines the Application Instance errors. + /// A new instance for mocking. + public static SapApplicationServerProperties SapApplicationServerProperties(string instanceNo = null, string subnet = null, string hostname = null, string kernelVersion = null, string kernelPatch = null, string ipAddress = null, long? gatewayPort = null, long? icmHttpPort = null, long? icmHttpsPort = null, string dispatcherStatus = null, ResourceIdentifier loadBalancerDetailsId = null, IEnumerable vmDetails = null, SapVirtualInstanceStatus? status = null, SapHealthState? health = null, SapVirtualInstanceProvisioningState? provisioningState = null, ErrorInformation errorsProperties = null) + { + vmDetails ??= new List(); + + return new SapApplicationServerProperties( + instanceNo, + subnet, + hostname, + kernelVersion, + kernelPatch, + ipAddress, + gatewayPort, + icmHttpPort, + icmHttpsPort, + dispatcherStatus, + loadBalancerDetailsId != null ? ResourceManagerModelFactory.SubResource(loadBalancerDetailsId) : null, + vmDetails?.ToList(), + status, + health, + provisioningState, + errorsProperties != null ? new SapVirtualInstanceError(errorsProperties, serializedAdditionalRawData: null) : null, + serializedAdditionalRawData: null); + } + + /// Initializes a new instance of . + /// Defines the type of application server VM. + /// The virtual machine id. + /// Storage details of all the Storage Accounts attached to the App Virtual Machine. For e.g. NFS on AFS Shared Storage. + /// A new instance for mocking. + public static ApplicationServerVmDetails ApplicationServerVmDetails(ApplicationServerVirtualMachineType? type = null, string virtualMachineId = null, IEnumerable storageDetails = null) + { + storageDetails ??= new List(); + + return new ApplicationServerVmDetails(type, virtualMachineId, storageDetails?.ToList(), serializedAdditionalRawData: null); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesArmClient.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesArmClient.cs new file mode 100644 index 000000000000..aad5abbcbc9e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesArmClient.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Mocking +{ + /// A class to add extension methods to ArmClient. + public partial class MockableSapVirtualInstancesArmClient : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableSapVirtualInstancesArmClient() + { + } + + /// 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 MockableSapVirtualInstancesArmClient(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + internal MockableSapVirtualInstancesArmClient(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 SapVirtualInstanceResource GetSapVirtualInstanceResource(ResourceIdentifier id) + { + SapVirtualInstanceResource.ValidateResourceId(id); + return new SapVirtualInstanceResource(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 SapCentralServerInstanceResource GetSapCentralServerInstanceResource(ResourceIdentifier id) + { + SapCentralServerInstanceResource.ValidateResourceId(id); + return new SapCentralServerInstanceResource(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 SapDatabaseInstanceResource GetSapDatabaseInstanceResource(ResourceIdentifier id) + { + SapDatabaseInstanceResource.ValidateResourceId(id); + return new SapDatabaseInstanceResource(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 SapApplicationServerInstanceResource GetSapApplicationServerInstanceResource(ResourceIdentifier id) + { + SapApplicationServerInstanceResource.ValidateResourceId(id); + return new SapApplicationServerInstanceResource(Client, id); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesResourceGroupResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesResourceGroupResource.cs new file mode 100644 index 000000000000..ca026e2cf97d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesResourceGroupResource.cs @@ -0,0 +1,105 @@ +// 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.SapVirtualInstances.Mocking +{ + /// A class to add extension methods to ResourceGroupResource. + public partial class MockableSapVirtualInstancesResourceGroupResource : ArmResource + { + /// Initializes a new instance of the class for mocking. + protected MockableSapVirtualInstancesResourceGroupResource() + { + } + + /// 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 MockableSapVirtualInstancesResourceGroupResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// Gets a collection of SapVirtualInstanceResources in the ResourceGroupResource. + /// An object representing collection of SapVirtualInstanceResources and their operations over a SapVirtualInstanceResource. + public virtual SapVirtualInstanceCollection GetSapVirtualInstances() + { + return GetCachedClient(client => new SapVirtualInstanceCollection(client, Id)); + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSapVirtualInstanceAsync(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + return await GetSapVirtualInstances().GetAsync(sapVirtualInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSapVirtualInstance(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + return GetSapVirtualInstances().Get(sapVirtualInstanceName, cancellationToken); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesSubscriptionResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesSubscriptionResource.cs new file mode 100644 index 000000000000..e11cf5279920 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/MockableSapVirtualInstancesSubscriptionResource.cs @@ -0,0 +1,449 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Threading; +using System.Threading.Tasks; +using Autorest.CSharp.Core; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Mocking +{ + /// A class to add extension methods to SubscriptionResource. + public partial class MockableSapVirtualInstancesSubscriptionResource : ArmResource + { + private ClientDiagnostics _sapVirtualInstanceClientDiagnostics; + private SapVirtualInstancesRestOperations _sapVirtualInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected MockableSapVirtualInstancesSubscriptionResource() + { + } + + /// 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 MockableSapVirtualInstancesSubscriptionResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + } + + private ClientDiagnostics SapVirtualInstanceClientDiagnostics => _sapVirtualInstanceClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", SapVirtualInstanceResource.ResourceType.Namespace, Diagnostics); + private SapVirtualInstancesRestOperations SapVirtualInstanceRestClient => _sapVirtualInstanceRestClient ??= new SapVirtualInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(SapVirtualInstanceResource.ResourceType)); + + private string GetApiVersionOrNull(ResourceType resourceType) + { + TryGetApiVersion(resourceType, out string apiVersion); + return apiVersion; + } + + /// + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/sapVirtualInstances + /// + /// + /// Operation Id + /// SAPVirtualInstance_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetSapVirtualInstancesAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => SapVirtualInstanceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SapVirtualInstanceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapVirtualInstanceResource(Client, SapVirtualInstanceData.DeserializeSapVirtualInstanceData(e)), SapVirtualInstanceClientDiagnostics, Pipeline, "MockableSapVirtualInstancesSubscriptionResource.GetSapVirtualInstances", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/sapVirtualInstances + /// + /// + /// Operation Id + /// SAPVirtualInstance_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetSapVirtualInstances(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => SapVirtualInstanceRestClient.CreateListBySubscriptionRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => SapVirtualInstanceRestClient.CreateListBySubscriptionNextPageRequest(nextLink, Id.SubscriptionId); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapVirtualInstanceResource(Client, SapVirtualInstanceData.DeserializeSapVirtualInstanceData(e)), SapVirtualInstanceClientDiagnostics, Pipeline, "MockableSapVirtualInstancesSubscriptionResource.GetSapVirtualInstances", "value", "nextLink", cancellationToken); + } + + /// + /// Gets the sizing recommendations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSizingRecommendations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetSizingRecommendationsSapVirtualInstanceAsync(AzureLocation location, SapSizingRecommendationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetSizingRecommendationsSapVirtualInstance"); + scope.Start(); + try + { + var response = await SapVirtualInstanceRestClient.GetSizingRecommendationsAsync(Id.SubscriptionId, location, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the sizing recommendations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSizingRecommendations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual Response GetSizingRecommendationsSapVirtualInstance(AzureLocation location, SapSizingRecommendationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetSizingRecommendationsSapVirtualInstance"); + scope.Start(); + try + { + var response = SapVirtualInstanceRestClient.GetSizingRecommendations(Id.SubscriptionId, location, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a list of SAP supported SKUs for ASCS, Application and Database tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSapSupportedSku + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSapSupportedSku + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetSapSupportedSkuSapVirtualInstanceAsync(AzureLocation location, SapSupportedSkusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetSapSupportedSkuSapVirtualInstance"); + scope.Start(); + try + { + var response = await SapVirtualInstanceRestClient.GetSapSupportedSkuAsync(Id.SubscriptionId, location, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get a list of SAP supported SKUs for ASCS, Application and Database tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSapSupportedSku + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSapSupportedSku + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual Response GetSapSupportedSkuSapVirtualInstance(AzureLocation location, SapSupportedSkusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetSapSupportedSkuSapVirtualInstance"); + scope.Start(); + try + { + var response = SapVirtualInstanceRestClient.GetSapSupportedSku(Id.SubscriptionId, location, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the SAP Disk Configuration Layout prod/non-prod SAP System. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getDiskConfigurations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetDiskConfigurations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetDiskConfigurationsSapVirtualInstanceAsync(AzureLocation location, SapDiskConfigurationsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetDiskConfigurationsSapVirtualInstance"); + scope.Start(); + try + { + var response = await SapVirtualInstanceRestClient.GetDiskConfigurationsAsync(Id.SubscriptionId, location, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the SAP Disk Configuration Layout prod/non-prod SAP System. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getDiskConfigurations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetDiskConfigurations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual Response GetDiskConfigurationsSapVirtualInstance(AzureLocation location, SapDiskConfigurationsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetDiskConfigurationsSapVirtualInstance"); + scope.Start(); + try + { + var response = SapVirtualInstanceRestClient.GetDiskConfigurations(Id.SubscriptionId, location, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the recommended SAP Availability Zone Pair Details for your region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetAvailabilityZoneDetails + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual async Task> GetAvailabilityZoneDetailsSapVirtualInstanceAsync(AzureLocation location, SapAvailabilityZoneDetailsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetAvailabilityZoneDetailsSapVirtualInstance"); + scope.Start(); + try + { + var response = await SapVirtualInstanceRestClient.GetAvailabilityZoneDetailsAsync(Id.SubscriptionId, location, content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Get the recommended SAP Availability Zone Pair Details for your region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetAvailabilityZoneDetails + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// is null. + public virtual Response GetAvailabilityZoneDetailsSapVirtualInstance(AzureLocation location, SapAvailabilityZoneDetailsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = SapVirtualInstanceClientDiagnostics.CreateScope("MockableSapVirtualInstancesSubscriptionResource.GetAvailabilityZoneDetailsSapVirtualInstance"); + scope.Start(); + try + { + var response = SapVirtualInstanceRestClient.GetAvailabilityZoneDetails(Id.SubscriptionId, location, content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/SapVirtualInstancesExtensions.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/SapVirtualInstancesExtensions.cs new file mode 100644 index 000000000000..4ec5c61ddb30 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Extensions/SapVirtualInstancesExtensions.cs @@ -0,0 +1,573 @@ +// 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.Resources; +using Azure.ResourceManager.SapVirtualInstances.Mocking; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// A class to add extension methods to Azure.ResourceManager.SapVirtualInstances. + public static partial class SapVirtualInstancesExtensions + { + private static MockableSapVirtualInstancesArmClient GetMockableSapVirtualInstancesArmClient(ArmClient client) + { + return client.GetCachedClient(client0 => new MockableSapVirtualInstancesArmClient(client0)); + } + + private static MockableSapVirtualInstancesResourceGroupResource GetMockableSapVirtualInstancesResourceGroupResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableSapVirtualInstancesResourceGroupResource(client, resource.Id)); + } + + private static MockableSapVirtualInstancesSubscriptionResource GetMockableSapVirtualInstancesSubscriptionResource(ArmResource resource) + { + return resource.GetCachedClient(client => new MockableSapVirtualInstancesSubscriptionResource(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 SapVirtualInstanceResource GetSapVirtualInstanceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSapVirtualInstancesArmClient(client).GetSapVirtualInstanceResource(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 SapCentralServerInstanceResource GetSapCentralServerInstanceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSapVirtualInstancesArmClient(client).GetSapCentralServerInstanceResource(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 SapDatabaseInstanceResource GetSapDatabaseInstanceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSapVirtualInstancesArmClient(client).GetSapDatabaseInstanceResource(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 SapApplicationServerInstanceResource GetSapApplicationServerInstanceResource(this ArmClient client, ResourceIdentifier id) + { + Argument.AssertNotNull(client, nameof(client)); + + return GetMockableSapVirtualInstancesArmClient(client).GetSapApplicationServerInstanceResource(id); + } + + /// + /// Gets a collection of SapVirtualInstanceResources 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 SapVirtualInstanceResources and their operations over a SapVirtualInstanceResource. + public static SapVirtualInstanceCollection GetSapVirtualInstances(this ResourceGroupResource resourceGroupResource) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableSapVirtualInstancesResourceGroupResource(resourceGroupResource).GetSapVirtualInstances(); + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static async Task> GetSapVirtualInstanceAsync(this ResourceGroupResource resourceGroupResource, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return await GetMockableSapVirtualInstancesResourceGroupResource(resourceGroupResource).GetSapVirtualInstanceAsync(sapVirtualInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public static Response GetSapVirtualInstance(this ResourceGroupResource resourceGroupResource, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(resourceGroupResource, nameof(resourceGroupResource)); + + return GetMockableSapVirtualInstancesResourceGroupResource(resourceGroupResource).GetSapVirtualInstance(sapVirtualInstanceName, cancellationToken); + } + + /// + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/sapVirtualInstances + /// + /// + /// Operation Id + /// SAPVirtualInstance_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetSapVirtualInstancesAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetSapVirtualInstancesAsync(cancellationToken); + } + + /// + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/sapVirtualInstances + /// + /// + /// Operation Id + /// SAPVirtualInstance_ListBySubscription + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// is null. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetSapVirtualInstances(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetSapVirtualInstances(cancellationToken); + } + + /// + /// Gets the sizing recommendations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSizingRecommendations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static async Task> GetSizingRecommendationsSapVirtualInstanceAsync(this SubscriptionResource subscriptionResource, AzureLocation location, SapSizingRecommendationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetSizingRecommendationsSapVirtualInstanceAsync(location, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the sizing recommendations. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSizingRecommendations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSizingRecommendations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static Response GetSizingRecommendationsSapVirtualInstance(this SubscriptionResource subscriptionResource, AzureLocation location, SapSizingRecommendationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetSizingRecommendationsSapVirtualInstance(location, content, cancellationToken); + } + + /// + /// Get a list of SAP supported SKUs for ASCS, Application and Database tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSapSupportedSku + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSapSupportedSku + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static async Task> GetSapSupportedSkuSapVirtualInstanceAsync(this SubscriptionResource subscriptionResource, AzureLocation location, SapSupportedSkusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetSapSupportedSkuSapVirtualInstanceAsync(location, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get a list of SAP supported SKUs for ASCS, Application and Database tier. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getSapSupportedSku + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetSapSupportedSku + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static Response GetSapSupportedSkuSapVirtualInstance(this SubscriptionResource subscriptionResource, AzureLocation location, SapSupportedSkusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetSapSupportedSkuSapVirtualInstance(location, content, cancellationToken); + } + + /// + /// Get the SAP Disk Configuration Layout prod/non-prod SAP System. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getDiskConfigurations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetDiskConfigurations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static async Task> GetDiskConfigurationsSapVirtualInstanceAsync(this SubscriptionResource subscriptionResource, AzureLocation location, SapDiskConfigurationsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetDiskConfigurationsSapVirtualInstanceAsync(location, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the SAP Disk Configuration Layout prod/non-prod SAP System. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getDiskConfigurations + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetDiskConfigurations + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static Response GetDiskConfigurationsSapVirtualInstance(this SubscriptionResource subscriptionResource, AzureLocation location, SapDiskConfigurationsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetDiskConfigurationsSapVirtualInstance(location, content, cancellationToken); + } + + /// + /// Get the recommended SAP Availability Zone Pair Details for your region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetAvailabilityZoneDetails + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static async Task> GetAvailabilityZoneDetailsSapVirtualInstanceAsync(this SubscriptionResource subscriptionResource, AzureLocation location, SapAvailabilityZoneDetailsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return await GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetAvailabilityZoneDetailsSapVirtualInstanceAsync(location, content, cancellationToken).ConfigureAwait(false); + } + + /// + /// Get the recommended SAP Availability Zone Pair Details for your region. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.Workloads/locations/{location}/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails + /// + /// + /// Operation Id + /// SAPVirtualInstances_GetAvailabilityZoneDetails + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Mocking + /// To mock this method, please mock instead. + /// + /// + /// The instance the method will execute against. + /// The name of the Azure region. + /// The content of the action request. + /// The cancellation token to use. + /// or is null. + public static Response GetAvailabilityZoneDetailsSapVirtualInstance(this SubscriptionResource subscriptionResource, AzureLocation location, SapAvailabilityZoneDetailsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(subscriptionResource, nameof(subscriptionResource)); + + return GetMockableSapVirtualInstancesSubscriptionResource(subscriptionResource).GetAvailabilityZoneDetailsSapVirtualInstance(location, content, cancellationToken); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Argument.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Argument.cs new file mode 100644 index 000000000000..058a05ba4c78 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/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.SapVirtualInstances +{ + 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ChangeTrackingDictionary.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ChangeTrackingDictionary.cs new file mode 100644 index 000000000000..dd179878f74f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/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.SapVirtualInstances +{ + 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ChangeTrackingList.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ChangeTrackingList.cs new file mode 100644 index 000000000000..7579b8ecf8b4 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/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.SapVirtualInstances +{ + 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ModelSerializationExtensions.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/ModelSerializationExtensions.cs new file mode 100644 index 000000000000..06b96bb6c04f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/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.SapVirtualInstances +{ + 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Optional.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Optional.cs new file mode 100644 index 000000000000..6e81f2408f30 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/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.SapVirtualInstances +{ + 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Utf8JsonRequestContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Internal/Utf8JsonRequestContent.cs new file mode 100644 index 000000000000..041d71542846 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/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.SapVirtualInstances +{ + 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/OperationStatusResultOperationSource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/OperationStatusResultOperationSource.cs new file mode 100644 index 000000000000..80727235dfe5 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/OperationStatusResultOperationSource.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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal class OperationStatusResultOperationSource : IOperationSource + { + OperationStatusResult IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + return OperationStatusResult.DeserializeOperationStatusResult(document.RootElement); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + return OperationStatusResult.DeserializeOperationStatusResult(document.RootElement); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapApplicationServerInstanceOperationSource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapApplicationServerInstanceOperationSource.cs new file mode 100644 index 000000000000..ef9b8e3e6b87 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapApplicationServerInstanceOperationSource.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.SapVirtualInstances +{ + internal class SapApplicationServerInstanceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SapApplicationServerInstanceOperationSource(ArmClient client) + { + _client = client; + } + + SapApplicationServerInstanceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new SapApplicationServerInstanceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new SapApplicationServerInstanceResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapCentralServerInstanceOperationSource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapCentralServerInstanceOperationSource.cs new file mode 100644 index 000000000000..6ba94563a78d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapCentralServerInstanceOperationSource.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.SapVirtualInstances +{ + internal class SapCentralServerInstanceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SapCentralServerInstanceOperationSource(ArmClient client) + { + _client = client; + } + + SapCentralServerInstanceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new SapCentralServerInstanceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new SapCentralServerInstanceResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapDatabaseInstanceOperationSource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapDatabaseInstanceOperationSource.cs new file mode 100644 index 000000000000..f0279d2ad390 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapDatabaseInstanceOperationSource.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.SapVirtualInstances +{ + internal class SapDatabaseInstanceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SapDatabaseInstanceOperationSource(ArmClient client) + { + _client = client; + } + + SapDatabaseInstanceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new SapDatabaseInstanceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new SapDatabaseInstanceResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstanceOperationSource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstanceOperationSource.cs new file mode 100644 index 000000000000..412f26aaf925 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstanceOperationSource.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.SapVirtualInstances +{ + internal class SapVirtualInstanceOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal SapVirtualInstanceOperationSource(ArmClient client) + { + _client = client; + } + + SapVirtualInstanceResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return new SapVirtualInstanceResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + var data = ModelReaderWriter.Read(response.Content); + return await Task.FromResult(new SapVirtualInstanceResource(_client, data)).ConfigureAwait(false); + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperation.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperation.cs new file mode 100644 index 000000000000..36f0f8397130 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperation.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.SapVirtualInstances +{ +#pragma warning disable SA1649 // File name should match first type name + internal class SapVirtualInstancesArmOperation : 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 SapVirtualInstancesArmOperation for mocking. + protected SapVirtualInstancesArmOperation() + { + } + + internal SapVirtualInstancesArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal SapVirtualInstancesArmOperation(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, "SapVirtualInstancesArmOperation", 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperationOfT.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperationOfT.cs new file mode 100644 index 000000000000..ca203c47d1af --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/LongRunningOperation/SapVirtualInstancesArmOperationOfT.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.SapVirtualInstances +{ +#pragma warning disable SA1649 // File name should match first type name + internal class SapVirtualInstancesArmOperation : 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 SapVirtualInstancesArmOperation for mocking. + protected SapVirtualInstancesArmOperation() + { + } + + internal SapVirtualInstancesArmOperation(Response response, RehydrationToken? rehydrationToken = null) + { + _operation = OperationInternal.Succeeded(response.GetRawResponse(), response.Value); + _completeRehydrationToken = rehydrationToken; + _operationId = GetOperationId(rehydrationToken); + } + + internal SapVirtualInstancesArmOperation(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, "SapVirtualInstancesArmOperation", 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.Serialization.cs new file mode 100644 index 000000000000..230c9e837cba --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ApplicationServerConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ApplicationServerConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + writer.WritePropertyName("virtualMachineConfiguration"u8); + writer.WriteObjectValue(VirtualMachineConfiguration, options); + writer.WritePropertyName("instanceCount"u8); + writer.WriteNumberValue(InstanceCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + ApplicationServerConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplicationServerConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplicationServerConfiguration(document.RootElement, options); + } + + internal static ApplicationServerConfiguration DeserializeApplicationServerConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string subnetId = default; + VirtualMachineConfiguration virtualMachineConfiguration = default; + long instanceCount = 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("virtualMachineConfiguration"u8)) + { + virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("instanceCount"u8)) + { + instanceCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApplicationServerConfiguration(subnetId, virtualMachineConfiguration, instanceCount, serializedAdditionalRawData); + } + + BinaryData 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(ApplicationServerConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ApplicationServerConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeApplicationServerConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplicationServerConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.cs new file mode 100644 index 000000000000..f21ab55ca189 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerConfiguration.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; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the application server configuration. + public partial class ApplicationServerConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 subnet id. + /// Gets or sets the virtual machine configuration. + /// The number of app server instances. + /// or is null. + public ApplicationServerConfiguration(string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount) + { + Argument.AssertNotNull(subnetId, nameof(subnetId)); + Argument.AssertNotNull(virtualMachineConfiguration, nameof(virtualMachineConfiguration)); + + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + InstanceCount = instanceCount; + } + + /// Initializes a new instance of . + /// The subnet id. + /// Gets or sets the virtual machine configuration. + /// The number of app server instances. + /// Keeps track of any properties unknown to the library. + internal ApplicationServerConfiguration(string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount, IDictionary serializedAdditionalRawData) + { + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + InstanceCount = instanceCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal ApplicationServerConfiguration() + { + } + + /// The subnet id. + public string SubnetId { get; set; } + /// Gets or sets the virtual machine configuration. + public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } + /// The number of app server instances. + public long InstanceCount { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.Serialization.cs new file mode 100644 index 000000000000..962eccd45a18 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.Serialization.cs @@ -0,0 +1,154 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ApplicationServerFullResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ApplicationServerFullResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(VirtualMachines)) + { + writer.WritePropertyName("virtualMachines"u8); + writer.WriteStartArray(); + foreach (var item in VirtualMachines) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AvailabilitySetName)) + { + writer.WritePropertyName("availabilitySetName"u8); + writer.WriteStringValue(AvailabilitySetName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + ApplicationServerFullResourceNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplicationServerFullResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplicationServerFullResourceNames(document.RootElement, options); + } + + internal static ApplicationServerFullResourceNames DeserializeApplicationServerFullResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList virtualMachines = default; + string availabilitySetName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualMachines"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VirtualMachineResourceNames.DeserializeVirtualMachineResourceNames(item, options)); + } + virtualMachines = array; + continue; + } + if (property.NameEquals("availabilitySetName"u8)) + { + availabilitySetName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApplicationServerFullResourceNames(virtualMachines ?? new ChangeTrackingList(), availabilitySetName, serializedAdditionalRawData); + } + + BinaryData 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(ApplicationServerFullResourceNames)} does not support writing '{options.Format}' format."); + } + } + + ApplicationServerFullResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeApplicationServerFullResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplicationServerFullResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.cs new file mode 100644 index 000000000000..2684ded71ef5 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerFullResourceNames.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.SapVirtualInstances.Models +{ + /// The full resource names object for application layer resources. The number of entries in this list should be equal to the number VMs to be created for application layer. + public partial class ApplicationServerFullResourceNames + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ApplicationServerFullResourceNames() + { + VirtualMachines = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of virtual machine naming details. + /// The full name for availability set. In case name is not provided, it will be defaulted to {SID}-App-AvSet. + /// Keeps track of any properties unknown to the library. + internal ApplicationServerFullResourceNames(IList virtualMachines, string availabilitySetName, IDictionary serializedAdditionalRawData) + { + VirtualMachines = virtualMachines; + AvailabilitySetName = availabilitySetName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of virtual machine naming details. + public IList VirtualMachines { get; } + /// The full name for availability set. In case name is not provided, it will be defaulted to {SID}-App-AvSet. + public string AvailabilitySetName { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVirtualMachineType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVirtualMachineType.cs new file mode 100644 index 000000000000..67767c76873c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVirtualMachineType.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.SapVirtualInstances.Models +{ + /// Defines the type of application server VM. + public readonly partial struct ApplicationServerVirtualMachineType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ApplicationServerVirtualMachineType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ActiveValue = "Active"; + private const string StandbyValue = "Standby"; + private const string UnknownValue = "Unknown"; + + /// Active Application server vm type. + public static ApplicationServerVirtualMachineType Active { get; } = new ApplicationServerVirtualMachineType(ActiveValue); + /// Standby Application server vm type. + public static ApplicationServerVirtualMachineType Standby { get; } = new ApplicationServerVirtualMachineType(StandbyValue); + /// Unknown Application server vm type. + public static ApplicationServerVirtualMachineType Unknown { get; } = new ApplicationServerVirtualMachineType(UnknownValue); + /// Determines if two values are the same. + public static bool operator ==(ApplicationServerVirtualMachineType left, ApplicationServerVirtualMachineType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ApplicationServerVirtualMachineType left, ApplicationServerVirtualMachineType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ApplicationServerVirtualMachineType(string value) => new ApplicationServerVirtualMachineType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ApplicationServerVirtualMachineType other && Equals(other); + /// + public bool Equals(ApplicationServerVirtualMachineType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.Serialization.cs new file mode 100644 index 000000000000..70852bf29f4f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ApplicationServerVmDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ApplicationServerVmDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(VirtualMachineId)) + { + writer.WritePropertyName("virtualMachineId"u8); + writer.WriteStringValue(VirtualMachineId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(StorageDetails)) + { + writer.WritePropertyName("storageDetails"u8); + writer.WriteStartArray(); + foreach (var item in StorageDetails) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + ApplicationServerVmDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ApplicationServerVmDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeApplicationServerVmDetails(document.RootElement, options); + } + + internal static ApplicationServerVmDetails DeserializeApplicationServerVmDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ApplicationServerVirtualMachineType? type = default; + string virtualMachineId = default; + IReadOnlyList storageDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new ApplicationServerVirtualMachineType(property.Value.GetString()); + continue; + } + if (property.NameEquals("virtualMachineId"u8)) + { + virtualMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + storageDetails = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ApplicationServerVmDetails(type, virtualMachineId, storageDetails ?? 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(ApplicationServerVmDetails)} does not support writing '{options.Format}' format."); + } + } + + ApplicationServerVmDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeApplicationServerVmDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ApplicationServerVmDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.cs new file mode 100644 index 000000000000..e6ca6f6ac72e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ApplicationServerVmDetails.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.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The Application Server VM Details. + public partial class ApplicationServerVmDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ApplicationServerVmDetails() + { + StorageDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Defines the type of application server VM. + /// The virtual machine id. + /// Storage details of all the Storage Accounts attached to the App Virtual Machine. For e.g. NFS on AFS Shared Storage. + /// Keeps track of any properties unknown to the library. + internal ApplicationServerVmDetails(ApplicationServerVirtualMachineType? type, string virtualMachineId, IReadOnlyList storageDetails, IDictionary serializedAdditionalRawData) + { + Type = type; + VirtualMachineId = virtualMachineId; + StorageDetails = storageDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Defines the type of application server VM. + public ApplicationServerVirtualMachineType? Type { get; } + /// The virtual machine id. + public string VirtualMachineId { get; } + /// Storage details of all the Storage Accounts attached to the App Virtual Machine. For e.g. NFS on AFS Shared Storage. + public IReadOnlyList StorageDetails { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.Serialization.cs new file mode 100644 index 000000000000..adac74407796 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class CentralServerConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CentralServerConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + writer.WritePropertyName("virtualMachineConfiguration"u8); + writer.WriteObjectValue(VirtualMachineConfiguration, options); + writer.WritePropertyName("instanceCount"u8); + writer.WriteNumberValue(InstanceCount); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + CentralServerConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CentralServerConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCentralServerConfiguration(document.RootElement, options); + } + + internal static CentralServerConfiguration DeserializeCentralServerConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string subnetId = default; + VirtualMachineConfiguration virtualMachineConfiguration = default; + long instanceCount = 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("virtualMachineConfiguration"u8)) + { + virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("instanceCount"u8)) + { + instanceCount = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CentralServerConfiguration(subnetId, virtualMachineConfiguration, instanceCount, serializedAdditionalRawData); + } + + BinaryData 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(CentralServerConfiguration)} does not support writing '{options.Format}' format."); + } + } + + CentralServerConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCentralServerConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CentralServerConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.cs new file mode 100644 index 000000000000..53b7f9ec28b2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerConfiguration.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; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the central server configuration. + public partial class CentralServerConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 subnet id. + /// Gets or sets the virtual machine configuration. + /// The number of central server VMs. + /// or is null. + public CentralServerConfiguration(string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount) + { + Argument.AssertNotNull(subnetId, nameof(subnetId)); + Argument.AssertNotNull(virtualMachineConfiguration, nameof(virtualMachineConfiguration)); + + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + InstanceCount = instanceCount; + } + + /// Initializes a new instance of . + /// The subnet id. + /// Gets or sets the virtual machine configuration. + /// The number of central server VMs. + /// Keeps track of any properties unknown to the library. + internal CentralServerConfiguration(string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount, IDictionary serializedAdditionalRawData) + { + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + InstanceCount = instanceCount; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal CentralServerConfiguration() + { + } + + /// The subnet id. + public string SubnetId { get; set; } + /// Gets or sets the virtual machine configuration. + public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } + /// The number of central server VMs. + public long InstanceCount { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.Serialization.cs new file mode 100644 index 000000000000..1cbfd492a1ca --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class CentralServerFullResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CentralServerFullResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(VirtualMachines)) + { + writer.WritePropertyName("virtualMachines"u8); + writer.WriteStartArray(); + foreach (var item in VirtualMachines) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AvailabilitySetName)) + { + writer.WritePropertyName("availabilitySetName"u8); + writer.WriteStringValue(AvailabilitySetName); + } + if (Optional.IsDefined(LoadBalancer)) + { + writer.WritePropertyName("loadBalancer"u8); + writer.WriteObjectValue(LoadBalancer, 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 + } + } + } + + CentralServerFullResourceNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CentralServerFullResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCentralServerFullResourceNames(document.RootElement, options); + } + + internal static CentralServerFullResourceNames DeserializeCentralServerFullResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList virtualMachines = default; + string availabilitySetName = default; + LoadBalancerResourceNames loadBalancer = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualMachines"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VirtualMachineResourceNames.DeserializeVirtualMachineResourceNames(item, options)); + } + virtualMachines = array; + continue; + } + if (property.NameEquals("availabilitySetName"u8)) + { + availabilitySetName = property.Value.GetString(); + continue; + } + if (property.NameEquals("loadBalancer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loadBalancer = LoadBalancerResourceNames.DeserializeLoadBalancerResourceNames(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CentralServerFullResourceNames(virtualMachines ?? new ChangeTrackingList(), availabilitySetName, loadBalancer, serializedAdditionalRawData); + } + + BinaryData 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(CentralServerFullResourceNames)} does not support writing '{options.Format}' format."); + } + } + + CentralServerFullResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCentralServerFullResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CentralServerFullResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.cs new file mode 100644 index 000000000000..dbfcd78a10e8 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerFullResourceNames.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The full resource names object for central server layer resources. + public partial class CentralServerFullResourceNames + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 CentralServerFullResourceNames() + { + VirtualMachines = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of names for all ASCS virtual machines to be deployed. The number of entries in this list should be equal to the number VMs to be created for ASCS layer. At maximum, there can be two virtual machines at this layer: ASCS and ERS. + /// The full name for availability set. In case name is not provided, it will be defaulted to {SID}-ASCS-AvSet. + /// The resource names object for load balancer and related resources. + /// Keeps track of any properties unknown to the library. + internal CentralServerFullResourceNames(IList virtualMachines, string availabilitySetName, LoadBalancerResourceNames loadBalancer, IDictionary serializedAdditionalRawData) + { + VirtualMachines = virtualMachines; + AvailabilitySetName = availabilitySetName; + LoadBalancer = loadBalancer; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of names for all ASCS virtual machines to be deployed. The number of entries in this list should be equal to the number VMs to be created for ASCS layer. At maximum, there can be two virtual machines at this layer: ASCS and ERS. + public IList VirtualMachines { get; } + /// The full name for availability set. In case name is not provided, it will be defaulted to {SID}-ASCS-AvSet. + public string AvailabilitySetName { get; set; } + /// The resource names object for load balancer and related resources. + public LoadBalancerResourceNames LoadBalancer { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVirtualMachineType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVirtualMachineType.cs new file mode 100644 index 000000000000..49877dfa61b0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVirtualMachineType.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.SapVirtualInstances.Models +{ + /// Defines the type of central server VM. + public readonly partial struct CentralServerVirtualMachineType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CentralServerVirtualMachineType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PrimaryValue = "Primary"; + private const string SecondaryValue = "Secondary"; + private const string UnknownValue = "Unknown"; + private const string ASCSValue = "ASCS"; + private const string ERSInactiveValue = "ERSInactive"; + private const string ERSValue = "ERS"; + private const string StandbyValue = "Standby"; + + /// Primary central server vm. + public static CentralServerVirtualMachineType Primary { get; } = new CentralServerVirtualMachineType(PrimaryValue); + /// Secondary central server vm. + public static CentralServerVirtualMachineType Secondary { get; } = new CentralServerVirtualMachineType(SecondaryValue); + /// Central server vm type unknown. + public static CentralServerVirtualMachineType Unknown { get; } = new CentralServerVirtualMachineType(UnknownValue); + /// ASCS Central server vm type. + public static CentralServerVirtualMachineType ASCS { get; } = new CentralServerVirtualMachineType(ASCSValue); + /// ERSInactive Central server vm type. + public static CentralServerVirtualMachineType ERSInactive { get; } = new CentralServerVirtualMachineType(ERSInactiveValue); + /// ERS Central server vm type. + public static CentralServerVirtualMachineType ERS { get; } = new CentralServerVirtualMachineType(ERSValue); + /// Standby Central server vm type. + public static CentralServerVirtualMachineType Standby { get; } = new CentralServerVirtualMachineType(StandbyValue); + /// Determines if two values are the same. + public static bool operator ==(CentralServerVirtualMachineType left, CentralServerVirtualMachineType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CentralServerVirtualMachineType left, CentralServerVirtualMachineType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator CentralServerVirtualMachineType(string value) => new CentralServerVirtualMachineType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CentralServerVirtualMachineType other && Equals(other); + /// + public bool Equals(CentralServerVirtualMachineType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.Serialization.cs new file mode 100644 index 000000000000..9849391422cd --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class CentralServerVmDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CentralServerVmDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Type)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(VirtualMachineId)) + { + writer.WritePropertyName("virtualMachineId"u8); + writer.WriteStringValue(VirtualMachineId); + } + if (options.Format != "W" && Optional.IsCollectionDefined(StorageDetails)) + { + writer.WritePropertyName("storageDetails"u8); + writer.WriteStartArray(); + foreach (var item in StorageDetails) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + CentralServerVmDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CentralServerVmDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCentralServerVmDetails(document.RootElement, options); + } + + internal static CentralServerVmDetails DeserializeCentralServerVmDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CentralServerVirtualMachineType? type = default; + string virtualMachineId = default; + IReadOnlyList storageDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new CentralServerVirtualMachineType(property.Value.GetString()); + continue; + } + if (property.NameEquals("virtualMachineId"u8)) + { + virtualMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + storageDetails = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CentralServerVmDetails(type, virtualMachineId, storageDetails ?? 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(CentralServerVmDetails)} does not support writing '{options.Format}' format."); + } + } + + CentralServerVmDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCentralServerVmDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CentralServerVmDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.cs new file mode 100644 index 000000000000..626e32d3317b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CentralServerVmDetails.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.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP Central Services Instance VM details. + public partial class CentralServerVmDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 CentralServerVmDetails() + { + StorageDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Defines the type of central server VM. + /// The virtual machine id. + /// Storage details of all the Storage Accounts attached to the ASCS Virtual Machine. For e.g. NFS on AFS Shared Storage. + /// Keeps track of any properties unknown to the library. + internal CentralServerVmDetails(CentralServerVirtualMachineType? type, string virtualMachineId, IReadOnlyList storageDetails, IDictionary serializedAdditionalRawData) + { + Type = type; + VirtualMachineId = virtualMachineId; + StorageDetails = storageDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Defines the type of central server VM. + public CentralServerVirtualMachineType? Type { get; } + /// The virtual machine id. + public string VirtualMachineId { get; } + /// Storage details of all the Storage Accounts attached to the ASCS Virtual Machine. For e.g. NFS on AFS Shared Storage. + public IReadOnlyList StorageDetails { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.Serialization.cs new file mode 100644 index 000000000000..4c540a2ff405 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.Serialization.cs @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class CreateAndMountFileShareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(CreateAndMountFileShareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(ResourceGroup)) + { + writer.WritePropertyName("resourceGroup"u8); + writer.WriteStringValue(ResourceGroup); + } + if (Optional.IsDefined(StorageAccountName)) + { + writer.WritePropertyName("storageAccountName"u8); + writer.WriteStringValue(StorageAccountName); + } + } + + CreateAndMountFileShareConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(CreateAndMountFileShareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeCreateAndMountFileShareConfiguration(document.RootElement, options); + } + + internal static CreateAndMountFileShareConfiguration DeserializeCreateAndMountFileShareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string resourceGroup = default; + string storageAccountName = default; + FileShareConfigurationType configurationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("resourceGroup"u8)) + { + resourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountName"u8)) + { + storageAccountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("configurationType"u8)) + { + configurationType = new FileShareConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new CreateAndMountFileShareConfiguration(configurationType, serializedAdditionalRawData, resourceGroup, storageAccountName); + } + + BinaryData 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(CreateAndMountFileShareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + CreateAndMountFileShareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeCreateAndMountFileShareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(CreateAndMountFileShareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.cs new file mode 100644 index 000000000000..fc2dbbd2fecb --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/CreateAndMountFileShareConfiguration.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the file share configuration where the transport directory fileshare is created and mounted as a part of the create infra flow. Please pre-create the resource group you intend to place the transport directory in. The storage account and fileshare will be auto-created by the ACSS and doesn't need to be pre-created. + public partial class CreateAndMountFileShareConfiguration : FileShareConfiguration + { + /// Initializes a new instance of . + public CreateAndMountFileShareConfiguration() + { + ConfigurationType = FileShareConfigurationType.CreateAndMount; + } + + /// Initializes a new instance of . + /// The type of file share config, eg: Mount/CreateAndMount/Skip. + /// Keeps track of any properties unknown to the library. + /// The name of transport file share resource group. This should be pre created by the customer. The app rg is used in case of missing input. + /// The name of file share storage account name . A custom name is used in case of missing input. + internal CreateAndMountFileShareConfiguration(FileShareConfigurationType configurationType, IDictionary serializedAdditionalRawData, string resourceGroup, string storageAccountName) : base(configurationType, serializedAdditionalRawData) + { + ResourceGroup = resourceGroup; + StorageAccountName = storageAccountName; + ConfigurationType = configurationType; + } + + /// The name of transport file share resource group. This should be pre created by the customer. The app rg is used in case of missing input. + public string ResourceGroup { get; set; } + /// The name of file share storage account name . A custom name is used in case of missing input. + public string StorageAccountName { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.Serialization.cs new file mode 100644 index 000000000000..edb305cd8ea4 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.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.SapVirtualInstances.Models +{ + public partial class DatabaseConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DatabaseConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DatabaseType)) + { + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType.Value.ToString()); + } + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + writer.WritePropertyName("virtualMachineConfiguration"u8); + writer.WriteObjectValue(VirtualMachineConfiguration, options); + writer.WritePropertyName("instanceCount"u8); + writer.WriteNumberValue(InstanceCount); + if (Optional.IsDefined(DiskConfiguration)) + { + writer.WritePropertyName("diskConfiguration"u8); + writer.WriteObjectValue(DiskConfiguration, 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 + } + } + } + + DatabaseConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseConfiguration(document.RootElement, options); + } + + internal static DatabaseConfiguration DeserializeDatabaseConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapDatabaseType? databaseType = default; + string subnetId = default; + VirtualMachineConfiguration virtualMachineConfiguration = default; + long instanceCount = default; + DiskConfiguration diskConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("databaseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseType = new SapDatabaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + subnetId = property.Value.GetString(); + continue; + } + if (property.NameEquals("virtualMachineConfiguration"u8)) + { + virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("instanceCount"u8)) + { + instanceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskConfiguration = DiskConfiguration.DeserializeDiskConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseConfiguration( + databaseType, + subnetId, + virtualMachineConfiguration, + instanceCount, + diskConfiguration, + serializedAdditionalRawData); + } + + BinaryData 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(DatabaseConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DatabaseConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDatabaseConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.cs new file mode 100644 index 000000000000..69aee508d675 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseConfiguration.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; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the database configuration. + public partial class DatabaseConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 subnet id. + /// Gets or sets the virtual machine configuration. + /// The number of database VMs. + /// or is null. + public DatabaseConfiguration(string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount) + { + Argument.AssertNotNull(subnetId, nameof(subnetId)); + Argument.AssertNotNull(virtualMachineConfiguration, nameof(virtualMachineConfiguration)); + + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + InstanceCount = instanceCount; + } + + /// Initializes a new instance of . + /// The database type. + /// The subnet id. + /// Gets or sets the virtual machine configuration. + /// The number of database VMs. + /// Gets or sets the disk configuration. + /// Keeps track of any properties unknown to the library. + internal DatabaseConfiguration(SapDatabaseType? databaseType, string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, long instanceCount, DiskConfiguration diskConfiguration, IDictionary serializedAdditionalRawData) + { + DatabaseType = databaseType; + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + InstanceCount = instanceCount; + DiskConfiguration = diskConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal DatabaseConfiguration() + { + } + + /// The database type. + public SapDatabaseType? DatabaseType { get; set; } + /// The subnet id. + public string SubnetId { get; set; } + /// Gets or sets the virtual machine configuration. + public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } + /// The number of database VMs. + public long InstanceCount { get; set; } + /// Gets or sets the disk configuration. + internal DiskConfiguration DiskConfiguration { get; set; } + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + public IDictionary DiskVolumeConfigurations + { + get + { + if (DiskConfiguration is null) + DiskConfiguration = new DiskConfiguration(); + return DiskConfiguration.DiskVolumeConfigurations; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.Serialization.cs new file mode 100644 index 000000000000..26fcacc0da32 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.Serialization.cs @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class DatabaseServerFullResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DatabaseServerFullResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(VirtualMachines)) + { + writer.WritePropertyName("virtualMachines"u8); + writer.WriteStartArray(); + foreach (var item in VirtualMachines) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(AvailabilitySetName)) + { + writer.WritePropertyName("availabilitySetName"u8); + writer.WriteStringValue(AvailabilitySetName); + } + if (Optional.IsDefined(LoadBalancer)) + { + writer.WritePropertyName("loadBalancer"u8); + writer.WriteObjectValue(LoadBalancer, 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 + } + } + } + + DatabaseServerFullResourceNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseServerFullResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseServerFullResourceNames(document.RootElement, options); + } + + internal static DatabaseServerFullResourceNames DeserializeDatabaseServerFullResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList virtualMachines = default; + string availabilitySetName = default; + LoadBalancerResourceNames loadBalancer = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualMachines"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(VirtualMachineResourceNames.DeserializeVirtualMachineResourceNames(item, options)); + } + virtualMachines = array; + continue; + } + if (property.NameEquals("availabilitySetName"u8)) + { + availabilitySetName = property.Value.GetString(); + continue; + } + if (property.NameEquals("loadBalancer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loadBalancer = LoadBalancerResourceNames.DeserializeLoadBalancerResourceNames(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseServerFullResourceNames(virtualMachines ?? new ChangeTrackingList(), availabilitySetName, loadBalancer, serializedAdditionalRawData); + } + + BinaryData 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(DatabaseServerFullResourceNames)} does not support writing '{options.Format}' format."); + } + } + + DatabaseServerFullResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDatabaseServerFullResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseServerFullResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.cs new file mode 100644 index 000000000000..b2b72f89a779 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseServerFullResourceNames.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The full resource names object for database layer resources. The number of entries in this list should be equal to the number VMs to be created for database layer. + public partial class DatabaseServerFullResourceNames + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DatabaseServerFullResourceNames() + { + VirtualMachines = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of virtual machine naming details. + /// The full name for availability set. In case name is not provided, it will be defaulted to {SID}-DB-AvSet. + /// The resource names object for load balancer and related resources. + /// Keeps track of any properties unknown to the library. + internal DatabaseServerFullResourceNames(IList virtualMachines, string availabilitySetName, LoadBalancerResourceNames loadBalancer, IDictionary serializedAdditionalRawData) + { + VirtualMachines = virtualMachines; + AvailabilitySetName = availabilitySetName; + LoadBalancer = loadBalancer; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of virtual machine naming details. + public IList VirtualMachines { get; } + /// The full name for availability set. In case name is not provided, it will be defaulted to {SID}-DB-AvSet. + public string AvailabilitySetName { get; set; } + /// The resource names object for load balancer and related resources. + public LoadBalancerResourceNames LoadBalancer { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.Serialization.cs new file mode 100644 index 000000000000..94cf23382ef0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class DatabaseVmDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DatabaseVmDetails)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(VirtualMachineId)) + { + writer.WritePropertyName("virtualMachineId"u8); + writer.WriteStringValue(VirtualMachineId); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsCollectionDefined(StorageDetails)) + { + writer.WritePropertyName("storageDetails"u8); + writer.WriteStartArray(); + foreach (var item in StorageDetails) + { + JsonSerializer.Serialize(writer, item); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DatabaseVmDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DatabaseVmDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDatabaseVmDetails(document.RootElement, options); + } + + internal static DatabaseVmDetails DeserializeDatabaseVmDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string virtualMachineId = default; + SapVirtualInstanceStatus? status = default; + IReadOnlyList storageDetails = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualMachineId"u8)) + { + virtualMachineId = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new SapVirtualInstanceStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("storageDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(JsonSerializer.Deserialize(item.GetRawText())); + } + storageDetails = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DatabaseVmDetails(virtualMachineId, status, storageDetails ?? 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(DatabaseVmDetails)} does not support writing '{options.Format}' format."); + } + } + + DatabaseVmDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDatabaseVmDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DatabaseVmDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.cs new file mode 100644 index 000000000000..374863a609ff --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DatabaseVmDetails.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.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Database VM details. + public partial class DatabaseVmDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DatabaseVmDetails() + { + StorageDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The virtual machine id. + /// Defines the SAP Instance status. + /// Storage details of all the Storage Accounts attached to the Database Virtual Machine. For e.g. NFS on AFS Shared Storage. + /// Keeps track of any properties unknown to the library. + internal DatabaseVmDetails(string virtualMachineId, SapVirtualInstanceStatus? status, IReadOnlyList storageDetails, IDictionary serializedAdditionalRawData) + { + VirtualMachineId = virtualMachineId; + Status = status; + StorageDetails = storageDetails; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The virtual machine id. + public string VirtualMachineId { get; } + /// Defines the SAP Instance status. + public SapVirtualInstanceStatus? Status { get; } + /// Storage details of all the Storage Accounts attached to the Database Virtual Machine. For e.g. NFS on AFS Shared Storage. + public IReadOnlyList StorageDetails { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.Serialization.cs new file mode 100644 index 000000000000..2beacb9bc19c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.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.SapVirtualInstances.Models +{ + public partial class DeployerVmPackages : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DeployerVmPackages)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Uri)) + { + writer.WritePropertyName("url"u8); + writer.WriteStringValue(Uri); + } + if (Optional.IsDefined(StorageAccountId)) + { + writer.WritePropertyName("storageAccountId"u8); + writer.WriteStringValue(StorageAccountId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + DeployerVmPackages IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeployerVmPackages)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeployerVmPackages(document.RootElement, options); + } + + internal static DeployerVmPackages DeserializeDeployerVmPackages(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string url = default; + string storageAccountId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("url"u8)) + { + url = property.Value.GetString(); + continue; + } + if (property.NameEquals("storageAccountId"u8)) + { + storageAccountId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeployerVmPackages(url, storageAccountId, serializedAdditionalRawData); + } + + BinaryData 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(DeployerVmPackages)} does not support writing '{options.Format}' format."); + } + } + + DeployerVmPackages IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeployerVmPackages(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeployerVmPackages)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.cs new file mode 100644 index 000000000000..37d42b92156b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeployerVmPackages.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.SapVirtualInstances.Models +{ + /// Defines the url and storage account ID where deployer VM packages are uploaded. + public partial class DeployerVmPackages + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DeployerVmPackages() + { + } + + /// Initializes a new instance of . + /// The URL to the deployer VM packages file. + /// The deployer VM packages storage account id. + /// Keeps track of any properties unknown to the library. + internal DeployerVmPackages(string uri, string storageAccountId, IDictionary serializedAdditionalRawData) + { + Uri = uri; + StorageAccountId = storageAccountId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The URL to the deployer VM packages file. + public string Uri { get; set; } + /// The deployer VM packages storage account id. + public string StorageAccountId { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.Serialization.cs new file mode 100644 index 000000000000..37264519b712 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.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.SapVirtualInstances.Models +{ + public partial class DeploymentConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DeploymentConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(AppLocation)) + { + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + } + if (Optional.IsDefined(InfrastructureConfiguration)) + { + writer.WritePropertyName("infrastructureConfiguration"u8); + writer.WriteObjectValue(InfrastructureConfiguration, options); + } + if (Optional.IsDefined(SoftwareConfiguration)) + { + writer.WritePropertyName("softwareConfiguration"u8); + writer.WriteObjectValue(SoftwareConfiguration, options); + } + } + + DeploymentConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentConfiguration(document.RootElement, options); + } + + internal static DeploymentConfiguration DeserializeDeploymentConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appLocation = default; + InfrastructureConfiguration infrastructureConfiguration = default; + SoftwareConfiguration softwareConfiguration = default; + SapConfigurationType configurationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("infrastructureConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + infrastructureConfiguration = InfrastructureConfiguration.DeserializeInfrastructureConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("softwareConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softwareConfiguration = SoftwareConfiguration.DeserializeSoftwareConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("configurationType"u8)) + { + configurationType = new SapConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentConfiguration(configurationType, serializedAdditionalRawData, appLocation, infrastructureConfiguration, softwareConfiguration); + } + + BinaryData 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(DeploymentConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DeploymentConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeploymentConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.cs new file mode 100644 index 000000000000..0721863185e0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentConfiguration.cs @@ -0,0 +1,59 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Deployment Configuration. + public partial class DeploymentConfiguration : SapConfiguration + { + /// Initializes a new instance of . + public DeploymentConfiguration() + { + ConfigurationType = SapConfigurationType.Deployment; + } + + /// Initializes a new instance of . + /// The configuration type. Eg: Deployment/Discovery. + /// Keeps track of any properties unknown to the library. + /// The geo-location where the SAP system is to be created. + /// + /// The infrastructure configuration. + /// 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 software configuration. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + internal DeploymentConfiguration(SapConfigurationType configurationType, IDictionary serializedAdditionalRawData, string appLocation, InfrastructureConfiguration infrastructureConfiguration, SoftwareConfiguration softwareConfiguration) : base(configurationType, serializedAdditionalRawData) + { + AppLocation = appLocation; + InfrastructureConfiguration = infrastructureConfiguration; + SoftwareConfiguration = softwareConfiguration; + ConfigurationType = configurationType; + } + + /// The geo-location where the SAP system is to be created. + public string AppLocation { get; set; } + /// + /// The infrastructure configuration. + /// 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 InfrastructureConfiguration InfrastructureConfiguration { get; set; } + /// + /// The software configuration. + /// 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 SoftwareConfiguration SoftwareConfiguration { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.Serialization.cs new file mode 100644 index 000000000000..e59c4d9fd475 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.Serialization.cs @@ -0,0 +1,172 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class DeploymentWithOSConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DeploymentWithOSConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(AppLocation)) + { + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + } + if (Optional.IsDefined(InfrastructureConfiguration)) + { + writer.WritePropertyName("infrastructureConfiguration"u8); + writer.WriteObjectValue(InfrastructureConfiguration, options); + } + if (Optional.IsDefined(SoftwareConfiguration)) + { + writer.WritePropertyName("softwareConfiguration"u8); + writer.WriteObjectValue(SoftwareConfiguration, options); + } + if (Optional.IsDefined(OSSapConfiguration)) + { + writer.WritePropertyName("osSapConfiguration"u8); + writer.WriteObjectValue(OSSapConfiguration, options); + } + } + + DeploymentWithOSConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DeploymentWithOSConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDeploymentWithOSConfiguration(document.RootElement, options); + } + + internal static DeploymentWithOSConfiguration DeserializeDeploymentWithOSConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appLocation = default; + InfrastructureConfiguration infrastructureConfiguration = default; + SoftwareConfiguration softwareConfiguration = default; + OSSapConfiguration osSapConfiguration = default; + SapConfigurationType configurationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("infrastructureConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + infrastructureConfiguration = InfrastructureConfiguration.DeserializeInfrastructureConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("softwareConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softwareConfiguration = SoftwareConfiguration.DeserializeSoftwareConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("osSapConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osSapConfiguration = OSSapConfiguration.DeserializeOSSapConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("configurationType"u8)) + { + configurationType = new SapConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DeploymentWithOSConfiguration( + configurationType, + serializedAdditionalRawData, + appLocation, + infrastructureConfiguration, + softwareConfiguration, + osSapConfiguration); + } + + BinaryData 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(DeploymentWithOSConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DeploymentWithOSConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDeploymentWithOSConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DeploymentWithOSConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.cs new file mode 100644 index 000000000000..224d0e3f3b25 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DeploymentWithOSConfiguration.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Deployment along with OS Configuration. + public partial class DeploymentWithOSConfiguration : SapConfiguration + { + /// Initializes a new instance of . + public DeploymentWithOSConfiguration() + { + ConfigurationType = SapConfigurationType.DeploymentWithOSConfig; + } + + /// Initializes a new instance of . + /// The configuration type. Eg: Deployment/Discovery. + /// Keeps track of any properties unknown to the library. + /// The geo-location where the SAP system is to be created. + /// + /// The infrastructure configuration. + /// 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 software configuration. + /// 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 OS and SAP configuration. + internal DeploymentWithOSConfiguration(SapConfigurationType configurationType, IDictionary serializedAdditionalRawData, string appLocation, InfrastructureConfiguration infrastructureConfiguration, SoftwareConfiguration softwareConfiguration, OSSapConfiguration osSapConfiguration) : base(configurationType, serializedAdditionalRawData) + { + AppLocation = appLocation; + InfrastructureConfiguration = infrastructureConfiguration; + SoftwareConfiguration = softwareConfiguration; + OSSapConfiguration = osSapConfiguration; + ConfigurationType = configurationType; + } + + /// The geo-location where the SAP system is to be created. + public string AppLocation { get; set; } + /// + /// The infrastructure configuration. + /// 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 InfrastructureConfiguration InfrastructureConfiguration { get; set; } + /// + /// The software configuration. + /// 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 SoftwareConfiguration SoftwareConfiguration { get; set; } + /// The OS and SAP configuration. + public OSSapConfiguration OSSapConfiguration { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.Serialization.cs new file mode 100644 index 000000000000..82c77d50c00d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class DiscoveryConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DiscoveryConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(CentralServerVmId)) + { + writer.WritePropertyName("centralServerVmId"u8); + writer.WriteStringValue(CentralServerVmId); + } + if (Optional.IsDefined(ManagedRgStorageAccountName)) + { + writer.WritePropertyName("managedRgStorageAccountName"u8); + writer.WriteStringValue(ManagedRgStorageAccountName); + } + if (options.Format != "W" && Optional.IsDefined(AppLocation)) + { + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + } + } + + DiscoveryConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiscoveryConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiscoveryConfiguration(document.RootElement, options); + } + + internal static DiscoveryConfiguration DeserializeDiscoveryConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string centralServerVmId = default; + string managedRgStorageAccountName = default; + string appLocation = default; + SapConfigurationType configurationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("centralServerVmId"u8)) + { + centralServerVmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("managedRgStorageAccountName"u8)) + { + managedRgStorageAccountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("configurationType"u8)) + { + configurationType = new SapConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiscoveryConfiguration(configurationType, serializedAdditionalRawData, centralServerVmId, managedRgStorageAccountName, appLocation); + } + + BinaryData 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(DiscoveryConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DiscoveryConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiscoveryConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiscoveryConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.cs new file mode 100644 index 000000000000..84ebbd127936 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiscoveryConfiguration.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Discovery Details. + public partial class DiscoveryConfiguration : SapConfiguration + { + /// Initializes a new instance of . + public DiscoveryConfiguration() + { + ConfigurationType = SapConfigurationType.Discovery; + } + + /// Initializes a new instance of . + /// The configuration type. Eg: Deployment/Discovery. + /// Keeps track of any properties unknown to the library. + /// The virtual machine ID of the Central Server. + /// The custom storage account name for the storage account created by the service in the managed resource group created as part of VIS deployment.<br><br>Refer to the storage account naming rules [here](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage).<br><br>If not provided, the service will create the storage account with a random name. + /// The geo-location where the SAP system exists. + internal DiscoveryConfiguration(SapConfigurationType configurationType, IDictionary serializedAdditionalRawData, string centralServerVmId, string managedRgStorageAccountName, string appLocation) : base(configurationType, serializedAdditionalRawData) + { + CentralServerVmId = centralServerVmId; + ManagedRgStorageAccountName = managedRgStorageAccountName; + AppLocation = appLocation; + ConfigurationType = configurationType; + } + + /// The virtual machine ID of the Central Server. + public string CentralServerVmId { get; set; } + /// The custom storage account name for the storage account created by the service in the managed resource group created as part of VIS deployment.<br><br>Refer to the storage account naming rules [here](https://learn.microsoft.com/azure/azure-resource-manager/management/resource-name-rules#microsoftstorage).<br><br>If not provided, the service will create the storage account with a random name. + public string ManagedRgStorageAccountName { get; set; } + /// The geo-location where the SAP system exists. + public string AppLocation { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.Serialization.cs new file mode 100644 index 000000000000..384420975b65 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.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.SapVirtualInstances.Models +{ + internal partial class DiskConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DiskConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(DiskVolumeConfigurations)) + { + writer.WritePropertyName("diskVolumeConfigurations"u8); + writer.WriteStartObject(); + foreach (var item in DiskVolumeConfigurations) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + DiskConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskConfiguration(document.RootElement, options); + } + + internal static DiskConfiguration DeserializeDiskConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary diskVolumeConfigurations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("diskVolumeConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, DiskVolumeConfiguration.DeserializeDiskVolumeConfiguration(property0.Value, options)); + } + diskVolumeConfigurations = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskConfiguration(diskVolumeConfigurations ?? 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(DiskConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DiskConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiskConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.cs new file mode 100644 index 000000000000..acbc18a0e4fc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskConfiguration.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.SapVirtualInstances.Models +{ + /// The Disk Configuration Details. + internal partial class DiskConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DiskConfiguration() + { + DiskVolumeConfigurations = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + /// Keeps track of any properties unknown to the library. + internal DiskConfiguration(IDictionary diskVolumeConfigurations, IDictionary serializedAdditionalRawData) + { + DiskVolumeConfigurations = diskVolumeConfigurations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + public IDictionary DiskVolumeConfigurations { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.Serialization.cs new file mode 100644 index 000000000000..b225d9dc6abe --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.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.SapVirtualInstances.Models +{ + public partial class DiskDetails : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DiskDetails)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, options); + } + if (Optional.IsDefined(SizeGB)) + { + writer.WritePropertyName("sizeGB"u8); + writer.WriteNumberValue(SizeGB.Value); + } + if (Optional.IsDefined(MinimumSupportedDiskCount)) + { + writer.WritePropertyName("minimumSupportedDiskCount"u8); + writer.WriteNumberValue(MinimumSupportedDiskCount.Value); + } + if (Optional.IsDefined(MaximumSupportedDiskCount)) + { + writer.WritePropertyName("maximumSupportedDiskCount"u8); + writer.WriteNumberValue(MaximumSupportedDiskCount.Value); + } + if (Optional.IsDefined(IopsReadWrite)) + { + writer.WritePropertyName("iopsReadWrite"u8); + writer.WriteNumberValue(IopsReadWrite.Value); + } + if (Optional.IsDefined(MbpsReadWrite)) + { + writer.WritePropertyName("mbpsReadWrite"u8); + writer.WriteNumberValue(MbpsReadWrite.Value); + } + if (Optional.IsDefined(DiskTier)) + { + writer.WritePropertyName("diskTier"u8); + writer.WriteStringValue(DiskTier); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + DiskDetails IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskDetails)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskDetails(document.RootElement, options); + } + + internal static DiskDetails DeserializeDiskDetails(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DiskSku sku = default; + long? sizeGB = default; + long? minimumSupportedDiskCount = default; + long? maximumSupportedDiskCount = default; + long? iopsReadWrite = default; + long? mbpsReadWrite = default; + string diskTier = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = DiskSku.DeserializeDiskSku(property.Value, options); + continue; + } + if (property.NameEquals("sizeGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizeGB = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("minimumSupportedDiskCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + minimumSupportedDiskCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("maximumSupportedDiskCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + maximumSupportedDiskCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("iopsReadWrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + iopsReadWrite = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("mbpsReadWrite"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + mbpsReadWrite = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("diskTier"u8)) + { + diskTier = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskDetails( + sku, + sizeGB, + minimumSupportedDiskCount, + maximumSupportedDiskCount, + iopsReadWrite, + mbpsReadWrite, + diskTier, + serializedAdditionalRawData); + } + + BinaryData 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(DiskDetails)} does not support writing '{options.Format}' format."); + } + } + + DiskDetails IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiskDetails(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskDetails)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.cs new file mode 100644 index 000000000000..287917b944e9 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskDetails.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.SapVirtualInstances.Models +{ + /// The supported disk size details for a disk type. + public partial class DiskDetails + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DiskDetails() + { + } + + /// Initializes a new instance of . + /// The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. + /// The disk size in GB. + /// The minimum supported disk count. + /// The maximum supported disk count. + /// The disk Iops. + /// The disk provisioned throughput in MBps. + /// The disk tier, e.g. P10, E10. + /// Keeps track of any properties unknown to the library. + internal DiskDetails(DiskSku sku, long? sizeGB, long? minimumSupportedDiskCount, long? maximumSupportedDiskCount, long? iopsReadWrite, long? mbpsReadWrite, string diskTier, IDictionary serializedAdditionalRawData) + { + Sku = sku; + SizeGB = sizeGB; + MinimumSupportedDiskCount = minimumSupportedDiskCount; + MaximumSupportedDiskCount = maximumSupportedDiskCount; + IopsReadWrite = iopsReadWrite; + MbpsReadWrite = mbpsReadWrite; + DiskTier = diskTier; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. + internal DiskSku Sku { get; } + /// Defines the disk sku name. + public DiskSkuName? SkuName + { + get => Sku?.Name; + } + + /// The disk size in GB. + public long? SizeGB { get; } + /// The minimum supported disk count. + public long? MinimumSupportedDiskCount { get; } + /// The maximum supported disk count. + public long? MaximumSupportedDiskCount { get; } + /// The disk Iops. + public long? IopsReadWrite { get; } + /// The disk provisioned throughput in MBps. + public long? MbpsReadWrite { get; } + /// The disk tier, e.g. P10, E10. + public string DiskTier { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.Serialization.cs new file mode 100644 index 000000000000..7f7547af8623 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.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.SapVirtualInstances.Models +{ + internal partial class DiskSku : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DiskSku)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name.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 + } + } + } + + DiskSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskSku)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskSku(document.RootElement, options); + } + + internal static DiskSku DeserializeDiskSku(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DiskSkuName? name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + name = new DiskSkuName(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskSku(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(DiskSku)} does not support writing '{options.Format}' format."); + } + } + + DiskSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiskSku(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskSku)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.cs new file mode 100644 index 000000000000..60a805bbce3b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSku.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.SapVirtualInstances.Models +{ + /// The type of disk sku. For example, Standard_LRS, Standard_ZRS, Premium_LRS, Premium_ZRS. + internal partial class DiskSku + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DiskSku() + { + } + + /// Initializes a new instance of . + /// Defines the disk sku name. + /// Keeps track of any properties unknown to the library. + internal DiskSku(DiskSkuName? name, IDictionary serializedAdditionalRawData) + { + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Defines the disk sku name. + public DiskSkuName? Name { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSkuName.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSkuName.cs new file mode 100644 index 000000000000..63def1a37360 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskSkuName.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.SapVirtualInstances.Models +{ + /// Defines the disk sku name. + public readonly partial struct DiskSkuName : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public DiskSkuName(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StandardLRSValue = "Standard_LRS"; + private const string PremiumLRSValue = "Premium_LRS"; + private const string StandardSSDLRSValue = "StandardSSD_LRS"; + private const string UltraSSDLRSValue = "UltraSSD_LRS"; + private const string PremiumZRSValue = "Premium_ZRS"; + private const string StandardSSDZRSValue = "StandardSSD_ZRS"; + private const string PremiumV2LRSValue = "PremiumV2_LRS"; + + /// Standard LRS Disk SKU. + public static DiskSkuName StandardLRS { get; } = new DiskSkuName(StandardLRSValue); + /// Premium_LRS Disk SKU. + public static DiskSkuName PremiumLRS { get; } = new DiskSkuName(PremiumLRSValue); + /// StandardSSD_LRS Disk SKU. + public static DiskSkuName StandardSSDLRS { get; } = new DiskSkuName(StandardSSDLRSValue); + /// UltraSSD_LRS Disk SKU. + public static DiskSkuName UltraSSDLRS { get; } = new DiskSkuName(UltraSSDLRSValue); + /// Premium_ZRS Disk SKU. + public static DiskSkuName PremiumZRS { get; } = new DiskSkuName(PremiumZRSValue); + /// StandardSSD_ZRS Disk SKU. + public static DiskSkuName StandardSSDZRS { get; } = new DiskSkuName(StandardSSDZRSValue); + /// PremiumV2_LRS Disk SKU. + public static DiskSkuName PremiumV2LRS { get; } = new DiskSkuName(PremiumV2LRSValue); + /// Determines if two values are the same. + public static bool operator ==(DiskSkuName left, DiskSkuName right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(DiskSkuName left, DiskSkuName right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator DiskSkuName(string value) => new DiskSkuName(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is DiskSkuName other && Equals(other); + /// + public bool Equals(DiskSkuName 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.Serialization.cs new file mode 100644 index 000000000000..579a252f5168 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.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.SapVirtualInstances.Models +{ + public partial class DiskVolumeConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(DiskVolumeConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Count)) + { + writer.WritePropertyName("count"u8); + writer.WriteNumberValue(Count.Value); + } + if (Optional.IsDefined(SizeGB)) + { + writer.WritePropertyName("sizeGB"u8); + writer.WriteNumberValue(SizeGB.Value); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteObjectValue(Sku, 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 + } + } + } + + DiskVolumeConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(DiskVolumeConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeDiskVolumeConfiguration(document.RootElement, options); + } + + internal static DiskVolumeConfiguration DeserializeDiskVolumeConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? count = default; + long? sizeGB = default; + DiskSku sku = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("count"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + count = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("sizeGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sizeGB = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("sku"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sku = DiskSku.DeserializeDiskSku(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new DiskVolumeConfiguration(count, sizeGB, sku, serializedAdditionalRawData); + } + + BinaryData 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(DiskVolumeConfiguration)} does not support writing '{options.Format}' format."); + } + } + + DiskVolumeConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeDiskVolumeConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(DiskVolumeConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.cs new file mode 100644 index 000000000000..2c23bc66fa35 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/DiskVolumeConfiguration.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The disk configuration required for the selected volume. + public partial class DiskVolumeConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 DiskVolumeConfiguration() + { + } + + /// Initializes a new instance of . + /// The total number of disks required for the concerned volume. + /// The disk size in GB. + /// The disk SKU details. + /// Keeps track of any properties unknown to the library. + internal DiskVolumeConfiguration(long? count, long? sizeGB, DiskSku sku, IDictionary serializedAdditionalRawData) + { + Count = count; + SizeGB = sizeGB; + Sku = sku; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The total number of disks required for the concerned volume. + public long? Count { get; set; } + /// The disk size in GB. + public long? SizeGB { get; set; } + /// The disk SKU details. + internal DiskSku Sku { get; set; } + /// Defines the disk sku name. + public DiskSkuName? SkuName + { + get => Sku is null ? default : Sku.Name; + set + { + if (Sku is null) + Sku = new DiskSku(); + Sku.Name = value; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.Serialization.cs new file mode 100644 index 000000000000..7fc1bbb99777 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.Serialization.cs @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class EnqueueReplicationServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(EnqueueReplicationServerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(ErsVersion)) + { + writer.WritePropertyName("ersVersion"u8); + writer.WriteStringValue(ErsVersion.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(InstanceNo)) + { + writer.WritePropertyName("instanceNo"u8); + writer.WriteStringValue(InstanceNo); + } + if (options.Format != "W" && Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + } + if (options.Format != "W" && Optional.IsDefined(KernelVersion)) + { + writer.WritePropertyName("kernelVersion"u8); + writer.WriteStringValue(KernelVersion); + } + if (options.Format != "W" && Optional.IsDefined(KernelPatch)) + { + writer.WritePropertyName("kernelPatch"u8); + writer.WriteStringValue(KernelPatch); + } + if (options.Format != "W" && Optional.IsDefined(IPAddress)) + { + writer.WritePropertyName("ipAddress"u8); + writer.WriteStringValue(IPAddress); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.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 + } + } + } + + EnqueueReplicationServerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EnqueueReplicationServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEnqueueReplicationServerProperties(document.RootElement, options); + } + + internal static EnqueueReplicationServerProperties DeserializeEnqueueReplicationServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + EnqueueReplicationServerType? ersVersion = default; + string instanceNo = default; + string hostname = default; + string kernelVersion = default; + string kernelPatch = default; + string ipAddress = default; + SapHealthState? health = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("ersVersion"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ersVersion = new EnqueueReplicationServerType(property.Value.GetString()); + continue; + } + if (property.NameEquals("instanceNo"u8)) + { + instanceNo = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("kernelVersion"u8)) + { + kernelVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("kernelPatch"u8)) + { + kernelPatch = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EnqueueReplicationServerProperties( + ersVersion, + instanceNo, + hostname, + kernelVersion, + kernelPatch, + ipAddress, + health, + serializedAdditionalRawData); + } + + BinaryData 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(EnqueueReplicationServerProperties)} does not support writing '{options.Format}' format."); + } + } + + EnqueueReplicationServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEnqueueReplicationServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EnqueueReplicationServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.cs new file mode 100644 index 000000000000..2a2556a09feb --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerProperties.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.SapVirtualInstances.Models +{ + /// Defines the SAP Enqueue Replication Server (ERS) properties. + public partial class EnqueueReplicationServerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 EnqueueReplicationServerProperties() + { + } + + /// Initializes a new instance of . + /// Defines the type of Enqueue Replication Server. + /// ERS Instance Number. + /// ERS SAP Hostname. + /// ERS SAP Kernel Version. + /// ERS SAP Kernel Patch level. + /// ERS SAP IP Address. + /// Defines the health of SAP Instances. + /// Keeps track of any properties unknown to the library. + internal EnqueueReplicationServerProperties(EnqueueReplicationServerType? ersVersion, string instanceNo, string hostname, string kernelVersion, string kernelPatch, string ipAddress, SapHealthState? health, IDictionary serializedAdditionalRawData) + { + ErsVersion = ersVersion; + InstanceNo = instanceNo; + Hostname = hostname; + KernelVersion = kernelVersion; + KernelPatch = kernelPatch; + IPAddress = ipAddress; + Health = health; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Defines the type of Enqueue Replication Server. + public EnqueueReplicationServerType? ErsVersion { get; } + /// ERS Instance Number. + public string InstanceNo { get; } + /// ERS SAP Hostname. + public string Hostname { get; } + /// ERS SAP Kernel Version. + public string KernelVersion { get; } + /// ERS SAP Kernel Patch level. + public string KernelPatch { get; } + /// ERS SAP IP Address. + public string IPAddress { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerType.cs new file mode 100644 index 000000000000..7ca6390ea71e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueReplicationServerType.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.SapVirtualInstances.Models +{ + /// Defines the type of Enqueue Replication Server. + public readonly partial struct EnqueueReplicationServerType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public EnqueueReplicationServerType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string EnqueueReplicator1Value = "EnqueueReplicator1"; + private const string EnqueueReplicator2Value = "EnqueueReplicator2"; + + /// Enqueue Replication server type 1. + public static EnqueueReplicationServerType EnqueueReplicator1 { get; } = new EnqueueReplicationServerType(EnqueueReplicator1Value); + /// Enqueue Replication server type 2. + public static EnqueueReplicationServerType EnqueueReplicator2 { get; } = new EnqueueReplicationServerType(EnqueueReplicator2Value); + /// Determines if two values are the same. + public static bool operator ==(EnqueueReplicationServerType left, EnqueueReplicationServerType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(EnqueueReplicationServerType left, EnqueueReplicationServerType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator EnqueueReplicationServerType(string value) => new EnqueueReplicationServerType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is EnqueueReplicationServerType other && Equals(other); + /// + public bool Equals(EnqueueReplicationServerType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.Serialization.cs new file mode 100644 index 000000000000..358882714454 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.Serialization.cs @@ -0,0 +1,170 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class EnqueueServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(EnqueueServerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + } + if (options.Format != "W" && Optional.IsDefined(IPAddress)) + { + writer.WritePropertyName("ipAddress"u8); + writer.WriteStringValue(IPAddress); + } + if (options.Format != "W" && Optional.IsDefined(Port)) + { + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port.Value); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.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 + } + } + } + + EnqueueServerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(EnqueueServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeEnqueueServerProperties(document.RootElement, options); + } + + internal static EnqueueServerProperties DeserializeEnqueueServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string hostname = default; + string ipAddress = default; + long? port = default; + SapHealthState? health = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("port"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new EnqueueServerProperties(hostname, ipAddress, port, health, serializedAdditionalRawData); + } + + BinaryData 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(EnqueueServerProperties)} does not support writing '{options.Format}' format."); + } + } + + EnqueueServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeEnqueueServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(EnqueueServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.cs new file mode 100644 index 000000000000..b93b8f3fa2fc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/EnqueueServerProperties.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.SapVirtualInstances.Models +{ + /// Defines the SAP Enqueue Server properties. + public partial class EnqueueServerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 EnqueueServerProperties() + { + } + + /// Initializes a new instance of . + /// Enqueue Server SAP Hostname. + /// Enqueue Server SAP IP Address. + /// Enqueue Server Port. + /// Defines the health of SAP Instances. + /// Keeps track of any properties unknown to the library. + internal EnqueueServerProperties(string hostname, string ipAddress, long? port, SapHealthState? health, IDictionary serializedAdditionalRawData) + { + Hostname = hostname; + IPAddress = ipAddress; + Port = port; + Health = health; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Enqueue Server SAP Hostname. + public string Hostname { get; } + /// Enqueue Server SAP IP Address. + public string IPAddress { get; } + /// Enqueue Server Port. + public long? Port { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.Serialization.cs new file mode 100644 index 000000000000..5eb391b27768 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.Serialization.cs @@ -0,0 +1,165 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ErrorInformation : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ErrorInformation)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (options.Format != "W" && Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (options.Format != "W" && Optional.IsCollectionDefined(Details)) + { + writer.WritePropertyName("details"u8); + writer.WriteStartArray(); + foreach (var item in Details) + { + 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 + } + } + } + + ErrorInformation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ErrorInformation)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeErrorInformation(document.RootElement, options); + } + + internal static ErrorInformation DeserializeErrorInformation(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string code = default; + string message = default; + IReadOnlyList details = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("details"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeErrorInformation(item, options)); + } + details = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ErrorInformation(code, message, details ?? 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(ErrorInformation)} does not support writing '{options.Format}' format."); + } + } + + ErrorInformation IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeErrorInformation(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ErrorInformation)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.cs new file mode 100644 index 000000000000..bd6490030f9c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ErrorInformation.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Error definition. + public partial class ErrorInformation + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ErrorInformation() + { + Details = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Service specific error code which serves as the substatus for the HTTP error code. + /// Description of the error. + /// Internal error details. + /// Keeps track of any properties unknown to the library. + internal ErrorInformation(string code, string message, IReadOnlyList details, IDictionary serializedAdditionalRawData) + { + Code = code; + Message = message; + Details = details; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Service specific error code which serves as the substatus for the HTTP error code. + public string Code { get; } + /// Description of the error. + public string Message { get; } + /// Internal error details. + public IReadOnlyList Details { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.Serialization.cs new file mode 100644 index 000000000000..d09c024cc0ea --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class ExternalInstallationSoftwareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ExternalInstallationSoftwareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(CentralServerVmId)) + { + writer.WritePropertyName("centralServerVmId"u8); + writer.WriteStringValue(CentralServerVmId); + } + } + + ExternalInstallationSoftwareConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ExternalInstallationSoftwareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeExternalInstallationSoftwareConfiguration(document.RootElement, options); + } + + internal static ExternalInstallationSoftwareConfiguration DeserializeExternalInstallationSoftwareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string centralServerVmId = default; + SapSoftwareInstallationType softwareInstallationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("centralServerVmId"u8)) + { + centralServerVmId = property.Value.GetString(); + continue; + } + if (property.NameEquals("softwareInstallationType"u8)) + { + softwareInstallationType = new SapSoftwareInstallationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ExternalInstallationSoftwareConfiguration(softwareInstallationType, serializedAdditionalRawData, centralServerVmId); + } + + BinaryData 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(ExternalInstallationSoftwareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ExternalInstallationSoftwareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeExternalInstallationSoftwareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ExternalInstallationSoftwareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.cs new file mode 100644 index 000000000000..c3b397f6d40e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ExternalInstallationSoftwareConfiguration.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP Software configuration Input when the software is installed externally outside the service. + public partial class ExternalInstallationSoftwareConfiguration : SoftwareConfiguration + { + /// Initializes a new instance of . + public ExternalInstallationSoftwareConfiguration() + { + SoftwareInstallationType = SapSoftwareInstallationType.External; + } + + /// Initializes a new instance of . + /// The SAP software installation type. + /// Keeps track of any properties unknown to the library. + /// The resource ID of the virtual machine containing the central server instance. + internal ExternalInstallationSoftwareConfiguration(SapSoftwareInstallationType softwareInstallationType, IDictionary serializedAdditionalRawData, string centralServerVmId) : base(softwareInstallationType, serializedAdditionalRawData) + { + CentralServerVmId = centralServerVmId; + SoftwareInstallationType = softwareInstallationType; + } + + /// The resource ID of the virtual machine containing the central server instance. + public string CentralServerVmId { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.Serialization.cs new file mode 100644 index 000000000000..b451de1705ab --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownFileShareConfiguration))] + public partial class FileShareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FileShareConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("configurationType"u8); + writer.WriteStringValue(ConfigurationType.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 + } + } + } + + FileShareConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FileShareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFileShareConfiguration(document.RootElement, options); + } + + internal static FileShareConfiguration DeserializeFileShareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("configurationType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "CreateAndMount": return CreateAndMountFileShareConfiguration.DeserializeCreateAndMountFileShareConfiguration(element, options); + case "Mount": return MountFileShareConfiguration.DeserializeMountFileShareConfiguration(element, options); + case "Skip": return SkipFileShareConfiguration.DeserializeSkipFileShareConfiguration(element, options); + } + } + return UnknownFileShareConfiguration.DeserializeUnknownFileShareConfiguration(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(FileShareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + FileShareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFileShareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FileShareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.cs new file mode 100644 index 000000000000..72ea38306a60 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfiguration.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.SapVirtualInstances.Models +{ + /// + /// File Share configuration details, populated with information on storage configuration mounted on the VIS. The createAndMount option is selected in case of missing input. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public abstract partial class FileShareConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 FileShareConfiguration() + { + } + + /// Initializes a new instance of . + /// The type of file share config, eg: Mount/CreateAndMount/Skip. + /// Keeps track of any properties unknown to the library. + internal FileShareConfiguration(FileShareConfigurationType configurationType, IDictionary serializedAdditionalRawData) + { + ConfigurationType = configurationType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The type of file share config, eg: Mount/CreateAndMount/Skip. + internal FileShareConfigurationType ConfigurationType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfigurationType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfigurationType.cs new file mode 100644 index 000000000000..8230c74a73e0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/FileShareConfigurationType.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.SapVirtualInstances.Models +{ + /// The type of file share config. + internal readonly partial struct FileShareConfigurationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public FileShareConfigurationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SkipValue = "Skip"; + private const string CreateAndMountValue = "CreateAndMount"; + private const string MountValue = "Mount"; + + /// Skip creating the file share. + public static FileShareConfigurationType Skip { get; } = new FileShareConfigurationType(SkipValue); + /// Fileshare will be created and mounted by service. + public static FileShareConfigurationType CreateAndMount { get; } = new FileShareConfigurationType(CreateAndMountValue); + /// Existing fileshare provided will be mounted by service. + public static FileShareConfigurationType Mount { get; } = new FileShareConfigurationType(MountValue); + /// Determines if two values are the same. + public static bool operator ==(FileShareConfigurationType left, FileShareConfigurationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(FileShareConfigurationType left, FileShareConfigurationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator FileShareConfigurationType(string value) => new FileShareConfigurationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is FileShareConfigurationType other && Equals(other); + /// + public bool Equals(FileShareConfigurationType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.Serialization.cs new file mode 100644 index 000000000000..7f2379f0e39b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.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.SapVirtualInstances.Models +{ + public partial class GatewayServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(GatewayServerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Port)) + { + writer.WritePropertyName("port"u8); + writer.WriteNumberValue(Port.Value); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.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 + } + } + } + + GatewayServerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(GatewayServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeGatewayServerProperties(document.RootElement, options); + } + + internal static GatewayServerProperties DeserializeGatewayServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? port = default; + SapHealthState? health = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("port"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + port = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new GatewayServerProperties(port, health, serializedAdditionalRawData); + } + + BinaryData 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(GatewayServerProperties)} does not support writing '{options.Format}' format."); + } + } + + GatewayServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeGatewayServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(GatewayServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.cs new file mode 100644 index 000000000000..0127fde8ef92 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/GatewayServerProperties.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.SapVirtualInstances.Models +{ + /// Defines the SAP Gateway Server properties. + public partial class GatewayServerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 GatewayServerProperties() + { + } + + /// Initializes a new instance of . + /// Gateway Port. + /// Defines the health of SAP Instances. + /// Keeps track of any properties unknown to the library. + internal GatewayServerProperties(long? port, SapHealthState? health, IDictionary serializedAdditionalRawData) + { + Port = port; + Health = health; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gateway Port. + public long? Port { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.Serialization.cs new file mode 100644 index 000000000000..e6a14d24a8ac --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.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.SapVirtualInstances.Models +{ + internal partial class HighAvailabilityConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(HighAvailabilityConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("highAvailabilityType"u8); + writer.WriteStringValue(HighAvailabilityType.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 + } + } + } + + HighAvailabilityConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HighAvailabilityConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHighAvailabilityConfiguration(document.RootElement, options); + } + + internal static HighAvailabilityConfiguration DeserializeHighAvailabilityConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapHighAvailabilityType highAvailabilityType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("highAvailabilityType"u8)) + { + highAvailabilityType = new SapHighAvailabilityType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HighAvailabilityConfiguration(highAvailabilityType, serializedAdditionalRawData); + } + + BinaryData 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(HighAvailabilityConfiguration)} does not support writing '{options.Format}' format."); + } + } + + HighAvailabilityConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHighAvailabilityConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HighAvailabilityConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.cs new file mode 100644 index 000000000000..a7d32d1ab84e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilityConfiguration.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.SapVirtualInstances.Models +{ + /// Gets or sets the high availability configuration. + internal partial class HighAvailabilityConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 high availability type. + public HighAvailabilityConfiguration(SapHighAvailabilityType highAvailabilityType) + { + HighAvailabilityType = highAvailabilityType; + } + + /// Initializes a new instance of . + /// The high availability type. + /// Keeps track of any properties unknown to the library. + internal HighAvailabilityConfiguration(SapHighAvailabilityType highAvailabilityType, IDictionary serializedAdditionalRawData) + { + HighAvailabilityType = highAvailabilityType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HighAvailabilityConfiguration() + { + } + + /// The high availability type. + public SapHighAvailabilityType HighAvailabilityType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.Serialization.cs new file mode 100644 index 000000000000..5417082d3e9e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.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.SapVirtualInstances.Models +{ + public partial class HighAvailabilitySoftwareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(HighAvailabilitySoftwareConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("fencingClientId"u8); + writer.WriteStringValue(FencingClientId); + writer.WritePropertyName("fencingClientPassword"u8); + writer.WriteStringValue(FencingClientPassword); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + HighAvailabilitySoftwareConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(HighAvailabilitySoftwareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeHighAvailabilitySoftwareConfiguration(document.RootElement, options); + } + + internal static HighAvailabilitySoftwareConfiguration DeserializeHighAvailabilitySoftwareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string fencingClientId = default; + string fencingClientPassword = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("fencingClientId"u8)) + { + fencingClientId = property.Value.GetString(); + continue; + } + if (property.NameEquals("fencingClientPassword"u8)) + { + fencingClientPassword = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new HighAvailabilitySoftwareConfiguration(fencingClientId, fencingClientPassword, serializedAdditionalRawData); + } + + BinaryData 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(HighAvailabilitySoftwareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + HighAvailabilitySoftwareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeHighAvailabilitySoftwareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(HighAvailabilitySoftwareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.cs new file mode 100644 index 000000000000..14c9a64c0718 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/HighAvailabilitySoftwareConfiguration.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.SapVirtualInstances.Models +{ + /// Gets or sets the HA software configuration. + public partial class HighAvailabilitySoftwareConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 fencing client id. + /// The fencing client id secret/password. The secret should never expire. This will be used pacemaker to start/stop the cluster VMs. + /// or is null. + public HighAvailabilitySoftwareConfiguration(string fencingClientId, string fencingClientPassword) + { + Argument.AssertNotNull(fencingClientId, nameof(fencingClientId)); + Argument.AssertNotNull(fencingClientPassword, nameof(fencingClientPassword)); + + FencingClientId = fencingClientId; + FencingClientPassword = fencingClientPassword; + } + + /// Initializes a new instance of . + /// The fencing client id. + /// The fencing client id secret/password. The secret should never expire. This will be used pacemaker to start/stop the cluster VMs. + /// Keeps track of any properties unknown to the library. + internal HighAvailabilitySoftwareConfiguration(string fencingClientId, string fencingClientPassword, IDictionary serializedAdditionalRawData) + { + FencingClientId = fencingClientId; + FencingClientPassword = fencingClientPassword; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal HighAvailabilitySoftwareConfiguration() + { + } + + /// The fencing client id. + public string FencingClientId { get; set; } + /// The fencing client id secret/password. The secret should never expire. This will be used pacemaker to start/stop the cluster VMs. + public string FencingClientPassword { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.Serialization.cs new file mode 100644 index 000000000000..e2b498fb1160 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.Serialization.cs @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class ImageReference : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ImageReference)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Publisher)) + { + writer.WritePropertyName("publisher"u8); + writer.WriteStringValue(Publisher); + } + if (Optional.IsDefined(Offer)) + { + writer.WritePropertyName("offer"u8); + writer.WriteStringValue(Offer); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteStringValue(Sku); + } + if (Optional.IsDefined(Version)) + { + writer.WritePropertyName("version"u8); + writer.WriteStringValue(Version); + } + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + ImageReference IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ImageReference)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeImageReference(document.RootElement, options); + } + + internal static ImageReference DeserializeImageReference(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string publisher = default; + string offer = default; + string sku = default; + string version = default; + ResourceIdentifier id = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("publisher"u8)) + { + publisher = property.Value.GetString(); + continue; + } + if (property.NameEquals("offer"u8)) + { + offer = property.Value.GetString(); + continue; + } + if (property.NameEquals("sku"u8)) + { + sku = property.Value.GetString(); + continue; + } + if (property.NameEquals("version"u8)) + { + version = property.Value.GetString(); + continue; + } + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ImageReference( + publisher, + offer, + sku, + version, + id, + serializedAdditionalRawData); + } + + BinaryData 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(ImageReference)} does not support writing '{options.Format}' format."); + } + } + + ImageReference IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeImageReference(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ImageReference)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.cs new file mode 100644 index 000000000000..a55799521852 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ImageReference.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; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Specifies information about the image to use. You can specify information about platform images, marketplace images, or virtual machine images. This element is required when you want to use a platform image, marketplace image, or virtual machine image, but is not used in other creation operations. NOTE: Image reference publisher and offer can only be set when you create the scale set. + public partial class ImageReference + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ImageReference() + { + } + + /// Initializes a new instance of . + /// The image publisher. + /// Specifies the offer of the platform image or marketplace image used to create the virtual machine. + /// The image SKU. + /// Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. + /// Specifies the ARM resource ID of the Azure Compute Gallery image version used for creating ACSS VMs. You will need to provide this input when you choose to deploy virtual machines in ACSS with OS image from the Azure Compute gallery. + /// Keeps track of any properties unknown to the library. + internal ImageReference(string publisher, string offer, string sku, string version, ResourceIdentifier id, IDictionary serializedAdditionalRawData) + { + Publisher = publisher; + Offer = offer; + Sku = sku; + Version = version; + Id = id; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The image publisher. + public string Publisher { get; set; } + /// Specifies the offer of the platform image or marketplace image used to create the virtual machine. + public string Offer { get; set; } + /// The image SKU. + public string Sku { get; set; } + /// Specifies the version of the platform image or marketplace image used to create the virtual machine. The allowed formats are Major.Minor.Build or 'latest'. Major, Minor, and Build are decimal numbers. Specify 'latest' to use the latest version of an image available at deploy time. Even if you use 'latest', the VM image will not automatically update after deploy time even if a new version becomes available. + public string Version { get; set; } + /// Specifies the ARM resource ID of the Azure Compute Gallery image version used for creating ACSS VMs. You will need to provide this input when you choose to deploy virtual machines in ACSS with OS image from the Azure Compute gallery. + public ResourceIdentifier Id { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.Serialization.cs new file mode 100644 index 000000000000..41b3b4514aad --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.Serialization.cs @@ -0,0 +1,120 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownInfrastructureConfiguration))] + public partial class InfrastructureConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(InfrastructureConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("appResourceGroup"u8); + writer.WriteStringValue(AppResourceGroup); + writer.WritePropertyName("deploymentType"u8); + writer.WriteStringValue(DeploymentType.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 + } + } + } + + InfrastructureConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InfrastructureConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInfrastructureConfiguration(document.RootElement, options); + } + + internal static InfrastructureConfiguration DeserializeInfrastructureConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("deploymentType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "SingleServer": return SingleServerConfiguration.DeserializeSingleServerConfiguration(element, options); + case "ThreeTier": return ThreeTierConfiguration.DeserializeThreeTierConfiguration(element, options); + } + } + return UnknownInfrastructureConfiguration.DeserializeUnknownInfrastructureConfiguration(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(InfrastructureConfiguration)} does not support writing '{options.Format}' format."); + } + } + + InfrastructureConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInfrastructureConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InfrastructureConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.cs new file mode 100644 index 000000000000..5b41b47e9932 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/InfrastructureConfiguration.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.SapVirtualInstances.Models +{ + /// + /// Deploy SAP Infrastructure Details. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include and . + /// + public abstract partial class InfrastructureConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 . + /// The application resource group where SAP system resources will be deployed. + /// is null. + protected InfrastructureConfiguration(string appResourceGroup) + { + Argument.AssertNotNull(appResourceGroup, nameof(appResourceGroup)); + + AppResourceGroup = appResourceGroup; + } + + /// Initializes a new instance of . + /// The application resource group where SAP system resources will be deployed. + /// The SAP deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + internal InfrastructureConfiguration(string appResourceGroup, SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData) + { + AppResourceGroup = appResourceGroup; + DeploymentType = deploymentType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal InfrastructureConfiguration() + { + } + + /// The application resource group where SAP system resources will be deployed. + public string AppResourceGroup { get; set; } + /// The SAP deployment type. Eg: SingleServer/ThreeTier. + internal SapDeploymentType DeploymentType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.Serialization.cs new file mode 100644 index 000000000000..da0c2ddef445 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.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.SapVirtualInstances.Models +{ + public partial class LinuxConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(LinuxConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DisablePasswordAuthentication)) + { + writer.WritePropertyName("disablePasswordAuthentication"u8); + writer.WriteBooleanValue(DisablePasswordAuthentication.Value); + } + if (Optional.IsDefined(Ssh)) + { + writer.WritePropertyName("ssh"u8); + writer.WriteObjectValue(Ssh, options); + } + if (Optional.IsDefined(SshKeyPair)) + { + writer.WritePropertyName("sshKeyPair"u8); + writer.WriteObjectValue(SshKeyPair, options); + } + } + + LinuxConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LinuxConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLinuxConfiguration(document.RootElement, options); + } + + internal static LinuxConfiguration DeserializeLinuxConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? disablePasswordAuthentication = default; + SshConfiguration ssh = default; + SshKeyPair sshKeyPair = default; + OSType osType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("disablePasswordAuthentication"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + disablePasswordAuthentication = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("ssh"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + ssh = SshConfiguration.DeserializeSshConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("sshKeyPair"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sshKeyPair = SshKeyPair.DeserializeSshKeyPair(property.Value, options); + continue; + } + if (property.NameEquals("osType"u8)) + { + osType = new OSType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LinuxConfiguration(osType, serializedAdditionalRawData, disablePasswordAuthentication, ssh, sshKeyPair); + } + + BinaryData 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(LinuxConfiguration)} does not support writing '{options.Format}' format."); + } + } + + LinuxConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLinuxConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LinuxConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.cs new file mode 100644 index 000000000000..cbab30ff0f28 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LinuxConfiguration.cs @@ -0,0 +1,54 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Specifies the Linux operating system settings on the virtual machine. For a list of supported Linux distributions, see [Linux on Azure-Endorsed Distributions](https://learn.microsoft.com/azure/virtual-machines/linux/endorsed-distros). + public partial class LinuxConfiguration : OSConfiguration + { + /// Initializes a new instance of . + public LinuxConfiguration() + { + OSType = OSType.Linux; + } + + /// Initializes a new instance of . + /// The OS Type. + /// Keeps track of any properties unknown to the library. + /// Specifies whether password authentication should be disabled. + /// Specifies the ssh key configuration for a Linux OS. (This property is deprecated, please use 'sshKeyPair' instead). + /// The SSH Key-pair used to authenticate with the VM's. + internal LinuxConfiguration(OSType osType, IDictionary serializedAdditionalRawData, bool? disablePasswordAuthentication, SshConfiguration ssh, SshKeyPair sshKeyPair) : base(osType, serializedAdditionalRawData) + { + DisablePasswordAuthentication = disablePasswordAuthentication; + Ssh = ssh; + SshKeyPair = sshKeyPair; + OSType = osType; + } + + /// Specifies whether password authentication should be disabled. + public bool? DisablePasswordAuthentication { get; set; } + /// Specifies the ssh key configuration for a Linux OS. (This property is deprecated, please use 'sshKeyPair' instead). + internal SshConfiguration Ssh { get; set; } + /// The list of SSH public keys used to authenticate with linux based VMs. + public IList SshPublicKeys + { + get + { + if (Ssh is null) + Ssh = new SshConfiguration(); + return Ssh.PublicKeys; + } + } + + /// The SSH Key-pair used to authenticate with the VM's. + public SshKeyPair SshKeyPair { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.Serialization.cs new file mode 100644 index 000000000000..24ce555c987a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.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; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class LoadBalancerResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(LoadBalancerResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(LoadBalancerName)) + { + writer.WritePropertyName("loadBalancerName"u8); + writer.WriteStringValue(LoadBalancerName); + } + if (Optional.IsCollectionDefined(FrontendIPConfigurationNames)) + { + writer.WritePropertyName("frontendIpConfigurationNames"u8); + writer.WriteStartArray(); + foreach (var item in FrontendIPConfigurationNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(BackendPoolNames)) + { + writer.WritePropertyName("backendPoolNames"u8); + writer.WriteStartArray(); + foreach (var item in BackendPoolNames) + { + writer.WriteStringValue(item); + } + writer.WriteEndArray(); + } + if (Optional.IsCollectionDefined(HealthProbeNames)) + { + writer.WritePropertyName("healthProbeNames"u8); + writer.WriteStartArray(); + foreach (var item in HealthProbeNames) + { + 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 + } + } + } + + LoadBalancerResourceNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(LoadBalancerResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeLoadBalancerResourceNames(document.RootElement, options); + } + + internal static LoadBalancerResourceNames DeserializeLoadBalancerResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string loadBalancerName = default; + IList frontendIPConfigurationNames = default; + IList backendPoolNames = default; + IList healthProbeNames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("loadBalancerName"u8)) + { + loadBalancerName = property.Value.GetString(); + continue; + } + if (property.NameEquals("frontendIpConfigurationNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + frontendIPConfigurationNames = array; + continue; + } + if (property.NameEquals("backendPoolNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + backendPoolNames = array; + continue; + } + if (property.NameEquals("healthProbeNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + healthProbeNames = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new LoadBalancerResourceNames(loadBalancerName, frontendIPConfigurationNames ?? new ChangeTrackingList(), backendPoolNames ?? new ChangeTrackingList(), healthProbeNames ?? 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(LoadBalancerResourceNames)} does not support writing '{options.Format}' format."); + } + } + + LoadBalancerResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeLoadBalancerResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(LoadBalancerResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.cs new file mode 100644 index 000000000000..e3bf1c626759 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/LoadBalancerResourceNames.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The resource names object for load balancer and related resources. + public partial class LoadBalancerResourceNames + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 LoadBalancerResourceNames() + { + FrontendIPConfigurationNames = new ChangeTrackingList(); + BackendPoolNames = new ChangeTrackingList(); + HealthProbeNames = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The full resource name for load balancer. If this value is not provided, load balancer will be name as {ASCS/DB}-loadBalancer. + /// The list of frontend IP configuration names. If provided as input, size of this list should be 2 for cs layer and should be 1 for database layer. + /// The list of backend pool names. Currently, ACSS deploys only one backend pool and hence, size of this list should be 1. + /// The list of health probe names. If provided as input, size of this list should be 2 for cs layer and should be 1 for database layer. + /// Keeps track of any properties unknown to the library. + internal LoadBalancerResourceNames(string loadBalancerName, IList frontendIPConfigurationNames, IList backendPoolNames, IList healthProbeNames, IDictionary serializedAdditionalRawData) + { + LoadBalancerName = loadBalancerName; + FrontendIPConfigurationNames = frontendIPConfigurationNames; + BackendPoolNames = backendPoolNames; + HealthProbeNames = healthProbeNames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The full resource name for load balancer. If this value is not provided, load balancer will be name as {ASCS/DB}-loadBalancer. + public string LoadBalancerName { get; set; } + /// The list of frontend IP configuration names. If provided as input, size of this list should be 2 for cs layer and should be 1 for database layer. + public IList FrontendIPConfigurationNames { get; } + /// The list of backend pool names. Currently, ACSS deploys only one backend pool and hence, size of this list should be 1. + public IList BackendPoolNames { get; } + /// The list of health probe names. If provided as input, size of this list should be 2 for cs layer and should be 1 for database layer. + public IList HealthProbeNames { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.Serialization.cs new file mode 100644 index 000000000000..5d8103694c58 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class ManagedRGConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ManagedRGConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + ManagedRGConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ManagedRGConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeManagedRGConfiguration(document.RootElement, options); + } + + internal static ManagedRGConfiguration DeserializeManagedRGConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string name = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ManagedRGConfiguration(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(ManagedRGConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ManagedRGConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeManagedRGConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ManagedRGConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.cs new file mode 100644 index 000000000000..97925c7a1239 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedRGConfiguration.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.SapVirtualInstances.Models +{ + /// Managed resource group configuration. + internal partial class ManagedRGConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 ManagedRGConfiguration() + { + } + + /// Initializes a new instance of . + /// Managed resource group name. + /// Keeps track of any properties unknown to the library. + internal ManagedRGConfiguration(string name, IDictionary serializedAdditionalRawData) + { + Name = name; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Managed resource group name. + public string Name { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedResourcesNetworkAccessType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedResourcesNetworkAccessType.cs new file mode 100644 index 000000000000..77453b9854c6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ManagedResourcesNetworkAccessType.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.SapVirtualInstances.Models +{ + /// Defines the network access type for managed resources. + public readonly partial struct ManagedResourcesNetworkAccessType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public ManagedResourcesNetworkAccessType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PublicValue = "Public"; + private const string PrivateValue = "Private"; + + /// Managed resources will be deployed with public network access enabled. + public static ManagedResourcesNetworkAccessType Public { get; } = new ManagedResourcesNetworkAccessType(PublicValue); + /// Managed resources will be deployed with public network access disabled. + public static ManagedResourcesNetworkAccessType Private { get; } = new ManagedResourcesNetworkAccessType(PrivateValue); + /// Determines if two values are the same. + public static bool operator ==(ManagedResourcesNetworkAccessType left, ManagedResourcesNetworkAccessType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(ManagedResourcesNetworkAccessType left, ManagedResourcesNetworkAccessType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator ManagedResourcesNetworkAccessType(string value) => new ManagedResourcesNetworkAccessType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is ManagedResourcesNetworkAccessType other && Equals(other); + /// + public bool Equals(ManagedResourcesNetworkAccessType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.Serialization.cs new file mode 100644 index 000000000000..b18144e38439 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.Serialization.cs @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class MessageServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(MessageServerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(MsPort)) + { + writer.WritePropertyName("msPort"u8); + writer.WriteNumberValue(MsPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(InternalMsPort)) + { + writer.WritePropertyName("internalMsPort"u8); + writer.WriteNumberValue(InternalMsPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(HttpPort)) + { + writer.WritePropertyName("httpPort"u8); + writer.WriteNumberValue(HttpPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(HttpsPort)) + { + writer.WritePropertyName("httpsPort"u8); + writer.WriteNumberValue(HttpsPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + } + if (options.Format != "W" && Optional.IsDefined(IPAddress)) + { + writer.WritePropertyName("ipAddress"u8); + writer.WriteStringValue(IPAddress); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.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 + } + } + } + + MessageServerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MessageServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMessageServerProperties(document.RootElement, options); + } + + internal static MessageServerProperties DeserializeMessageServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? msPort = default; + long? internalMsPort = default; + long? httpPort = default; + long? httpsPort = default; + string hostname = default; + string ipAddress = default; + SapHealthState? health = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("msPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + msPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("internalMsPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + internalMsPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("httpPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + httpPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("httpsPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + httpsPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MessageServerProperties( + msPort, + internalMsPort, + httpPort, + httpsPort, + hostname, + ipAddress, + health, + serializedAdditionalRawData); + } + + BinaryData 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(MessageServerProperties)} does not support writing '{options.Format}' format."); + } + } + + MessageServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMessageServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MessageServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.cs new file mode 100644 index 000000000000..d1c6765d55c6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MessageServerProperties.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.SapVirtualInstances.Models +{ + /// Defines the SAP message server properties. + public partial class MessageServerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 MessageServerProperties() + { + } + + /// Initializes a new instance of . + /// message server port. + /// message server internal MS port. + /// message server HTTP Port. + /// message server HTTPS Port. + /// message server SAP Hostname. + /// message server IP Address. + /// Defines the health of SAP Instances. + /// Keeps track of any properties unknown to the library. + internal MessageServerProperties(long? msPort, long? internalMsPort, long? httpPort, long? httpsPort, string hostname, string ipAddress, SapHealthState? health, IDictionary serializedAdditionalRawData) + { + MsPort = msPort; + InternalMsPort = internalMsPort; + HttpPort = httpPort; + HttpsPort = httpsPort; + Hostname = hostname; + IPAddress = ipAddress; + Health = health; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// message server port. + public long? MsPort { get; } + /// message server internal MS port. + public long? InternalMsPort { get; } + /// message server HTTP Port. + public long? HttpPort { get; } + /// message server HTTPS Port. + public long? HttpsPort { get; } + /// message server SAP Hostname. + public string Hostname { get; } + /// message server IP Address. + public string IPAddress { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.Serialization.cs new file mode 100644 index 000000000000..ab44964515d8 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.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.SapVirtualInstances.Models +{ + public partial class MountFileShareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(MountFileShareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + writer.WritePropertyName("privateEndpointId"u8); + writer.WriteStringValue(PrivateEndpointId); + } + + MountFileShareConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(MountFileShareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeMountFileShareConfiguration(document.RootElement, options); + } + + internal static MountFileShareConfiguration DeserializeMountFileShareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string id = default; + string privateEndpointId = default; + FileShareConfigurationType configurationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateEndpointId"u8)) + { + privateEndpointId = property.Value.GetString(); + continue; + } + if (property.NameEquals("configurationType"u8)) + { + configurationType = new FileShareConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new MountFileShareConfiguration(configurationType, serializedAdditionalRawData, id, privateEndpointId); + } + + BinaryData 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(MountFileShareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + MountFileShareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeMountFileShareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(MountFileShareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.cs new file mode 100644 index 000000000000..97b436cc473b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/MountFileShareConfiguration.cs @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the file share configuration where the transport directory fileshare already exists, and user wishes to mount the fileshare as a part of the create infra flow. + public partial class MountFileShareConfiguration : FileShareConfiguration + { + /// Initializes a new instance of . + /// The fileshare resource ID. + /// The private endpoint resource ID. + /// or is null. + public MountFileShareConfiguration(string id, string privateEndpointId) + { + Argument.AssertNotNull(id, nameof(id)); + Argument.AssertNotNull(privateEndpointId, nameof(privateEndpointId)); + + Id = id; + PrivateEndpointId = privateEndpointId; + ConfigurationType = FileShareConfigurationType.Mount; + } + + /// Initializes a new instance of . + /// The type of file share config, eg: Mount/CreateAndMount/Skip. + /// Keeps track of any properties unknown to the library. + /// The fileshare resource ID. + /// The private endpoint resource ID. + internal MountFileShareConfiguration(FileShareConfigurationType configurationType, IDictionary serializedAdditionalRawData, string id, string privateEndpointId) : base(configurationType, serializedAdditionalRawData) + { + Id = id; + PrivateEndpointId = privateEndpointId; + ConfigurationType = configurationType; + } + + /// Initializes a new instance of for deserialization. + internal MountFileShareConfiguration() + { + } + + /// The fileshare resource ID. + public string Id { get; set; } + /// The private endpoint resource ID. + public string PrivateEndpointId { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NamingPatternType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NamingPatternType.cs new file mode 100644 index 000000000000..f80495efa1ed --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NamingPatternType.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.SapVirtualInstances.Models +{ + /// The pattern type to be used for resource naming. + internal readonly partial struct NamingPatternType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NamingPatternType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string FullResourceNameValue = "FullResourceName"; + + /// Full resource names that will be created by service. + public static NamingPatternType FullResourceName { get; } = new NamingPatternType(FullResourceNameValue); + /// Determines if two values are the same. + public static bool operator ==(NamingPatternType left, NamingPatternType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NamingPatternType left, NamingPatternType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator NamingPatternType(string value) => new NamingPatternType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NamingPatternType other && Equals(other); + /// + public bool Equals(NamingPatternType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.Serialization.cs new file mode 100644 index 000000000000..ed3086cbac72 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.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.SapVirtualInstances.Models +{ + internal partial class NetworkConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NetworkConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(IsSecondaryIPEnabled)) + { + writer.WritePropertyName("isSecondaryIpEnabled"u8); + writer.WriteBooleanValue(IsSecondaryIPEnabled.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 + } + } + } + + NetworkConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkConfiguration(document.RootElement, options); + } + + internal static NetworkConfiguration DeserializeNetworkConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? isSecondaryIPEnabled = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("isSecondaryIpEnabled"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSecondaryIPEnabled = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkConfiguration(isSecondaryIPEnabled, serializedAdditionalRawData); + } + + BinaryData 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(NetworkConfiguration)} does not support writing '{options.Format}' format."); + } + } + + NetworkConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.cs new file mode 100644 index 000000000000..ef284cd37b59 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkConfiguration.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.SapVirtualInstances.Models +{ + /// Defines the network configuration type for SAP system infrastructure that is being deployed. + internal partial class NetworkConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NetworkConfiguration() + { + } + + /// Initializes a new instance of . + /// Specifies whether a secondary IP address should be added to the network interface on all VMs of the SAP system being deployed. + /// Keeps track of any properties unknown to the library. + internal NetworkConfiguration(bool? isSecondaryIPEnabled, IDictionary serializedAdditionalRawData) + { + IsSecondaryIPEnabled = isSecondaryIPEnabled; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies whether a secondary IP address should be added to the network interface on all VMs of the SAP system being deployed. + public bool? IsSecondaryIPEnabled { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.Serialization.cs new file mode 100644 index 000000000000..d5b41159d43b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class NetworkInterfaceResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(NetworkInterfaceResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(NetworkInterfaceName)) + { + writer.WritePropertyName("networkInterfaceName"u8); + writer.WriteStringValue(NetworkInterfaceName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + NetworkInterfaceResourceNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(NetworkInterfaceResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeNetworkInterfaceResourceNames(document.RootElement, options); + } + + internal static NetworkInterfaceResourceNames DeserializeNetworkInterfaceResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string networkInterfaceName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("networkInterfaceName"u8)) + { + networkInterfaceName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new NetworkInterfaceResourceNames(networkInterfaceName, serializedAdditionalRawData); + } + + BinaryData 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(NetworkInterfaceResourceNames)} does not support writing '{options.Format}' format."); + } + } + + NetworkInterfaceResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeNetworkInterfaceResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(NetworkInterfaceResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.cs new file mode 100644 index 000000000000..44b73d795b66 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/NetworkInterfaceResourceNames.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.SapVirtualInstances.Models +{ + /// The resource names object for network interface and related resources. + public partial class NetworkInterfaceResourceNames + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 NetworkInterfaceResourceNames() + { + } + + /// Initializes a new instance of . + /// The full name for network interface. If name is not provided, service uses a default name based on the deployment type. For SingleServer, default name is {SID}-Nic. In case of HA-AvZone systems, default name will be {SID}-{App/ASCS/DB}-Zone{A/B}-Nic with an incrementor at the end in case of more than 1 instance per layer. For distributed and HA-AvSet systems, default name will be {SID}-{App/ASCS/DB}-Nic with an incrementor at the end in case of more than 1 instance per layer. + /// Keeps track of any properties unknown to the library. + internal NetworkInterfaceResourceNames(string networkInterfaceName, IDictionary serializedAdditionalRawData) + { + NetworkInterfaceName = networkInterfaceName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The full name for network interface. If name is not provided, service uses a default name based on the deployment type. For SingleServer, default name is {SID}-Nic. In case of HA-AvZone systems, default name will be {SID}-{App/ASCS/DB}-Zone{A/B}-Nic with an incrementor at the end in case of more than 1 instance per layer. For distributed and HA-AvSet systems, default name will be {SID}-{App/ASCS/DB}-Nic with an incrementor at the end in case of more than 1 instance per layer. + public string NetworkInterfaceName { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.Serialization.cs new file mode 100644 index 000000000000..3a58ecaea8ba --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownOSConfiguration))] + public partial class OSConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(OSConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("osType"u8); + writer.WriteStringValue(OSType.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 + } + } + } + + OSConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OSConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOSConfiguration(document.RootElement, options); + } + + internal static OSConfiguration DeserializeOSConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("osType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Linux": return LinuxConfiguration.DeserializeLinuxConfiguration(element, options); + case "Windows": return WindowsConfiguration.DeserializeWindowsConfiguration(element, options); + } + } + return UnknownOSConfiguration.DeserializeUnknownOSConfiguration(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(OSConfiguration)} does not support writing '{options.Format}' format."); + } + } + + OSConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOSConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OSConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.cs new file mode 100644 index 000000000000..f5348cf70e97 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSConfiguration.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.SapVirtualInstances.Models +{ + /// + /// Defines the OS configuration. + /// 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 OSConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 OSConfiguration() + { + } + + /// Initializes a new instance of . + /// The OS Type. + /// Keeps track of any properties unknown to the library. + internal OSConfiguration(OSType osType, IDictionary serializedAdditionalRawData) + { + OSType = osType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The OS Type. + internal OSType OSType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.Serialization.cs new file mode 100644 index 000000000000..9c8146d08f74 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.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.SapVirtualInstances.Models +{ + public partial class OSProfile : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(OSProfile)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(AdminUsername)) + { + writer.WritePropertyName("adminUsername"u8); + writer.WriteStringValue(AdminUsername); + } + if (Optional.IsDefined(AdminPassword)) + { + writer.WritePropertyName("adminPassword"u8); + writer.WriteStringValue(AdminPassword); + } + if (Optional.IsDefined(OSConfiguration)) + { + writer.WritePropertyName("osConfiguration"u8); + writer.WriteObjectValue(OSConfiguration, 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 + } + } + } + + OSProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OSProfile)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOSProfile(document.RootElement, options); + } + + internal static OSProfile DeserializeOSProfile(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string adminUsername = default; + string adminPassword = default; + OSConfiguration osConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("adminUsername"u8)) + { + adminUsername = property.Value.GetString(); + continue; + } + if (property.NameEquals("adminPassword"u8)) + { + adminPassword = property.Value.GetString(); + continue; + } + if (property.NameEquals("osConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + osConfiguration = OSConfiguration.DeserializeOSConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OSProfile(adminUsername, adminPassword, osConfiguration, serializedAdditionalRawData); + } + + BinaryData 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(OSProfile)} does not support writing '{options.Format}' format."); + } + } + + OSProfile IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOSProfile(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OSProfile)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.cs new file mode 100644 index 000000000000..b90bef9c789e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSProfile.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.SapVirtualInstances.Models +{ + /// Specifies the operating system settings for the virtual machine. Some of the settings cannot be changed once VM is provisioned. + public partial class OSProfile + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 OSProfile() + { + } + + /// Initializes a new instance of . + /// Specifies the name of the administrator account. <br><br> This property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters. + /// Specifies the password of the administrator account. <br><br> **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + /// + /// Specifies Windows operating system settings on the virtual machine. + /// 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 OSProfile(string adminUsername, string adminPassword, OSConfiguration osConfiguration, IDictionary serializedAdditionalRawData) + { + AdminUsername = adminUsername; + AdminPassword = adminPassword; + OSConfiguration = osConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the name of the administrator account. <br><br> This property cannot be updated after the VM is created. <br><br> **Windows-only restriction:** Cannot end in "." <br><br> **Disallowed values:** "administrator", "admin", "user", "user1", "test", "user2", "test1", "user3", "admin1", "1", "123", "a", "actuser", "adm", "admin2", "aspnet", "backup", "console", "david", "guest", "john", "owner", "root", "server", "sql", "support", "support_388945a0", "sys", "test2", "test3", "user4", "user5". <br><br> **Minimum-length (Linux):** 1 character <br><br> **Max-length (Linux):** 64 characters <br><br> **Max-length (Windows):** 20 characters. + public string AdminUsername { get; set; } + /// Specifies the password of the administrator account. <br><br> **Minimum-length (Windows):** 8 characters <br><br> **Minimum-length (Linux):** 6 characters <br><br> **Max-length (Windows):** 123 characters <br><br> **Max-length (Linux):** 72 characters <br><br> **Complexity requirements:** 3 out of 4 conditions below need to be fulfilled <br> Has lower characters <br>Has upper characters <br> Has a digit <br> Has a special character (Regex match [\W_]) <br><br> **Disallowed values:** "abc@123", "P@$$w0rd", "P@ssw0rd", "P@ssword123", "Pa$$word", "pass@word1", "Password!", "Password1", "Password22", "iloveyou!" <br><br> For resetting the password, see [How to reset the Remote Desktop service or its login password in a Windows VM](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/reset-rdp) <br><br> For resetting root password, see [Manage users, SSH, and check or repair disks on Azure Linux VMs using the VMAccess Extension](https://learn.microsoft.com/troubleshoot/azure/virtual-machines/troubleshoot-ssh-connection). + public string AdminPassword { get; set; } + /// + /// Specifies Windows operating system settings on the virtual machine. + /// 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 OSConfiguration OSConfiguration { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.Serialization.cs new file mode 100644 index 000000000000..0c26d26478e7 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.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.SapVirtualInstances.Models +{ + public partial class OSSapConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(OSSapConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(DeployerVmPackages)) + { + writer.WritePropertyName("deployerVmPackages"u8); + writer.WriteObjectValue(DeployerVmPackages, options); + } + if (Optional.IsDefined(SapFqdn)) + { + writer.WritePropertyName("sapFqdn"u8); + writer.WriteStringValue(SapFqdn); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + OSSapConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OSSapConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOSSapConfiguration(document.RootElement, options); + } + + internal static OSSapConfiguration DeserializeOSSapConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DeployerVmPackages deployerVmPackages = default; + string sapFqdn = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deployerVmPackages"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deployerVmPackages = DeployerVmPackages.DeserializeDeployerVmPackages(property.Value, options); + continue; + } + if (property.NameEquals("sapFqdn"u8)) + { + sapFqdn = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OSSapConfiguration(deployerVmPackages, sapFqdn, serializedAdditionalRawData); + } + + BinaryData 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(OSSapConfiguration)} does not support writing '{options.Format}' format."); + } + } + + OSSapConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOSSapConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OSSapConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.cs new file mode 100644 index 000000000000..c1435f2ce3f4 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSSapConfiguration.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.SapVirtualInstances.Models +{ + /// Defines the OS and SAP Configurations for Deployment. + public partial class OSSapConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 OSSapConfiguration() + { + } + + /// Initializes a new instance of . + /// The url and storage account ID where deployer VM packages are uploaded. + /// The FQDN to set for the SAP system. + /// Keeps track of any properties unknown to the library. + internal OSSapConfiguration(DeployerVmPackages deployerVmPackages, string sapFqdn, IDictionary serializedAdditionalRawData) + { + DeployerVmPackages = deployerVmPackages; + SapFqdn = sapFqdn; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The url and storage account ID where deployer VM packages are uploaded. + public DeployerVmPackages DeployerVmPackages { get; set; } + /// The FQDN to set for the SAP system. + public string SapFqdn { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSType.cs new file mode 100644 index 000000000000..c7ee614b79b8 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OSType.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.SapVirtualInstances.Models +{ + /// The OS Type. + internal readonly partial struct OSType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public OSType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string LinuxValue = "Linux"; + private const string WindowsValue = "Windows"; + + /// Linux OS Type. + public static OSType Linux { get; } = new OSType(LinuxValue); + /// Windows OS Type. + public static OSType Windows { get; } = new OSType(WindowsValue); + /// Determines if two values are the same. + public static bool operator ==(OSType left, OSType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(OSType left, OSType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator OSType(string value) => new OSType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is OSType other && Equals(other); + /// + public bool Equals(OSType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.Serialization.cs new file mode 100644 index 000000000000..45b057114b3f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.Serialization.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class OperationStatusResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(OperationStatusResult)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Id)) + { + writer.WritePropertyName("id"u8); + writer.WriteStringValue(Id); + } + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status); + if (Optional.IsDefined(PercentComplete)) + { + writer.WritePropertyName("percentComplete"u8); + writer.WriteNumberValue(PercentComplete.Value); + } + if (Optional.IsDefined(StartOn)) + { + writer.WritePropertyName("startTime"u8); + writer.WriteStringValue(StartOn.Value, "O"); + } + if (Optional.IsDefined(EndOn)) + { + writer.WritePropertyName("endTime"u8); + writer.WriteStringValue(EndOn.Value, "O"); + } + if (Optional.IsCollectionDefined(Operations)) + { + writer.WritePropertyName("operations"u8); + writer.WriteStartArray(); + foreach (var item in Operations) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(Error)) + { + writer.WritePropertyName("error"u8); + JsonSerializer.Serialize(writer, Error); + } + if (options.Format != "W" && Optional.IsDefined(ResourceId)) + { + writer.WritePropertyName("resourceId"u8); + writer.WriteStringValue(ResourceId); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + OperationStatusResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OperationStatusResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOperationStatusResult(document.RootElement, options); + } + + internal static OperationStatusResult DeserializeOperationStatusResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + string status = default; + double? percentComplete = default; + DateTimeOffset? startTime = default; + DateTimeOffset? endTime = default; + IReadOnlyList operations = default; + ResponseError error = default; + string resourceId = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("status"u8)) + { + status = property.Value.GetString(); + continue; + } + if (property.NameEquals("percentComplete"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + percentComplete = property.Value.GetDouble(); + continue; + } + if (property.NameEquals("startTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("endTime"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + endTime = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("operations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DeserializeOperationStatusResult(item, options)); + } + operations = array; + continue; + } + if (property.NameEquals("error"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + error = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("resourceId"u8)) + { + resourceId = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new OperationStatusResult( + id, + name, + status, + percentComplete, + startTime, + endTime, + operations ?? new ChangeTrackingList(), + error, + resourceId, + serializedAdditionalRawData); + } + + BinaryData 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(OperationStatusResult)} does not support writing '{options.Format}' format."); + } + } + + OperationStatusResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOperationStatusResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OperationStatusResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.cs new file mode 100644 index 000000000000..37b47a98223c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/OperationStatusResult.cs @@ -0,0 +1,109 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The current status of an async operation. + public partial class OperationStatusResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Operation status. + /// is null. + internal OperationStatusResult(string status) + { + Argument.AssertNotNull(status, nameof(status)); + + Status = status; + Operations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Fully qualified ID for the async operation. + /// Name of the async operation. + /// Operation status. + /// Percent of the operation that is complete. + /// The start time of the operation. + /// The end time of the operation. + /// The operations list. + /// If present, details of the operation error. + /// Fully qualified ID of the resource against which the original async operation was started. + /// Keeps track of any properties unknown to the library. + internal OperationStatusResult(ResourceIdentifier id, string name, string status, double? percentComplete, DateTimeOffset? startOn, DateTimeOffset? endOn, IReadOnlyList operations, ResponseError error, string resourceId, IDictionary serializedAdditionalRawData) + { + Id = id; + Name = name; + Status = status; + PercentComplete = percentComplete; + StartOn = startOn; + EndOn = endOn; + Operations = operations; + Error = error; + ResourceId = resourceId; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal OperationStatusResult() + { + } + + /// Fully qualified ID for the async operation. + public ResourceIdentifier Id { get; } + /// Name of the async operation. + public string Name { get; } + /// Operation status. + public string Status { get; } + /// Percent of the operation that is complete. + public double? PercentComplete { get; } + /// The start time of the operation. + public DateTimeOffset? StartOn { get; } + /// The end time of the operation. + public DateTimeOffset? EndOn { get; } + /// The operations list. + public IReadOnlyList Operations { get; } + /// If present, details of the operation error. + public ResponseError Error { get; } + /// Fully qualified ID of the resource against which the original async operation was started. + public string ResourceId { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.Serialization.cs new file mode 100644 index 000000000000..8f88985f2845 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.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.SapVirtualInstances.Models +{ + internal partial class SAPApplicationServerInstanceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SAPApplicationServerInstanceListResult)} 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 + } + } + } + + SAPApplicationServerInstanceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SAPApplicationServerInstanceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSAPApplicationServerInstanceListResult(document.RootElement, options); + } + + internal static SAPApplicationServerInstanceListResult DeserializeSAPApplicationServerInstanceListResult(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(SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(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 SAPApplicationServerInstanceListResult(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(SAPApplicationServerInstanceListResult)} does not support writing '{options.Format}' format."); + } + } + + SAPApplicationServerInstanceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSAPApplicationServerInstanceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SAPApplicationServerInstanceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.cs new file mode 100644 index 000000000000..489d532757e6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPApplicationServerInstanceListResult.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.SapVirtualInstances.Models +{ + /// The response of a SAPApplicationServerInstance list operation. + internal partial class SAPApplicationServerInstanceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SAPApplicationServerInstance items on this page. + /// is null. + internal SAPApplicationServerInstanceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SAPApplicationServerInstance items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SAPApplicationServerInstanceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SAPApplicationServerInstanceListResult() + { + } + + /// The SAPApplicationServerInstance items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.Serialization.cs new file mode 100644 index 000000000000..0cdf65d9239c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.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.SapVirtualInstances.Models +{ + internal partial class SAPCentralServerInstanceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SAPCentralServerInstanceListResult)} 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 + } + } + } + + SAPCentralServerInstanceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SAPCentralServerInstanceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSAPCentralServerInstanceListResult(document.RootElement, options); + } + + internal static SAPCentralServerInstanceListResult DeserializeSAPCentralServerInstanceListResult(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(SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(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 SAPCentralServerInstanceListResult(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(SAPCentralServerInstanceListResult)} does not support writing '{options.Format}' format."); + } + } + + SAPCentralServerInstanceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSAPCentralServerInstanceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SAPCentralServerInstanceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.cs new file mode 100644 index 000000000000..e96dcd7dc003 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPCentralServerInstanceListResult.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.SapVirtualInstances.Models +{ + /// The response of a SAPCentralServerInstance list operation. + internal partial class SAPCentralServerInstanceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SAPCentralServerInstance items on this page. + /// is null. + internal SAPCentralServerInstanceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SAPCentralServerInstance items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SAPCentralServerInstanceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SAPCentralServerInstanceListResult() + { + } + + /// The SAPCentralServerInstance items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.Serialization.cs new file mode 100644 index 000000000000..736ad4e1a067 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.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.SapVirtualInstances.Models +{ + internal partial class SAPDatabaseInstanceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SAPDatabaseInstanceListResult)} 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 + } + } + } + + SAPDatabaseInstanceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SAPDatabaseInstanceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSAPDatabaseInstanceListResult(document.RootElement, options); + } + + internal static SAPDatabaseInstanceListResult DeserializeSAPDatabaseInstanceListResult(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(SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(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 SAPDatabaseInstanceListResult(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(SAPDatabaseInstanceListResult)} does not support writing '{options.Format}' format."); + } + } + + SAPDatabaseInstanceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSAPDatabaseInstanceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SAPDatabaseInstanceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.cs new file mode 100644 index 000000000000..e1105767d0dc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPDatabaseInstanceListResult.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.SapVirtualInstances.Models +{ + /// The response of a SAPDatabaseInstance list operation. + internal partial class SAPDatabaseInstanceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SAPDatabaseInstance items on this page. + /// is null. + internal SAPDatabaseInstanceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SAPDatabaseInstance items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SAPDatabaseInstanceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SAPDatabaseInstanceListResult() + { + } + + /// The SAPDatabaseInstance items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.Serialization.cs new file mode 100644 index 000000000000..c50410d992b3 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.Serialization.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class SAPVirtualInstanceIdentity : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SAPVirtualInstanceIdentity)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("type"u8); + writer.WriteStringValue(Type.ToString()); + if (Optional.IsCollectionDefined(UserAssignedIdentities)) + { + writer.WritePropertyName("userAssignedIdentities"u8); + writer.WriteStartObject(); + foreach (var item in UserAssignedIdentities) + { + writer.WritePropertyName(item.Key); + JsonSerializer.Serialize(writer, 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 + } + } + } + + SAPVirtualInstanceIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SAPVirtualInstanceIdentity)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSAPVirtualInstanceIdentity(document.RootElement, options); + } + + internal static SAPVirtualInstanceIdentity DeserializeSAPVirtualInstanceIdentity(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SAPVirtualInstanceIdentityType type = default; + IDictionary userAssignedIdentities = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("type"u8)) + { + type = new SAPVirtualInstanceIdentityType(property.Value.GetString()); + continue; + } + if (property.NameEquals("userAssignedIdentities"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, JsonSerializer.Deserialize(property0.Value.GetRawText())); + } + userAssignedIdentities = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SAPVirtualInstanceIdentity(type, userAssignedIdentities ?? 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(SAPVirtualInstanceIdentity)} does not support writing '{options.Format}' format."); + } + } + + SAPVirtualInstanceIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSAPVirtualInstanceIdentity(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SAPVirtualInstanceIdentity)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.cs new file mode 100644 index 000000000000..8067eca50865 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentity.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; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Managed service identity (user assigned identities). + public partial class SAPVirtualInstanceIdentity + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 type of managed identity assigned to this resource. + public SAPVirtualInstanceIdentity(SAPVirtualInstanceIdentityType type) + { + Type = type; + UserAssignedIdentities = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The type of managed identity assigned to this resource. + /// The identities assigned to this resource by the user. + /// Keeps track of any properties unknown to the library. + internal SAPVirtualInstanceIdentity(SAPVirtualInstanceIdentityType type, IDictionary userAssignedIdentities, IDictionary serializedAdditionalRawData) + { + Type = type; + UserAssignedIdentities = userAssignedIdentities; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SAPVirtualInstanceIdentity() + { + } + + /// The type of managed identity assigned to this resource. + public SAPVirtualInstanceIdentityType Type { get; set; } + /// The identities assigned to this resource by the user. + public IDictionary UserAssignedIdentities { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentityType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentityType.cs new file mode 100644 index 000000000000..8d542c8db648 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceIdentityType.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.SapVirtualInstances.Models +{ + /// Type of managed service identity (where only None and UserAssigned types are allowed). + public readonly partial struct SAPVirtualInstanceIdentityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SAPVirtualInstanceIdentityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NoneValue = "None"; + private const string UserAssignedValue = "UserAssigned"; + + /// No managed identity. + public static SAPVirtualInstanceIdentityType None { get; } = new SAPVirtualInstanceIdentityType(NoneValue); + /// User assigned managed identity. + public static SAPVirtualInstanceIdentityType UserAssigned { get; } = new SAPVirtualInstanceIdentityType(UserAssignedValue); + /// Determines if two values are the same. + public static bool operator ==(SAPVirtualInstanceIdentityType left, SAPVirtualInstanceIdentityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SAPVirtualInstanceIdentityType left, SAPVirtualInstanceIdentityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SAPVirtualInstanceIdentityType(string value) => new SAPVirtualInstanceIdentityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SAPVirtualInstanceIdentityType other && Equals(other); + /// + public bool Equals(SAPVirtualInstanceIdentityType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.Serialization.cs new file mode 100644 index 000000000000..9323baf845fa --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.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.SapVirtualInstances.Models +{ + internal partial class SAPVirtualInstanceListResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SAPVirtualInstanceListResult)} 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 + } + } + } + + SAPVirtualInstanceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SAPVirtualInstanceListResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSAPVirtualInstanceListResult(document.RootElement, options); + } + + internal static SAPVirtualInstanceListResult DeserializeSAPVirtualInstanceListResult(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(SapVirtualInstanceData.DeserializeSapVirtualInstanceData(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 SAPVirtualInstanceListResult(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(SAPVirtualInstanceListResult)} does not support writing '{options.Format}' format."); + } + } + + SAPVirtualInstanceListResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSAPVirtualInstanceListResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SAPVirtualInstanceListResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.cs new file mode 100644 index 000000000000..5b521df7e308 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SAPVirtualInstanceListResult.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.SapVirtualInstances.Models +{ + /// The response of a SAPVirtualInstance list operation. + internal partial class SAPVirtualInstanceListResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SAPVirtualInstance items on this page. + /// is null. + internal SAPVirtualInstanceListResult(IEnumerable value) + { + Argument.AssertNotNull(value, nameof(value)); + + Value = value.ToList(); + } + + /// Initializes a new instance of . + /// The SAPVirtualInstance items on this page. + /// The link to the next page of items. + /// Keeps track of any properties unknown to the library. + internal SAPVirtualInstanceListResult(IReadOnlyList value, Uri nextLink, IDictionary serializedAdditionalRawData) + { + Value = value; + NextLink = nextLink; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SAPVirtualInstanceListResult() + { + } + + /// The SAPVirtualInstance items on this page. + public IReadOnlyList Value { get; } + /// The link to the next page of items. + public Uri NextLink { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.Serialization.cs new file mode 100644 index 000000000000..8d5b49002b4f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.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.SapVirtualInstances.Models +{ + public partial class SapApplicationServerInstancePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapApplicationServerInstancePatch)} 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 + } + } + } + + SapApplicationServerInstancePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapApplicationServerInstancePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapApplicationServerInstancePatch(document.RootElement, options); + } + + internal static SapApplicationServerInstancePatch DeserializeSapApplicationServerInstancePatch(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 SapApplicationServerInstancePatch(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(SapApplicationServerInstancePatch)} does not support writing '{options.Format}' format."); + } + } + + SapApplicationServerInstancePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapApplicationServerInstancePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapApplicationServerInstancePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.cs new file mode 100644 index 000000000000..15de09ef1995 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerInstancePatch.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.SapVirtualInstances.Models +{ + /// Defines the request body for updating SAP Application Instance. + public partial class SapApplicationServerInstancePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapApplicationServerInstancePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Gets or sets the Resource tags. + /// Keeps track of any properties unknown to the library. + internal SapApplicationServerInstancePatch(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.Serialization.cs new file mode 100644 index 000000000000..b80b8c544d77 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.Serialization.cs @@ -0,0 +1,358 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapApplicationServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapApplicationServerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(InstanceNo)) + { + writer.WritePropertyName("instanceNo"u8); + writer.WriteStringValue(InstanceNo); + } + if (options.Format != "W" && Optional.IsDefined(Subnet)) + { + writer.WritePropertyName("subnet"u8); + writer.WriteStringValue(Subnet); + } + if (options.Format != "W" && Optional.IsDefined(Hostname)) + { + writer.WritePropertyName("hostname"u8); + writer.WriteStringValue(Hostname); + } + if (options.Format != "W" && Optional.IsDefined(KernelVersion)) + { + writer.WritePropertyName("kernelVersion"u8); + writer.WriteStringValue(KernelVersion); + } + if (options.Format != "W" && Optional.IsDefined(KernelPatch)) + { + writer.WritePropertyName("kernelPatch"u8); + writer.WriteStringValue(KernelPatch); + } + if (options.Format != "W" && Optional.IsDefined(IPAddress)) + { + writer.WritePropertyName("ipAddress"u8); + writer.WriteStringValue(IPAddress); + } + if (options.Format != "W" && Optional.IsDefined(GatewayPort)) + { + writer.WritePropertyName("gatewayPort"u8); + writer.WriteNumberValue(GatewayPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(IcmHttpPort)) + { + writer.WritePropertyName("icmHttpPort"u8); + writer.WriteNumberValue(IcmHttpPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(IcmHttpsPort)) + { + writer.WritePropertyName("icmHttpsPort"u8); + writer.WriteNumberValue(IcmHttpsPort.Value); + } + if (options.Format != "W" && Optional.IsDefined(DispatcherStatus)) + { + writer.WritePropertyName("dispatcherStatus"u8); + writer.WriteStringValue(DispatcherStatus); + } + if (options.Format != "W" && Optional.IsDefined(LoadBalancerDetails)) + { + writer.WritePropertyName("loadBalancerDetails"u8); + JsonSerializer.Serialize(writer, LoadBalancerDetails); + } + if (options.Format != "W" && Optional.IsCollectionDefined(VmDetails)) + { + writer.WritePropertyName("vmDetails"u8); + writer.WriteStartArray(); + foreach (var item in VmDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteObjectValue(Errors, 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 + } + } + } + + SapApplicationServerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapApplicationServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapApplicationServerProperties(document.RootElement, options); + } + + internal static SapApplicationServerProperties DeserializeSapApplicationServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceNo = default; + string subnet = default; + string hostname = default; + string kernelVersion = default; + string kernelPatch = default; + string ipAddress = default; + long? gatewayPort = default; + long? icmHttpPort = default; + long? icmHttpsPort = default; + string dispatcherStatus = default; + SubResource loadBalancerDetails = default; + IReadOnlyList vmDetails = default; + SapVirtualInstanceStatus? status = default; + SapHealthState? health = default; + SapVirtualInstanceProvisioningState? provisioningState = default; + SapVirtualInstanceError errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceNo"u8)) + { + instanceNo = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnet"u8)) + { + subnet = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostname"u8)) + { + hostname = property.Value.GetString(); + continue; + } + if (property.NameEquals("kernelVersion"u8)) + { + kernelVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("kernelPatch"u8)) + { + kernelPatch = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("gatewayPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gatewayPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("icmHttpPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + icmHttpPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("icmHttpsPort"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + icmHttpsPort = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("dispatcherStatus"u8)) + { + dispatcherStatus = property.Value.GetString(); + continue; + } + if (property.NameEquals("loadBalancerDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loadBalancerDetails = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("vmDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(ApplicationServerVmDetails.DeserializeApplicationServerVmDetails(item, options)); + } + vmDetails = array; + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new SapVirtualInstanceStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new SapVirtualInstanceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errors = SapVirtualInstanceError.DeserializeSapVirtualInstanceError(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapApplicationServerProperties( + instanceNo, + subnet, + hostname, + kernelVersion, + kernelPatch, + ipAddress, + gatewayPort, + icmHttpPort, + icmHttpsPort, + dispatcherStatus, + loadBalancerDetails, + vmDetails ?? new ChangeTrackingList(), + status, + health, + provisioningState, + errors, + serializedAdditionalRawData); + } + + BinaryData 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(SapApplicationServerProperties)} does not support writing '{options.Format}' format."); + } + } + + SapApplicationServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapApplicationServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapApplicationServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.cs new file mode 100644 index 000000000000..d3d6af0f324d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapApplicationServerProperties.cs @@ -0,0 +1,139 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the SAP Application Server instance properties. + public partial class SapApplicationServerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapApplicationServerProperties() + { + VmDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Application server Instance Number. + /// Application server Subnet. + /// Application server instance SAP hostname. + /// Application server instance SAP Kernel Version. + /// Application server instance SAP Kernel Patch level. + /// Application server instance SAP IP Address. + /// Application server instance gateway Port. + /// Application server instance ICM HTTP Port. + /// Application server instance ICM HTTPS Port. + /// Application server instance dispatcher status. + /// The Load Balancer details such as LoadBalancer ID attached to Application Server Virtual Machines. + /// The list of virtual machines. + /// Defines the SAP Instance status. + /// Defines the health of SAP Instances. + /// Defines the provisioning states. + /// Defines the Application Instance errors. + /// Keeps track of any properties unknown to the library. + internal SapApplicationServerProperties(string instanceNo, string subnet, string hostname, string kernelVersion, string kernelPatch, string ipAddress, long? gatewayPort, long? icmHttpPort, long? icmHttpsPort, string dispatcherStatus, SubResource loadBalancerDetails, IReadOnlyList vmDetails, SapVirtualInstanceStatus? status, SapHealthState? health, SapVirtualInstanceProvisioningState? provisioningState, SapVirtualInstanceError errors, IDictionary serializedAdditionalRawData) + { + InstanceNo = instanceNo; + Subnet = subnet; + Hostname = hostname; + KernelVersion = kernelVersion; + KernelPatch = kernelPatch; + IPAddress = ipAddress; + GatewayPort = gatewayPort; + IcmHttpPort = icmHttpPort; + IcmHttpsPort = icmHttpsPort; + DispatcherStatus = dispatcherStatus; + LoadBalancerDetails = loadBalancerDetails; + VmDetails = vmDetails; + Status = status; + Health = health; + ProvisioningState = provisioningState; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Application server Instance Number. + public string InstanceNo { get; } + /// Application server Subnet. + public string Subnet { get; } + /// Application server instance SAP hostname. + public string Hostname { get; } + /// Application server instance SAP Kernel Version. + public string KernelVersion { get; } + /// Application server instance SAP Kernel Patch level. + public string KernelPatch { get; } + /// Application server instance SAP IP Address. + public string IPAddress { get; } + /// Application server instance gateway Port. + public long? GatewayPort { get; } + /// Application server instance ICM HTTP Port. + public long? IcmHttpPort { get; } + /// Application server instance ICM HTTPS Port. + public long? IcmHttpsPort { get; } + /// Application server instance dispatcher status. + public string DispatcherStatus { get; } + /// The Load Balancer details such as LoadBalancer ID attached to Application Server Virtual Machines. + internal SubResource LoadBalancerDetails { get; } + /// Gets Id. + public ResourceIdentifier LoadBalancerDetailsId + { + get => LoadBalancerDetails?.Id; + } + + /// The list of virtual machines. + public IReadOnlyList VmDetails { get; } + /// Defines the SAP Instance status. + public SapVirtualInstanceStatus? Status { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + /// Defines the provisioning states. + public SapVirtualInstanceProvisioningState? ProvisioningState { get; } + /// Defines the Application Instance errors. + internal SapVirtualInstanceError Errors { get; } + /// The Virtual Instance for SAP error body. + public ErrorInformation ErrorsProperties + { + get => Errors?.Properties; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.Serialization.cs new file mode 100644 index 000000000000..84ae745e1857 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapAvailabilityZoneDetailsContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapAvailabilityZoneDetailsContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + writer.WritePropertyName("sapProduct"u8); + writer.WriteStringValue(SapProduct.ToString()); + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType.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 + } + } + } + + SapAvailabilityZoneDetailsContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapAvailabilityZoneDetailsContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapAvailabilityZoneDetailsContent(document.RootElement, options); + } + + internal static SapAvailabilityZoneDetailsContent DeserializeSapAvailabilityZoneDetailsContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appLocation = default; + SapProductType sapProduct = default; + SapDatabaseType databaseType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("sapProduct"u8)) + { + sapProduct = new SapProductType(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseType"u8)) + { + databaseType = new SapDatabaseType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapAvailabilityZoneDetailsContent(appLocation, sapProduct, databaseType, serializedAdditionalRawData); + } + + BinaryData 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(SapAvailabilityZoneDetailsContent)} does not support writing '{options.Format}' format."); + } + } + + SapAvailabilityZoneDetailsContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapAvailabilityZoneDetailsContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapAvailabilityZoneDetailsContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.cs new file mode 100644 index 000000000000..1e7a1d088400 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsContent.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP request to get list of availability zones. + public partial class SapAvailabilityZoneDetailsContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 geo-location where the SAP resources will be created. + /// Defines the SAP Product type. + /// The database type. Eg: HANA, DB2, etc. + /// is null. + public SapAvailabilityZoneDetailsContent(string appLocation, SapProductType sapProduct, SapDatabaseType databaseType) + { + Argument.AssertNotNull(appLocation, nameof(appLocation)); + + AppLocation = appLocation; + SapProduct = sapProduct; + DatabaseType = databaseType; + } + + /// Initializes a new instance of . + /// The geo-location where the SAP resources will be created. + /// Defines the SAP Product type. + /// The database type. Eg: HANA, DB2, etc. + /// Keeps track of any properties unknown to the library. + internal SapAvailabilityZoneDetailsContent(string appLocation, SapProductType sapProduct, SapDatabaseType databaseType, IDictionary serializedAdditionalRawData) + { + AppLocation = appLocation; + SapProduct = sapProduct; + DatabaseType = databaseType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapAvailabilityZoneDetailsContent() + { + } + + /// The geo-location where the SAP resources will be created. + public string AppLocation { get; } + /// Defines the SAP Product type. + public SapProductType SapProduct { get; } + /// The database type. Eg: HANA, DB2, etc. + public SapDatabaseType DatabaseType { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.Serialization.cs new file mode 100644 index 000000000000..937db7ab100a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapAvailabilityZoneDetailsResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapAvailabilityZoneDetailsResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(AvailabilityZonePairs)) + { + writer.WritePropertyName("availabilityZonePairs"u8); + writer.WriteStartArray(); + foreach (var item in AvailabilityZonePairs) + { + 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 + } + } + } + + SapAvailabilityZoneDetailsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapAvailabilityZoneDetailsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapAvailabilityZoneDetailsResult(document.RootElement, options); + } + + internal static SapAvailabilityZoneDetailsResult DeserializeSapAvailabilityZoneDetailsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList availabilityZonePairs = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("availabilityZonePairs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SapAvailabilityZonePair.DeserializeSapAvailabilityZonePair(item, options)); + } + availabilityZonePairs = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapAvailabilityZoneDetailsResult(availabilityZonePairs ?? 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(SapAvailabilityZoneDetailsResult)} does not support writing '{options.Format}' format."); + } + } + + SapAvailabilityZoneDetailsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapAvailabilityZoneDetailsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapAvailabilityZoneDetailsResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.cs new file mode 100644 index 000000000000..d0f35ceb0bb2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZoneDetailsResult.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.SapVirtualInstances.Models +{ + /// The list of supported availability zone pairs which are part of SAP HA deployment. + public partial class SapAvailabilityZoneDetailsResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapAvailabilityZoneDetailsResult() + { + AvailabilityZonePairs = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets the list of availability zone pairs. + /// Keeps track of any properties unknown to the library. + internal SapAvailabilityZoneDetailsResult(IReadOnlyList availabilityZonePairs, IDictionary serializedAdditionalRawData) + { + AvailabilityZonePairs = availabilityZonePairs; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the list of availability zone pairs. + public IReadOnlyList AvailabilityZonePairs { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.Serialization.cs new file mode 100644 index 000000000000..e40898672dfe --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.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.SapVirtualInstances.Models +{ + public partial class SapAvailabilityZonePair : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapAvailabilityZonePair)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ZoneA)) + { + writer.WritePropertyName("zoneA"u8); + writer.WriteNumberValue(ZoneA.Value); + } + if (Optional.IsDefined(ZoneB)) + { + writer.WritePropertyName("zoneB"u8); + writer.WriteNumberValue(ZoneB.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 + } + } + } + + SapAvailabilityZonePair IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapAvailabilityZonePair)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapAvailabilityZonePair(document.RootElement, options); + } + + internal static SapAvailabilityZonePair DeserializeSapAvailabilityZonePair(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? zoneA = default; + long? zoneB = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("zoneA"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoneA = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("zoneB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + zoneB = property.Value.GetInt64(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapAvailabilityZonePair(zoneA, zoneB, serializedAdditionalRawData); + } + + BinaryData 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(SapAvailabilityZonePair)} does not support writing '{options.Format}' format."); + } + } + + SapAvailabilityZonePair IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapAvailabilityZonePair(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapAvailabilityZonePair)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.cs new file mode 100644 index 000000000000..81233b446ae0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapAvailabilityZonePair.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.SapVirtualInstances.Models +{ + /// The SAP Availability Zone Pair. + public partial class SapAvailabilityZonePair + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapAvailabilityZonePair() + { + } + + /// Initializes a new instance of . + /// The zone A. + /// The zone B. + /// Keeps track of any properties unknown to the library. + internal SapAvailabilityZonePair(long? zoneA, long? zoneB, IDictionary serializedAdditionalRawData) + { + ZoneA = zoneA; + ZoneB = zoneB; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The zone A. + public long? ZoneA { get; } + /// The zone B. + public long? ZoneB { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.Serialization.cs new file mode 100644 index 000000000000..edebc5826924 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.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.SapVirtualInstances.Models +{ + public partial class SapCentralServerInstancePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapCentralServerInstancePatch)} 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 + } + } + } + + SapCentralServerInstancePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapCentralServerInstancePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapCentralServerInstancePatch(document.RootElement, options); + } + + internal static SapCentralServerInstancePatch DeserializeSapCentralServerInstancePatch(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 SapCentralServerInstancePatch(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(SapCentralServerInstancePatch)} does not support writing '{options.Format}' format."); + } + } + + SapCentralServerInstancePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapCentralServerInstancePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapCentralServerInstancePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.cs new file mode 100644 index 000000000000..9b4349b1b46b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerInstancePatch.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.SapVirtualInstances.Models +{ + /// Defines the request body for updating SAP Central Instance. + public partial class SapCentralServerInstancePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapCentralServerInstancePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Gets or sets the Resource tags. + /// Keeps track of any properties unknown to the library. + internal SapCentralServerInstancePatch(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.Serialization.cs new file mode 100644 index 000000000000..99fac271dd87 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.Serialization.cs @@ -0,0 +1,338 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapCentralServerProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapCentralServerProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(InstanceNo)) + { + writer.WritePropertyName("instanceNo"u8); + writer.WriteStringValue(InstanceNo); + } + if (options.Format != "W" && Optional.IsDefined(Subnet)) + { + writer.WritePropertyName("subnet"u8); + writer.WriteStringValue(Subnet); + } + if (Optional.IsDefined(MessageServerProperties)) + { + writer.WritePropertyName("messageServerProperties"u8); + writer.WriteObjectValue(MessageServerProperties, options); + } + if (Optional.IsDefined(EnqueueServerProperties)) + { + writer.WritePropertyName("enqueueServerProperties"u8); + writer.WriteObjectValue(EnqueueServerProperties, options); + } + if (Optional.IsDefined(GatewayServerProperties)) + { + writer.WritePropertyName("gatewayServerProperties"u8); + writer.WriteObjectValue(GatewayServerProperties, options); + } + if (Optional.IsDefined(EnqueueReplicationServerProperties)) + { + writer.WritePropertyName("enqueueReplicationServerProperties"u8); + writer.WriteObjectValue(EnqueueReplicationServerProperties, options); + } + if (options.Format != "W" && Optional.IsDefined(KernelVersion)) + { + writer.WritePropertyName("kernelVersion"u8); + writer.WriteStringValue(KernelVersion); + } + if (options.Format != "W" && Optional.IsDefined(KernelPatch)) + { + writer.WritePropertyName("kernelPatch"u8); + writer.WriteStringValue(KernelPatch); + } + if (options.Format != "W" && Optional.IsDefined(LoadBalancerDetails)) + { + writer.WritePropertyName("loadBalancerDetails"u8); + JsonSerializer.Serialize(writer, LoadBalancerDetails); + } + if (options.Format != "W" && Optional.IsCollectionDefined(VmDetails)) + { + writer.WritePropertyName("vmDetails"u8); + writer.WriteStartArray(); + foreach (var item in VmDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteObjectValue(Errors, 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 + } + } + } + + SapCentralServerProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapCentralServerProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapCentralServerProperties(document.RootElement, options); + } + + internal static SapCentralServerProperties DeserializeSapCentralServerProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string instanceNo = default; + string subnet = default; + MessageServerProperties messageServerProperties = default; + EnqueueServerProperties enqueueServerProperties = default; + GatewayServerProperties gatewayServerProperties = default; + EnqueueReplicationServerProperties enqueueReplicationServerProperties = default; + string kernelVersion = default; + string kernelPatch = default; + SubResource loadBalancerDetails = default; + IReadOnlyList vmDetails = default; + SapVirtualInstanceStatus? status = default; + SapHealthState? health = default; + SapVirtualInstanceProvisioningState? provisioningState = default; + SapVirtualInstanceError errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("instanceNo"u8)) + { + instanceNo = property.Value.GetString(); + continue; + } + if (property.NameEquals("subnet"u8)) + { + subnet = property.Value.GetString(); + continue; + } + if (property.NameEquals("messageServerProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + messageServerProperties = MessageServerProperties.DeserializeMessageServerProperties(property.Value, options); + continue; + } + if (property.NameEquals("enqueueServerProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enqueueServerProperties = EnqueueServerProperties.DeserializeEnqueueServerProperties(property.Value, options); + continue; + } + if (property.NameEquals("gatewayServerProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + gatewayServerProperties = GatewayServerProperties.DeserializeGatewayServerProperties(property.Value, options); + continue; + } + if (property.NameEquals("enqueueReplicationServerProperties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enqueueReplicationServerProperties = EnqueueReplicationServerProperties.DeserializeEnqueueReplicationServerProperties(property.Value, options); + continue; + } + if (property.NameEquals("kernelVersion"u8)) + { + kernelVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("kernelPatch"u8)) + { + kernelPatch = property.Value.GetString(); + continue; + } + if (property.NameEquals("loadBalancerDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loadBalancerDetails = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("vmDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CentralServerVmDetails.DeserializeCentralServerVmDetails(item, options)); + } + vmDetails = array; + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new SapVirtualInstanceStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new SapVirtualInstanceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errors = SapVirtualInstanceError.DeserializeSapVirtualInstanceError(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapCentralServerProperties( + instanceNo, + subnet, + messageServerProperties, + enqueueServerProperties, + gatewayServerProperties, + enqueueReplicationServerProperties, + kernelVersion, + kernelPatch, + loadBalancerDetails, + vmDetails ?? new ChangeTrackingList(), + status, + health, + provisioningState, + errors, + serializedAdditionalRawData); + } + + BinaryData 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(SapCentralServerProperties)} does not support writing '{options.Format}' format."); + } + } + + SapCentralServerProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapCentralServerProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapCentralServerProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.cs new file mode 100644 index 000000000000..2c46c90b32bd --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapCentralServerProperties.cs @@ -0,0 +1,131 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the SAP Central Services Instance properties. + public partial class SapCentralServerProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapCentralServerProperties() + { + VmDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The central services instance number. + /// The central services instance subnet. + /// Defines the SAP message server properties. + /// Defines the SAP Enqueue Server properties. + /// Defines the SAP Gateway Server properties. + /// Defines the SAP Enqueue Replication Server (ERS) properties. + /// The central services instance Kernel Version. + /// The central services instance Kernel Patch level. + /// The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual Machines. + /// The list of virtual machines corresponding to the Central Services instance. + /// Defines the SAP Instance status. + /// Defines the health of SAP Instances. + /// Defines the provisioning states. + /// Defines the errors related to SAP Central Services Instance resource. + /// Keeps track of any properties unknown to the library. + internal SapCentralServerProperties(string instanceNo, string subnet, MessageServerProperties messageServerProperties, EnqueueServerProperties enqueueServerProperties, GatewayServerProperties gatewayServerProperties, EnqueueReplicationServerProperties enqueueReplicationServerProperties, string kernelVersion, string kernelPatch, SubResource loadBalancerDetails, IReadOnlyList vmDetails, SapVirtualInstanceStatus? status, SapHealthState? health, SapVirtualInstanceProvisioningState? provisioningState, SapVirtualInstanceError errors, IDictionary serializedAdditionalRawData) + { + InstanceNo = instanceNo; + Subnet = subnet; + MessageServerProperties = messageServerProperties; + EnqueueServerProperties = enqueueServerProperties; + GatewayServerProperties = gatewayServerProperties; + EnqueueReplicationServerProperties = enqueueReplicationServerProperties; + KernelVersion = kernelVersion; + KernelPatch = kernelPatch; + LoadBalancerDetails = loadBalancerDetails; + VmDetails = vmDetails; + Status = status; + Health = health; + ProvisioningState = provisioningState; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The central services instance number. + public string InstanceNo { get; } + /// The central services instance subnet. + public string Subnet { get; } + /// Defines the SAP message server properties. + public MessageServerProperties MessageServerProperties { get; set; } + /// Defines the SAP Enqueue Server properties. + public EnqueueServerProperties EnqueueServerProperties { get; set; } + /// Defines the SAP Gateway Server properties. + public GatewayServerProperties GatewayServerProperties { get; set; } + /// Defines the SAP Enqueue Replication Server (ERS) properties. + public EnqueueReplicationServerProperties EnqueueReplicationServerProperties { get; set; } + /// The central services instance Kernel Version. + public string KernelVersion { get; } + /// The central services instance Kernel Patch level. + public string KernelPatch { get; } + /// The Load Balancer details such as LoadBalancer ID attached to ASCS Virtual Machines. + internal SubResource LoadBalancerDetails { get; } + /// Gets Id. + public ResourceIdentifier LoadBalancerDetailsId + { + get => LoadBalancerDetails?.Id; + } + + /// The list of virtual machines corresponding to the Central Services instance. + public IReadOnlyList VmDetails { get; } + /// Defines the SAP Instance status. + public SapVirtualInstanceStatus? Status { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + /// Defines the provisioning states. + public SapVirtualInstanceProvisioningState? ProvisioningState { get; } + /// Defines the errors related to SAP Central Services Instance resource. + internal SapVirtualInstanceError Errors { get; } + /// The Virtual Instance for SAP error body. + public ErrorInformation ErrorsProperties + { + get => Errors?.Properties; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.Serialization.cs new file mode 100644 index 000000000000..981164c59aad --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownSapConfiguration))] + public partial class SapConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("configurationType"u8); + writer.WriteStringValue(ConfigurationType.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 + } + } + } + + SapConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapConfiguration(document.RootElement, options); + } + + internal static SapConfiguration DeserializeSapConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("configurationType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "Deployment": return DeploymentConfiguration.DeserializeDeploymentConfiguration(element, options); + case "DeploymentWithOSConfig": return DeploymentWithOSConfiguration.DeserializeDeploymentWithOSConfiguration(element, options); + case "Discovery": return DiscoveryConfiguration.DeserializeDiscoveryConfiguration(element, options); + } + } + return UnknownSapConfiguration.DeserializeUnknownSapConfiguration(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(SapConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SapConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.cs new file mode 100644 index 000000000000..1c62e1446f1c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfiguration.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.SapVirtualInstances.Models +{ + /// + /// The SAP Configuration. + /// 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 SapConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 SapConfiguration() + { + } + + /// Initializes a new instance of . + /// The configuration type. Eg: Deployment/Discovery. + /// Keeps track of any properties unknown to the library. + internal SapConfiguration(SapConfigurationType configurationType, IDictionary serializedAdditionalRawData) + { + ConfigurationType = configurationType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The configuration type. Eg: Deployment/Discovery. + internal SapConfigurationType ConfigurationType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfigurationType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfigurationType.cs new file mode 100644 index 000000000000..967f3a80c04e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapConfigurationType.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.SapVirtualInstances.Models +{ + /// The configuration Type. + internal readonly partial struct SapConfigurationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapConfigurationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string DeploymentValue = "Deployment"; + private const string DiscoveryValue = "Discovery"; + private const string DeploymentWithOSConfigValue = "DeploymentWithOSConfig"; + + /// SAP system will be deployed by service. No OS configurations will be done. + public static SapConfigurationType Deployment { get; } = new SapConfigurationType(DeploymentValue); + /// Existing SAP system will be registered. + public static SapConfigurationType Discovery { get; } = new SapConfigurationType(DiscoveryValue); + /// SAP system will be deployed by service. OS configurations will be done. + public static SapConfigurationType DeploymentWithOSConfig { get; } = new SapConfigurationType(DeploymentWithOSConfigValue); + /// Determines if two values are the same. + public static bool operator ==(SapConfigurationType left, SapConfigurationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapConfigurationType left, SapConfigurationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapConfigurationType(string value) => new SapConfigurationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapConfigurationType other && Equals(other); + /// + public bool Equals(SapConfigurationType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.Serialization.cs new file mode 100644 index 000000000000..20de1862597d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.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.SapVirtualInstances.Models +{ + public partial class SapDatabaseInstancePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapDatabaseInstancePatch)} 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 + } + } + } + + SapDatabaseInstancePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapDatabaseInstancePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapDatabaseInstancePatch(document.RootElement, options); + } + + internal static SapDatabaseInstancePatch DeserializeSapDatabaseInstancePatch(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 SapDatabaseInstancePatch(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(SapDatabaseInstancePatch)} does not support writing '{options.Format}' format."); + } + } + + SapDatabaseInstancePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapDatabaseInstancePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapDatabaseInstancePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.cs new file mode 100644 index 000000000000..69919b2cb4dc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseInstancePatch.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.SapVirtualInstances.Models +{ + /// Defines the request body for updating SAP Database Instance. + public partial class SapDatabaseInstancePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapDatabaseInstancePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Gets or sets the Resource tags. + /// Keeps track of any properties unknown to the library. + internal SapDatabaseInstancePatch(IDictionary tags, IDictionary serializedAdditionalRawData) + { + Tags = tags; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the Resource tags. + public IDictionary Tags { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.Serialization.cs new file mode 100644 index 000000000000..38323e7cb353 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.Serialization.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapDatabaseProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapDatabaseProperties)} does not support writing '{format}' format."); + } + + if (options.Format != "W" && Optional.IsDefined(Subnet)) + { + writer.WritePropertyName("subnet"u8); + writer.WriteStringValue(Subnet); + } + if (options.Format != "W" && Optional.IsDefined(DatabaseSid)) + { + writer.WritePropertyName("databaseSid"u8); + writer.WriteStringValue(DatabaseSid); + } + if (options.Format != "W" && Optional.IsDefined(DatabaseType)) + { + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType); + } + if (options.Format != "W" && Optional.IsDefined(IPAddress)) + { + writer.WritePropertyName("ipAddress"u8); + writer.WriteStringValue(IPAddress); + } + if (options.Format != "W" && Optional.IsDefined(LoadBalancerDetails)) + { + writer.WritePropertyName("loadBalancerDetails"u8); + JsonSerializer.Serialize(writer, LoadBalancerDetails); + } + if (options.Format != "W" && Optional.IsCollectionDefined(VmDetails)) + { + writer.WritePropertyName("vmDetails"u8); + writer.WriteStartArray(); + foreach (var item in VmDetails) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteObjectValue(Errors, 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 + } + } + } + + SapDatabaseProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapDatabaseProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapDatabaseProperties(document.RootElement, options); + } + + internal static SapDatabaseProperties DeserializeSapDatabaseProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string subnet = default; + string databaseSid = default; + string databaseType = default; + string ipAddress = default; + SubResource loadBalancerDetails = default; + IReadOnlyList vmDetails = default; + SapVirtualInstanceStatus? status = default; + SapVirtualInstanceProvisioningState? provisioningState = default; + SapVirtualInstanceError errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("subnet"u8)) + { + subnet = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseSid"u8)) + { + databaseSid = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseType"u8)) + { + databaseType = property.Value.GetString(); + continue; + } + if (property.NameEquals("ipAddress"u8)) + { + ipAddress = property.Value.GetString(); + continue; + } + if (property.NameEquals("loadBalancerDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + loadBalancerDetails = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("vmDetails"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DatabaseVmDetails.DeserializeDatabaseVmDetails(item, options)); + } + vmDetails = array; + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new SapVirtualInstanceStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new SapVirtualInstanceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errors = SapVirtualInstanceError.DeserializeSapVirtualInstanceError(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapDatabaseProperties( + subnet, + databaseSid, + databaseType, + ipAddress, + loadBalancerDetails, + vmDetails ?? new ChangeTrackingList(), + status, + provisioningState, + errors, + serializedAdditionalRawData); + } + + BinaryData 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(SapDatabaseProperties)} does not support writing '{options.Format}' format."); + } + } + + SapDatabaseProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapDatabaseProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapDatabaseProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.cs new file mode 100644 index 000000000000..e5c3d9feaeae --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseProperties.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Resources.Models; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the Database properties. + public partial class SapDatabaseProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapDatabaseProperties() + { + VmDetails = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Database subnet. + /// Database SID name. + /// Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL Server. + /// Database IP Address. + /// The Load Balancer details such as LoadBalancer ID attached to Database Virtual Machines. + /// The list of virtual machines corresponding to the Database resource. + /// Defines the SAP Instance status. + /// Defines the provisioning states. + /// Defines the errors related to Database resource. + /// Keeps track of any properties unknown to the library. + internal SapDatabaseProperties(string subnet, string databaseSid, string databaseType, string ipAddress, SubResource loadBalancerDetails, IReadOnlyList vmDetails, SapVirtualInstanceStatus? status, SapVirtualInstanceProvisioningState? provisioningState, SapVirtualInstanceError errors, IDictionary serializedAdditionalRawData) + { + Subnet = subnet; + DatabaseSid = databaseSid; + DatabaseType = databaseType; + IPAddress = ipAddress; + LoadBalancerDetails = loadBalancerDetails; + VmDetails = vmDetails; + Status = status; + ProvisioningState = provisioningState; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Database subnet. + public string Subnet { get; } + /// Database SID name. + public string DatabaseSid { get; } + /// Database type, that is if the DB is HANA, DB2, Oracle, SAP ASE, Max DB or MS SQL Server. + public string DatabaseType { get; } + /// Database IP Address. + public string IPAddress { get; } + /// The Load Balancer details such as LoadBalancer ID attached to Database Virtual Machines. + internal SubResource LoadBalancerDetails { get; } + /// Gets Id. + public ResourceIdentifier LoadBalancerDetailsId + { + get => LoadBalancerDetails?.Id; + } + + /// The list of virtual machines corresponding to the Database resource. + public IReadOnlyList VmDetails { get; } + /// Defines the SAP Instance status. + public SapVirtualInstanceStatus? Status { get; } + /// Defines the provisioning states. + public SapVirtualInstanceProvisioningState? ProvisioningState { get; } + /// Defines the errors related to Database resource. + internal SapVirtualInstanceError Errors { get; } + /// The Virtual Instance for SAP error body. + public ErrorInformation ErrorsProperties + { + get => Errors?.Properties; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseScaleMethod.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseScaleMethod.cs new file mode 100644 index 000000000000..32f8ad626a75 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseScaleMethod.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.SapVirtualInstances.Models +{ + /// The database scale method. + public readonly partial struct SapDatabaseScaleMethod : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapDatabaseScaleMethod(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ScaleUpValue = "ScaleUp"; + + /// ScaleUp Hana Database deployment type. + public static SapDatabaseScaleMethod ScaleUp { get; } = new SapDatabaseScaleMethod(ScaleUpValue); + /// Determines if two values are the same. + public static bool operator ==(SapDatabaseScaleMethod left, SapDatabaseScaleMethod right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapDatabaseScaleMethod left, SapDatabaseScaleMethod right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapDatabaseScaleMethod(string value) => new SapDatabaseScaleMethod(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapDatabaseScaleMethod other && Equals(other); + /// + public bool Equals(SapDatabaseScaleMethod 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseType.cs new file mode 100644 index 000000000000..d258a1c8ed0a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDatabaseType.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.SapVirtualInstances.Models +{ + /// Defines the supported SAP Database types. + public readonly partial struct SapDatabaseType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapDatabaseType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string HANAValue = "HANA"; + private const string DB2Value = "DB2"; + + /// HANA Database type of SAP system. + public static SapDatabaseType HANA { get; } = new SapDatabaseType(HANAValue); + /// DB2 database type of the SAP system. + public static SapDatabaseType DB2 { get; } = new SapDatabaseType(DB2Value); + /// Determines if two values are the same. + public static bool operator ==(SapDatabaseType left, SapDatabaseType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapDatabaseType left, SapDatabaseType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapDatabaseType(string value) => new SapDatabaseType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapDatabaseType other && Equals(other); + /// + public bool Equals(SapDatabaseType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDeploymentType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDeploymentType.cs new file mode 100644 index 000000000000..26f7a80b134f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDeploymentType.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.SapVirtualInstances.Models +{ + /// The type of SAP deployment, single server or Three tier. + public readonly partial struct SapDeploymentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapDeploymentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SingleServerValue = "SingleServer"; + private const string ThreeTierValue = "ThreeTier"; + + /// SAP Single server deployment type. + public static SapDeploymentType SingleServer { get; } = new SapDeploymentType(SingleServerValue); + /// SAP Distributed deployment type. + public static SapDeploymentType ThreeTier { get; } = new SapDeploymentType(ThreeTierValue); + /// Determines if two values are the same. + public static bool operator ==(SapDeploymentType left, SapDeploymentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapDeploymentType left, SapDeploymentType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapDeploymentType(string value) => new SapDeploymentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapDeploymentType other && Equals(other); + /// + public bool Equals(SapDeploymentType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.Serialization.cs new file mode 100644 index 000000000000..46e066017a08 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.Serialization.cs @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class SapDiskConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapDiskConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(RecommendedConfiguration)) + { + writer.WritePropertyName("recommendedConfiguration"u8); + writer.WriteObjectValue(RecommendedConfiguration, options); + } + if (Optional.IsCollectionDefined(SupportedConfigurations)) + { + writer.WritePropertyName("supportedConfigurations"u8); + writer.WriteStartArray(); + foreach (var item in SupportedConfigurations) + { + 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 + } + } + } + + SapDiskConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapDiskConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapDiskConfiguration(document.RootElement, options); + } + + internal static SapDiskConfiguration DeserializeSapDiskConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + DiskVolumeConfiguration recommendedConfiguration = default; + IReadOnlyList supportedConfigurations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("recommendedConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + recommendedConfiguration = DiskVolumeConfiguration.DeserializeDiskVolumeConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("supportedConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(DiskDetails.DeserializeDiskDetails(item, options)); + } + supportedConfigurations = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapDiskConfiguration(recommendedConfiguration, supportedConfigurations ?? 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(SapDiskConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SapDiskConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapDiskConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapDiskConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.cs new file mode 100644 index 000000000000..4518983516d1 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfiguration.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.SapVirtualInstances.Models +{ + /// The SAP Disk Configuration contains 'recommended disk' details and list of supported disks detail for a volume type. + public partial class SapDiskConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapDiskConfiguration() + { + SupportedConfigurations = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The recommended disk details for a given VM Sku. + /// The list of supported disks for a given VM Sku. + /// Keeps track of any properties unknown to the library. + internal SapDiskConfiguration(DiskVolumeConfiguration recommendedConfiguration, IReadOnlyList supportedConfigurations, IDictionary serializedAdditionalRawData) + { + RecommendedConfiguration = recommendedConfiguration; + SupportedConfigurations = supportedConfigurations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The recommended disk details for a given VM Sku. + public DiskVolumeConfiguration RecommendedConfiguration { get; } + /// The list of supported disks for a given VM Sku. + public IReadOnlyList SupportedConfigurations { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.Serialization.cs new file mode 100644 index 000000000000..313a54cda54d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class SapDiskConfigurationsContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapDiskConfigurationsContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + writer.WritePropertyName("environment"u8); + writer.WriteStringValue(Environment.ToString()); + writer.WritePropertyName("sapProduct"u8); + writer.WriteStringValue(SapProduct.ToString()); + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType.ToString()); + writer.WritePropertyName("deploymentType"u8); + writer.WriteStringValue(DeploymentType.ToString()); + writer.WritePropertyName("dbVmSku"u8); + writer.WriteStringValue(DbVmSku); + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + SapDiskConfigurationsContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapDiskConfigurationsContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapDiskConfigurationsContent(document.RootElement, options); + } + + internal static SapDiskConfigurationsContent DeserializeSapDiskConfigurationsContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appLocation = default; + SapEnvironmentType environment = default; + SapProductType sapProduct = default; + SapDatabaseType databaseType = default; + SapDeploymentType deploymentType = default; + string dbVmSku = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("environment"u8)) + { + environment = new SapEnvironmentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sapProduct"u8)) + { + sapProduct = new SapProductType(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseType"u8)) + { + databaseType = new SapDatabaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("dbVmSku"u8)) + { + dbVmSku = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapDiskConfigurationsContent( + appLocation, + environment, + sapProduct, + databaseType, + deploymentType, + dbVmSku, + serializedAdditionalRawData); + } + + BinaryData 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(SapDiskConfigurationsContent)} does not support writing '{options.Format}' format."); + } + } + + SapDiskConfigurationsContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapDiskConfigurationsContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapDiskConfigurationsContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.cs new file mode 100644 index 000000000000..50cb9596e7d2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsContent.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; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP request to get list of disk configurations. + public partial class SapDiskConfigurationsContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 geo-location where the SAP resources will be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The database type. Eg: HANA, DB2, etc. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The VM SKU for database instance. + /// or is null. + public SapDiskConfigurationsContent(string appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDatabaseType databaseType, SapDeploymentType deploymentType, string dbVmSku) + { + Argument.AssertNotNull(appLocation, nameof(appLocation)); + Argument.AssertNotNull(dbVmSku, nameof(dbVmSku)); + + AppLocation = appLocation; + Environment = environment; + SapProduct = sapProduct; + DatabaseType = databaseType; + DeploymentType = deploymentType; + DbVmSku = dbVmSku; + } + + /// Initializes a new instance of . + /// The geo-location where the SAP resources will be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The database type. Eg: HANA, DB2, etc. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The VM SKU for database instance. + /// Keeps track of any properties unknown to the library. + internal SapDiskConfigurationsContent(string appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDatabaseType databaseType, SapDeploymentType deploymentType, string dbVmSku, IDictionary serializedAdditionalRawData) + { + AppLocation = appLocation; + Environment = environment; + SapProduct = sapProduct; + DatabaseType = databaseType; + DeploymentType = deploymentType; + DbVmSku = dbVmSku; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapDiskConfigurationsContent() + { + } + + /// The geo-location where the SAP resources will be created. + public string AppLocation { get; } + /// Defines the environment type - Production/Non Production. + public SapEnvironmentType Environment { get; } + /// Defines the SAP Product type. + public SapProductType SapProduct { get; } + /// The database type. Eg: HANA, DB2, etc. + public SapDatabaseType DatabaseType { get; } + /// The deployment type. Eg: SingleServer/ThreeTier. + public SapDeploymentType DeploymentType { get; } + /// The VM SKU for database instance. + public string DbVmSku { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.Serialization.cs new file mode 100644 index 000000000000..f26bb0affdf6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.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.SapVirtualInstances.Models +{ + public partial class SapDiskConfigurationsResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapDiskConfigurationsResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(VolumeConfigurations)) + { + writer.WritePropertyName("volumeConfigurations"u8); + writer.WriteStartObject(); + foreach (var item in VolumeConfigurations) + { + writer.WritePropertyName(item.Key); + writer.WriteObjectValue(item.Value, options); + } + writer.WriteEndObject(); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapDiskConfigurationsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapDiskConfigurationsResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapDiskConfigurationsResult(document.RootElement, options); + } + + internal static SapDiskConfigurationsResult DeserializeSapDiskConfigurationsResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyDictionary volumeConfigurations = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("volumeConfigurations"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, SapDiskConfiguration.DeserializeSapDiskConfiguration(property0.Value, options)); + } + volumeConfigurations = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapDiskConfigurationsResult(volumeConfigurations ?? 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(SapDiskConfigurationsResult)} does not support writing '{options.Format}' format."); + } + } + + SapDiskConfigurationsResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapDiskConfigurationsResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapDiskConfigurationsResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.cs new file mode 100644 index 000000000000..68b5bc63cbab --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapDiskConfigurationsResult.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.SapVirtualInstances.Models +{ + /// The list of disk configuration for vmSku which are part of SAP deployment. + public partial class SapDiskConfigurationsResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapDiskConfigurationsResult() + { + VolumeConfigurations = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + /// Keeps track of any properties unknown to the library. + internal SapDiskConfigurationsResult(IReadOnlyDictionary volumeConfigurations, IDictionary serializedAdditionalRawData) + { + VolumeConfigurations = volumeConfigurations; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + public IReadOnlyDictionary VolumeConfigurations { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapEnvironmentType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapEnvironmentType.cs new file mode 100644 index 000000000000..bfe16bc5eba5 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapEnvironmentType.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.SapVirtualInstances.Models +{ + /// Defines the environment type - Production/Non Production. + public readonly partial struct SapEnvironmentType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapEnvironmentType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string NonProdValue = "NonProd"; + private const string ProdValue = "Prod"; + + /// Non Production SAP system. + public static SapEnvironmentType NonProd { get; } = new SapEnvironmentType(NonProdValue); + /// Production SAP system. + public static SapEnvironmentType Prod { get; } = new SapEnvironmentType(ProdValue); + /// Determines if two values are the same. + public static bool operator ==(SapEnvironmentType left, SapEnvironmentType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapEnvironmentType left, SapEnvironmentType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapEnvironmentType(string value) => new SapEnvironmentType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapEnvironmentType other && Equals(other); + /// + public bool Equals(SapEnvironmentType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHealthState.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHealthState.cs new file mode 100644 index 000000000000..b3db96529756 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHealthState.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.SapVirtualInstances.Models +{ + /// Defines the health of SAP Instances. + public readonly partial struct SapHealthState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapHealthState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UnknownValue = "Unknown"; + private const string HealthyValue = "Healthy"; + private const string UnhealthyValue = "Unhealthy"; + private const string DegradedValue = "Degraded"; + + /// SAP System health is unknown. + public static SapHealthState Unknown { get; } = new SapHealthState(UnknownValue); + /// SAP System health is healthy. + public static SapHealthState Healthy { get; } = new SapHealthState(HealthyValue); + /// SAP System is unhealthy. + public static SapHealthState Unhealthy { get; } = new SapHealthState(UnhealthyValue); + /// SAP System health is degraded. + public static SapHealthState Degraded { get; } = new SapHealthState(DegradedValue); + /// Determines if two values are the same. + public static bool operator ==(SapHealthState left, SapHealthState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapHealthState left, SapHealthState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapHealthState(string value) => new SapHealthState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapHealthState other && Equals(other); + /// + public bool Equals(SapHealthState 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHighAvailabilityType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHighAvailabilityType.cs new file mode 100644 index 000000000000..3e6a832aeff1 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapHighAvailabilityType.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.SapVirtualInstances.Models +{ + /// The high availability type (AvailabilitySet or AvailabilityZone). + public readonly partial struct SapHighAvailabilityType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapHighAvailabilityType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string AvailabilitySetValue = "AvailabilitySet"; + private const string AvailabilityZoneValue = "AvailabilityZone"; + + /// HA deployment with availability sets. + public static SapHighAvailabilityType AvailabilitySet { get; } = new SapHighAvailabilityType(AvailabilitySetValue); + /// HA deployment with availability zones. + public static SapHighAvailabilityType AvailabilityZone { get; } = new SapHighAvailabilityType(AvailabilityZoneValue); + /// Determines if two values are the same. + public static bool operator ==(SapHighAvailabilityType left, SapHighAvailabilityType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapHighAvailabilityType left, SapHighAvailabilityType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapHighAvailabilityType(string value) => new SapHighAvailabilityType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapHighAvailabilityType other && Equals(other); + /// + public bool Equals(SapHighAvailabilityType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.Serialization.cs new file mode 100644 index 000000000000..32610dc0fc6c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.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.SapVirtualInstances.Models +{ + public partial class SapInstallWithoutOSConfigSoftwareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapInstallWithoutOSConfigSoftwareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("bomUrl"u8); + writer.WriteStringValue(BomUri); + writer.WritePropertyName("sapBitsStorageAccountId"u8); + writer.WriteStringValue(SapBitsStorageAccountId); + writer.WritePropertyName("softwareVersion"u8); + writer.WriteStringValue(SoftwareVersion); + if (Optional.IsDefined(HighAvailabilitySoftwareConfiguration)) + { + writer.WritePropertyName("highAvailabilitySoftwareConfiguration"u8); + writer.WriteObjectValue(HighAvailabilitySoftwareConfiguration, options); + } + } + + SapInstallWithoutOSConfigSoftwareConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapInstallWithoutOSConfigSoftwareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapInstallWithoutOSConfigSoftwareConfiguration(document.RootElement, options); + } + + internal static SapInstallWithoutOSConfigSoftwareConfiguration DeserializeSapInstallWithoutOSConfigSoftwareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string bomUrl = default; + string sapBitsStorageAccountId = default; + string softwareVersion = default; + HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration = default; + SapSoftwareInstallationType softwareInstallationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bomUrl"u8)) + { + bomUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("sapBitsStorageAccountId"u8)) + { + sapBitsStorageAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("softwareVersion"u8)) + { + softwareVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("highAvailabilitySoftwareConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highAvailabilitySoftwareConfiguration = HighAvailabilitySoftwareConfiguration.DeserializeHighAvailabilitySoftwareConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("softwareInstallationType"u8)) + { + softwareInstallationType = new SapSoftwareInstallationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapInstallWithoutOSConfigSoftwareConfiguration( + softwareInstallationType, + serializedAdditionalRawData, + bomUrl, + sapBitsStorageAccountId, + softwareVersion, + highAvailabilitySoftwareConfiguration); + } + + BinaryData 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(SapInstallWithoutOSConfigSoftwareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SapInstallWithoutOSConfigSoftwareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapInstallWithoutOSConfigSoftwareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapInstallWithoutOSConfigSoftwareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.cs new file mode 100644 index 000000000000..feb3c7735081 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapInstallWithoutOSConfigSoftwareConfiguration.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP Software configuration Input when the software is to be installed by service without OS Configurations. + public partial class SapInstallWithoutOSConfigSoftwareConfiguration : SoftwareConfiguration + { + /// Initializes a new instance of . + /// The URL to the SAP Build of Materials(BOM) file. + /// The SAP bits storage account id. + /// The software version to install. + /// , or is null. + public SapInstallWithoutOSConfigSoftwareConfiguration(string bomUri, string sapBitsStorageAccountId, string softwareVersion) + { + Argument.AssertNotNull(bomUri, nameof(bomUri)); + Argument.AssertNotNull(sapBitsStorageAccountId, nameof(sapBitsStorageAccountId)); + Argument.AssertNotNull(softwareVersion, nameof(softwareVersion)); + + BomUri = bomUri; + SapBitsStorageAccountId = sapBitsStorageAccountId; + SoftwareVersion = softwareVersion; + SoftwareInstallationType = SapSoftwareInstallationType.SAPInstallWithoutOSConfig; + } + + /// Initializes a new instance of . + /// The SAP software installation type. + /// Keeps track of any properties unknown to the library. + /// The URL to the SAP Build of Materials(BOM) file. + /// The SAP bits storage account id. + /// The software version to install. + /// Gets or sets the HA software configuration. + internal SapInstallWithoutOSConfigSoftwareConfiguration(SapSoftwareInstallationType softwareInstallationType, IDictionary serializedAdditionalRawData, string bomUri, string sapBitsStorageAccountId, string softwareVersion, HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration) : base(softwareInstallationType, serializedAdditionalRawData) + { + BomUri = bomUri; + SapBitsStorageAccountId = sapBitsStorageAccountId; + SoftwareVersion = softwareVersion; + HighAvailabilitySoftwareConfiguration = highAvailabilitySoftwareConfiguration; + SoftwareInstallationType = softwareInstallationType; + } + + /// Initializes a new instance of for deserialization. + internal SapInstallWithoutOSConfigSoftwareConfiguration() + { + } + + /// The URL to the SAP Build of Materials(BOM) file. + public string BomUri { get; set; } + /// The SAP bits storage account id. + public string SapBitsStorageAccountId { get; set; } + /// The software version to install. + public string SoftwareVersion { get; set; } + /// Gets or sets the HA software configuration. + public HighAvailabilitySoftwareConfiguration HighAvailabilitySoftwareConfiguration { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapProductType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapProductType.cs new file mode 100644 index 000000000000..4f7c447c7964 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapProductType.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.SapVirtualInstances.Models +{ + /// Defines the SAP Product type. + public readonly partial struct SapProductType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapProductType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ECCValue = "ECC"; + private const string S4HANAValue = "S4HANA"; + private const string OtherValue = "Other"; + + /// SAP Product ECC. + public static SapProductType ECC { get; } = new SapProductType(ECCValue); + /// SAP Product S4HANA. + public static SapProductType S4HANA { get; } = new SapProductType(S4HANAValue); + /// SAP Products other than the ones listed. + public static SapProductType Other { get; } = new SapProductType(OtherValue); + /// Determines if two values are the same. + public static bool operator ==(SapProductType left, SapProductType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapProductType left, SapProductType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapProductType(string value) => new SapProductType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapProductType other && Equals(other); + /// + public bool Equals(SapProductType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.Serialization.cs new file mode 100644 index 000000000000..27e4f6de2e5a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.Serialization.cs @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapSizingRecommendationContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapSizingRecommendationContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + writer.WritePropertyName("environment"u8); + writer.WriteStringValue(Environment.ToString()); + writer.WritePropertyName("sapProduct"u8); + writer.WriteStringValue(SapProduct.ToString()); + writer.WritePropertyName("deploymentType"u8); + writer.WriteStringValue(DeploymentType.ToString()); + writer.WritePropertyName("saps"u8); + writer.WriteNumberValue(Saps); + writer.WritePropertyName("dbMemory"u8); + writer.WriteNumberValue(DbMemory); + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType.ToString()); + if (Optional.IsDefined(DbScaleMethod)) + { + writer.WritePropertyName("dbScaleMethod"u8); + writer.WriteStringValue(DbScaleMethod.Value.ToString()); + } + if (Optional.IsDefined(HighAvailabilityType)) + { + writer.WritePropertyName("highAvailabilityType"u8); + writer.WriteStringValue(HighAvailabilityType.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 + } + } + } + + SapSizingRecommendationContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapSizingRecommendationContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapSizingRecommendationContent(document.RootElement, options); + } + + internal static SapSizingRecommendationContent DeserializeSapSizingRecommendationContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appLocation = default; + SapEnvironmentType environment = default; + SapProductType sapProduct = default; + SapDeploymentType deploymentType = default; + long saps = default; + long dbMemory = default; + SapDatabaseType databaseType = default; + SapDatabaseScaleMethod? dbScaleMethod = default; + SapHighAvailabilityType? highAvailabilityType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("environment"u8)) + { + environment = new SapEnvironmentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sapProduct"u8)) + { + sapProduct = new SapProductType(property.Value.GetString()); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("saps"u8)) + { + saps = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("dbMemory"u8)) + { + dbMemory = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("databaseType"u8)) + { + databaseType = new SapDatabaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("dbScaleMethod"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbScaleMethod = new SapDatabaseScaleMethod(property.Value.GetString()); + continue; + } + if (property.NameEquals("highAvailabilityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highAvailabilityType = new SapHighAvailabilityType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapSizingRecommendationContent( + appLocation, + environment, + sapProduct, + deploymentType, + saps, + dbMemory, + databaseType, + dbScaleMethod, + highAvailabilityType, + serializedAdditionalRawData); + } + + BinaryData 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(SapSizingRecommendationContent)} does not support writing '{options.Format}' format."); + } + } + + SapSizingRecommendationContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapSizingRecommendationContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapSizingRecommendationContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.cs new file mode 100644 index 000000000000..a0dd7fb0d49f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationContent.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The SAP Sizing Recommendation request. + public partial class SapSizingRecommendationContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 geo-location where the resource is to be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The SAP Application Performance Standard measurement. + /// The database memory configuration. + /// The database type. + /// is null. + public SapSizingRecommendationContent(string appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDeploymentType deploymentType, long saps, long dbMemory, SapDatabaseType databaseType) + { + Argument.AssertNotNull(appLocation, nameof(appLocation)); + + AppLocation = appLocation; + Environment = environment; + SapProduct = sapProduct; + DeploymentType = deploymentType; + Saps = saps; + DbMemory = dbMemory; + DatabaseType = databaseType; + } + + /// Initializes a new instance of . + /// The geo-location where the resource is to be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The SAP Application Performance Standard measurement. + /// The database memory configuration. + /// The database type. + /// The DB scale method. + /// The high availability type. + /// Keeps track of any properties unknown to the library. + internal SapSizingRecommendationContent(string appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDeploymentType deploymentType, long saps, long dbMemory, SapDatabaseType databaseType, SapDatabaseScaleMethod? dbScaleMethod, SapHighAvailabilityType? highAvailabilityType, IDictionary serializedAdditionalRawData) + { + AppLocation = appLocation; + Environment = environment; + SapProduct = sapProduct; + DeploymentType = deploymentType; + Saps = saps; + DbMemory = dbMemory; + DatabaseType = databaseType; + DbScaleMethod = dbScaleMethod; + HighAvailabilityType = highAvailabilityType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapSizingRecommendationContent() + { + } + + /// The geo-location where the resource is to be created. + public string AppLocation { get; } + /// Defines the environment type - Production/Non Production. + public SapEnvironmentType Environment { get; } + /// Defines the SAP Product type. + public SapProductType SapProduct { get; } + /// The deployment type. Eg: SingleServer/ThreeTier. + public SapDeploymentType DeploymentType { get; } + /// The SAP Application Performance Standard measurement. + public long Saps { get; } + /// The database memory configuration. + public long DbMemory { get; } + /// The database type. + public SapDatabaseType DatabaseType { get; } + /// The DB scale method. + public SapDatabaseScaleMethod? DbScaleMethod { get; set; } + /// The high availability type. + public SapHighAvailabilityType? HighAvailabilityType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.Serialization.cs new file mode 100644 index 000000000000..9a8ce8372fad --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.Serialization.cs @@ -0,0 +1,118 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownSapSizingRecommendationResult))] + public partial class SapSizingRecommendationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapSizingRecommendationResult)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("deploymentType"u8); + writer.WriteStringValue(DeploymentType.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 + } + } + } + + SapSizingRecommendationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapSizingRecommendationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapSizingRecommendationResult(document.RootElement, options); + } + + internal static SapSizingRecommendationResult DeserializeSapSizingRecommendationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("deploymentType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "SingleServer": return SingleServerRecommendationResult.DeserializeSingleServerRecommendationResult(element, options); + case "ThreeTier": return ThreeTierRecommendationResult.DeserializeThreeTierRecommendationResult(element, options); + } + } + return UnknownSapSizingRecommendationResult.DeserializeUnknownSapSizingRecommendationResult(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(SapSizingRecommendationResult)} does not support writing '{options.Format}' format."); + } + } + + SapSizingRecommendationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapSizingRecommendationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapSizingRecommendationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.cs new file mode 100644 index 000000000000..82bef0761e1c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSizingRecommendationResult.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.SapVirtualInstances.Models +{ + /// + /// The SAP sizing recommendation result. + /// 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 SapSizingRecommendationResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 SapSizingRecommendationResult() + { + } + + /// Initializes a new instance of . + /// The deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + internal SapSizingRecommendationResult(SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData) + { + DeploymentType = deploymentType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The deployment type. Eg: SingleServer/ThreeTier. + internal SapDeploymentType DeploymentType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSoftwareInstallationType.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSoftwareInstallationType.cs new file mode 100644 index 000000000000..e6f61a20b863 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSoftwareInstallationType.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.SapVirtualInstances.Models +{ + /// The SAP software installation Type. + internal readonly partial struct SapSoftwareInstallationType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapSoftwareInstallationType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ServiceInitiatedValue = "ServiceInitiated"; + private const string SAPInstallWithoutOSConfigValue = "SAPInstallWithoutOSConfig"; + private const string ExternalValue = "External"; + + /// SAP Install managed by service. + public static SapSoftwareInstallationType ServiceInitiated { get; } = new SapSoftwareInstallationType(ServiceInitiatedValue); + /// SAP Install without OS Config. + public static SapSoftwareInstallationType SAPInstallWithoutOSConfig { get; } = new SapSoftwareInstallationType(SAPInstallWithoutOSConfigValue); + /// External software installation type. + public static SapSoftwareInstallationType External { get; } = new SapSoftwareInstallationType(ExternalValue); + /// Determines if two values are the same. + public static bool operator ==(SapSoftwareInstallationType left, SapSoftwareInstallationType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapSoftwareInstallationType left, SapSoftwareInstallationType right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapSoftwareInstallationType(string value) => new SapSoftwareInstallationType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapSoftwareInstallationType other && Equals(other); + /// + public bool Equals(SapSoftwareInstallationType 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.Serialization.cs new file mode 100644 index 000000000000..2088cafa10dc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SapSupportedResourceSkusResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapSupportedResourceSkusResult)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(SupportedSkus)) + { + writer.WritePropertyName("supportedSkus"u8); + writer.WriteStartArray(); + foreach (var item in SupportedSkus) + { + 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 + } + } + } + + SapSupportedResourceSkusResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapSupportedResourceSkusResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapSupportedResourceSkusResult(document.RootElement, options); + } + + internal static SapSupportedResourceSkusResult DeserializeSapSupportedResourceSkusResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IReadOnlyList supportedSkus = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("supportedSkus"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SapSupportedSku.DeserializeSapSupportedSku(item, options)); + } + supportedSkus = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapSupportedResourceSkusResult(supportedSkus ?? 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(SapSupportedResourceSkusResult)} does not support writing '{options.Format}' format."); + } + } + + SapSupportedResourceSkusResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapSupportedResourceSkusResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapSupportedResourceSkusResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.cs new file mode 100644 index 000000000000..6eafd832c894 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedResourceSkusResult.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.SapVirtualInstances.Models +{ + /// The list of supported SKUs for different resources which are part of SAP deployment. + public partial class SapSupportedResourceSkusResult + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapSupportedResourceSkusResult() + { + SupportedSkus = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// Gets the list of SAP supported SKUs. + /// Keeps track of any properties unknown to the library. + internal SapSupportedResourceSkusResult(IReadOnlyList supportedSkus, IDictionary serializedAdditionalRawData) + { + SupportedSkus = supportedSkus; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets the list of SAP supported SKUs. + public IReadOnlyList SupportedSkus { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.Serialization.cs new file mode 100644 index 000000000000..aa304c84d4ba --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.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.SapVirtualInstances.Models +{ + public partial class SapSupportedSku : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapSupportedSku)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(VmSku)) + { + writer.WritePropertyName("vmSku"u8); + writer.WriteStringValue(VmSku); + } + if (Optional.IsDefined(IsAppServerCertified)) + { + writer.WritePropertyName("isAppServerCertified"u8); + writer.WriteBooleanValue(IsAppServerCertified.Value); + } + if (Optional.IsDefined(IsDatabaseCertified)) + { + writer.WritePropertyName("isDatabaseCertified"u8); + writer.WriteBooleanValue(IsDatabaseCertified.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 + } + } + } + + SapSupportedSku IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapSupportedSku)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapSupportedSku(document.RootElement, options); + } + + internal static SapSupportedSku DeserializeSapSupportedSku(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string vmSku = default; + bool? isAppServerCertified = default; + bool? isDatabaseCertified = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmSku"u8)) + { + vmSku = property.Value.GetString(); + continue; + } + if (property.NameEquals("isAppServerCertified"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isAppServerCertified = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isDatabaseCertified"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isDatabaseCertified = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapSupportedSku(vmSku, isAppServerCertified, isDatabaseCertified, serializedAdditionalRawData); + } + + BinaryData 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(SapSupportedSku)} does not support writing '{options.Format}' format."); + } + } + + SapSupportedSku IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapSupportedSku(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapSupportedSku)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.cs new file mode 100644 index 000000000000..ab4e16fd5ea2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSku.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.SapVirtualInstances.Models +{ + /// The SAP supported SKU. + public partial class SapSupportedSku + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapSupportedSku() + { + } + + /// Initializes a new instance of . + /// The VM Sku. + /// True if the Sku is certified for App server in the SAP system. + /// True if the Sku is certified for Database server in the SAP system. + /// Keeps track of any properties unknown to the library. + internal SapSupportedSku(string vmSku, bool? isAppServerCertified, bool? isDatabaseCertified, IDictionary serializedAdditionalRawData) + { + VmSku = vmSku; + IsAppServerCertified = isAppServerCertified; + IsDatabaseCertified = isDatabaseCertified; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The VM Sku. + public string VmSku { get; } + /// True if the Sku is certified for App server in the SAP system. + public bool? IsAppServerCertified { get; } + /// True if the Sku is certified for Database server in the SAP system. + public bool? IsDatabaseCertified { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.Serialization.cs new file mode 100644 index 000000000000..11a19d79b0ea --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.Serialization.cs @@ -0,0 +1,180 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class SapSupportedSkusContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapSupportedSkusContent)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("appLocation"u8); + writer.WriteStringValue(AppLocation); + writer.WritePropertyName("environment"u8); + writer.WriteStringValue(Environment.ToString()); + writer.WritePropertyName("sapProduct"u8); + writer.WriteStringValue(SapProduct.ToString()); + writer.WritePropertyName("deploymentType"u8); + writer.WriteStringValue(DeploymentType.ToString()); + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType.ToString()); + if (Optional.IsDefined(HighAvailabilityType)) + { + writer.WritePropertyName("highAvailabilityType"u8); + writer.WriteStringValue(HighAvailabilityType.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 + } + } + } + + SapSupportedSkusContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapSupportedSkusContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapSupportedSkusContent(document.RootElement, options); + } + + internal static SapSupportedSkusContent DeserializeSapSupportedSkusContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appLocation = default; + SapEnvironmentType environment = default; + SapProductType sapProduct = default; + SapDeploymentType deploymentType = default; + SapDatabaseType databaseType = default; + SapHighAvailabilityType? highAvailabilityType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appLocation"u8)) + { + appLocation = property.Value.GetString(); + continue; + } + if (property.NameEquals("environment"u8)) + { + environment = new SapEnvironmentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sapProduct"u8)) + { + sapProduct = new SapProductType(property.Value.GetString()); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("databaseType"u8)) + { + databaseType = new SapDatabaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("highAvailabilityType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highAvailabilityType = new SapHighAvailabilityType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapSupportedSkusContent( + appLocation, + environment, + sapProduct, + deploymentType, + databaseType, + highAvailabilityType, + serializedAdditionalRawData); + } + + BinaryData 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(SapSupportedSkusContent)} does not support writing '{options.Format}' format."); + } + } + + SapSupportedSkusContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapSupportedSkusContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapSupportedSkusContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.cs new file mode 100644 index 000000000000..9ff9a4a9fe75 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapSupportedSkusContent.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.SapVirtualInstances.Models +{ + /// The SAP request to get list of supported SKUs. + public partial class SapSupportedSkusContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 geo-location where the resource is to be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The database type. Eg: HANA, DB2, etc. + /// is null. + public SapSupportedSkusContent(string appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDeploymentType deploymentType, SapDatabaseType databaseType) + { + Argument.AssertNotNull(appLocation, nameof(appLocation)); + + AppLocation = appLocation; + Environment = environment; + SapProduct = sapProduct; + DeploymentType = deploymentType; + DatabaseType = databaseType; + } + + /// Initializes a new instance of . + /// The geo-location where the resource is to be created. + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// The deployment type. Eg: SingleServer/ThreeTier. + /// The database type. Eg: HANA, DB2, etc. + /// The high availability type. + /// Keeps track of any properties unknown to the library. + internal SapSupportedSkusContent(string appLocation, SapEnvironmentType environment, SapProductType sapProduct, SapDeploymentType deploymentType, SapDatabaseType databaseType, SapHighAvailabilityType? highAvailabilityType, IDictionary serializedAdditionalRawData) + { + AppLocation = appLocation; + Environment = environment; + SapProduct = sapProduct; + DeploymentType = deploymentType; + DatabaseType = databaseType; + HighAvailabilityType = highAvailabilityType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapSupportedSkusContent() + { + } + + /// The geo-location where the resource is to be created. + public string AppLocation { get; } + /// Defines the environment type - Production/Non Production. + public SapEnvironmentType Environment { get; } + /// Defines the SAP Product type. + public SapProductType SapProduct { get; } + /// The deployment type. Eg: SingleServer/ThreeTier. + public SapDeploymentType DeploymentType { get; } + /// The database type. Eg: HANA, DB2, etc. + public SapDatabaseType DatabaseType { get; } + /// The high availability type. + public SapHighAvailabilityType? HighAvailabilityType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.Serialization.cs new file mode 100644 index 000000000000..ace37698b770 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.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.SapVirtualInstances.Models +{ + internal partial class SapVirtualInstanceError : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapVirtualInstanceError)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var item in _serializedAdditionalRawData) + { + writer.WritePropertyName(item.Key); +#if NET6_0_OR_GREATER + writer.WriteRawValue(item.Value); +#else + using (JsonDocument document = JsonDocument.Parse(item.Value, ModelSerializationExtensions.JsonDocumentOptions)) + { + JsonSerializer.Serialize(writer, document.RootElement); + } +#endif + } + } + } + + SapVirtualInstanceError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapVirtualInstanceError)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapVirtualInstanceError(document.RootElement, options); + } + + internal static SapVirtualInstanceError DeserializeSapVirtualInstanceError(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ErrorInformation properties = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = ErrorInformation.DeserializeErrorInformation(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapVirtualInstanceError(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(SapVirtualInstanceError)} does not support writing '{options.Format}' format."); + } + } + + SapVirtualInstanceError IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapVirtualInstanceError(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapVirtualInstanceError)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.cs new file mode 100644 index 000000000000..7ee793a33452 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceError.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.SapVirtualInstances.Models +{ + /// An error response from the Virtual Instance for SAP Workload service. + internal partial class SapVirtualInstanceError + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapVirtualInstanceError() + { + } + + /// Initializes a new instance of . + /// The Virtual Instance for SAP error body. + /// Keeps track of any properties unknown to the library. + internal SapVirtualInstanceError(ErrorInformation properties, IDictionary serializedAdditionalRawData) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The Virtual Instance for SAP error body. + public ErrorInformation Properties { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.Serialization.cs new file mode 100644 index 000000000000..79e0755875aa --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.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.SapVirtualInstances.Models +{ + public partial class SapVirtualInstancePatch : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapVirtualInstancePatch)} 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(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, 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 + } + } + } + + SapVirtualInstancePatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapVirtualInstancePatch)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapVirtualInstancePatch(document.RootElement, options); + } + + internal static SapVirtualInstancePatch DeserializeSapVirtualInstancePatch(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IDictionary tags = default; + SAPVirtualInstanceIdentity identity = default; + UpdateSapVirtualInstanceProperties 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("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = SAPVirtualInstanceIdentity.DeserializeSAPVirtualInstanceIdentity(property.Value, options); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = UpdateSapVirtualInstanceProperties.DeserializeUpdateSapVirtualInstanceProperties(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapVirtualInstancePatch(tags ?? new ChangeTrackingDictionary(), identity, 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(SapVirtualInstancePatch)} does not support writing '{options.Format}' format."); + } + } + + SapVirtualInstancePatch IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapVirtualInstancePatch(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapVirtualInstancePatch)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.cs new file mode 100644 index 000000000000..d38c79714ba2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstancePatch.cs @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the request body for updating Virtual Instance for SAP. + public partial class SapVirtualInstancePatch + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SapVirtualInstancePatch() + { + Tags = new ChangeTrackingDictionary(); + } + + /// Initializes a new instance of . + /// Gets or sets the Resource tags. + /// Managed service identity (user assigned identities). + /// The update properties. + /// Keeps track of any properties unknown to the library. + internal SapVirtualInstancePatch(IDictionary tags, SAPVirtualInstanceIdentity identity, UpdateSapVirtualInstanceProperties properties, IDictionary serializedAdditionalRawData) + { + Tags = tags; + Identity = identity; + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Gets or sets the Resource tags. + public IDictionary Tags { get; } + /// Managed service identity (user assigned identities). + public SAPVirtualInstanceIdentity Identity { get; set; } + /// The update properties. + internal UpdateSapVirtualInstanceProperties Properties { get; set; } + /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the managed resource group storage account. This setting is currently applicable only to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + public ManagedResourcesNetworkAccessType? UpdateSapVirtualInstanceManagedResourcesNetworkAccessType + { + get => Properties is null ? default : Properties.ManagedResourcesNetworkAccessType; + set + { + if (Properties is null) + Properties = new UpdateSapVirtualInstanceProperties(); + Properties.ManagedResourcesNetworkAccessType = value; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.Serialization.cs new file mode 100644 index 000000000000..d1d18507916f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.Serialization.cs @@ -0,0 +1,258 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class SapVirtualInstanceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapVirtualInstanceProperties)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("environment"u8); + writer.WriteStringValue(Environment.ToString()); + writer.WritePropertyName("sapProduct"u8); + writer.WriteStringValue(SapProduct.ToString()); + if (Optional.IsDefined(ManagedResourcesNetworkAccessType)) + { + writer.WritePropertyName("managedResourcesNetworkAccessType"u8); + writer.WriteStringValue(ManagedResourcesNetworkAccessType.Value.ToString()); + } + writer.WritePropertyName("configuration"u8); + writer.WriteObjectValue(Configuration, options); + if (Optional.IsDefined(ManagedResourceGroupConfiguration)) + { + writer.WritePropertyName("managedResourceGroupConfiguration"u8); + writer.WriteObjectValue(ManagedResourceGroupConfiguration, options); + } + if (options.Format != "W" && Optional.IsDefined(Status)) + { + writer.WritePropertyName("status"u8); + writer.WriteStringValue(Status.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Health)) + { + writer.WritePropertyName("health"u8); + writer.WriteStringValue(Health.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(State)) + { + writer.WritePropertyName("state"u8); + writer.WriteStringValue(State.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) + { + writer.WritePropertyName("provisioningState"u8); + writer.WriteStringValue(ProvisioningState.Value.ToString()); + } + if (options.Format != "W" && Optional.IsDefined(Errors)) + { + writer.WritePropertyName("errors"u8); + writer.WriteObjectValue(Errors, 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 + } + } + } + + SapVirtualInstanceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapVirtualInstanceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapVirtualInstanceProperties(document.RootElement, options); + } + + internal static SapVirtualInstanceProperties DeserializeSapVirtualInstanceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapEnvironmentType environment = default; + SapProductType sapProduct = default; + ManagedResourcesNetworkAccessType? managedResourcesNetworkAccessType = default; + SapConfiguration configuration = default; + ManagedRGConfiguration managedResourceGroupConfiguration = default; + SapVirtualInstanceStatus? status = default; + SapHealthState? health = default; + SapVirtualInstanceState? state = default; + SapVirtualInstanceProvisioningState? provisioningState = default; + SapVirtualInstanceError errors = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("environment"u8)) + { + environment = new SapEnvironmentType(property.Value.GetString()); + continue; + } + if (property.NameEquals("sapProduct"u8)) + { + sapProduct = new SapProductType(property.Value.GetString()); + continue; + } + if (property.NameEquals("managedResourcesNetworkAccessType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedResourcesNetworkAccessType = new ManagedResourcesNetworkAccessType(property.Value.GetString()); + continue; + } + if (property.NameEquals("configuration"u8)) + { + configuration = SapConfiguration.DeserializeSapConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("managedResourceGroupConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedResourceGroupConfiguration = ManagedRGConfiguration.DeserializeManagedRGConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new SapVirtualInstanceStatus(property.Value.GetString()); + continue; + } + if (property.NameEquals("health"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + health = new SapHealthState(property.Value.GetString()); + continue; + } + if (property.NameEquals("state"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + state = new SapVirtualInstanceState(property.Value.GetString()); + continue; + } + if (property.NameEquals("provisioningState"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new SapVirtualInstanceProvisioningState(property.Value.GetString()); + continue; + } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + errors = SapVirtualInstanceError.DeserializeSapVirtualInstanceError(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SapVirtualInstanceProperties( + environment, + sapProduct, + managedResourcesNetworkAccessType, + configuration, + managedResourceGroupConfiguration, + status, + health, + state, + provisioningState, + errors, + serializedAdditionalRawData); + } + + BinaryData 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(SapVirtualInstanceProperties)} does not support writing '{options.Format}' format."); + } + } + + SapVirtualInstanceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapVirtualInstanceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapVirtualInstanceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.cs new file mode 100644 index 000000000000..cd9723a6f3a6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProperties.cs @@ -0,0 +1,144 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the Virtual Instance for SAP solutions resource properties. + public partial class SapVirtualInstanceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// Creates a payload of { "key": "value" }. + /// + /// + /// BinaryData.FromString("{\"key\": \"value\"}") + /// Creates a payload of { "key": "value" }. + /// + /// + /// + /// + private IDictionary _serializedAdditionalRawData; + + /// Initializes a new instance of . + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// + /// Defines if the SAP system is being created using Azure Center for SAP solutions (ACSS) or if an existing SAP system is being registered with ACSS + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + /// is null. + public SapVirtualInstanceProperties(SapEnvironmentType environment, SapProductType sapProduct, SapConfiguration configuration) + { + Argument.AssertNotNull(configuration, nameof(configuration)); + + Environment = environment; + SapProduct = sapProduct; + Configuration = configuration; + } + + /// Initializes a new instance of . + /// Defines the environment type - Production/Non Production. + /// Defines the SAP Product type. + /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the managed resource group storage account. This setting is currently applicable only to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + /// + /// Defines if the SAP system is being created using Azure Center for SAP solutions (ACSS) or if an existing SAP system is being registered with ACSS + /// 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 . + /// + /// Managed resource group configuration. + /// Defines the SAP Instance status. + /// Defines the health of SAP Instances. + /// Defines the Virtual Instance for SAP state. + /// Defines the provisioning states. + /// Indicates any errors on the Virtual Instance for SAP solutions resource. + /// Keeps track of any properties unknown to the library. + internal SapVirtualInstanceProperties(SapEnvironmentType environment, SapProductType sapProduct, ManagedResourcesNetworkAccessType? managedResourcesNetworkAccessType, SapConfiguration configuration, ManagedRGConfiguration managedResourceGroupConfiguration, SapVirtualInstanceStatus? status, SapHealthState? health, SapVirtualInstanceState? state, SapVirtualInstanceProvisioningState? provisioningState, SapVirtualInstanceError errors, IDictionary serializedAdditionalRawData) + { + Environment = environment; + SapProduct = sapProduct; + ManagedResourcesNetworkAccessType = managedResourcesNetworkAccessType; + Configuration = configuration; + ManagedResourceGroupConfiguration = managedResourceGroupConfiguration; + Status = status; + Health = health; + State = state; + ProvisioningState = provisioningState; + Errors = errors; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapVirtualInstanceProperties() + { + } + + /// Defines the environment type - Production/Non Production. + public SapEnvironmentType Environment { get; set; } + /// Defines the SAP Product type. + public SapProductType SapProduct { get; set; } + /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the managed resource group storage account. This setting is currently applicable only to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + public ManagedResourcesNetworkAccessType? ManagedResourcesNetworkAccessType { get; set; } + /// + /// Defines if the SAP system is being created using Azure Center for SAP solutions (ACSS) or if an existing SAP system is being registered with ACSS + /// 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 SapConfiguration Configuration { get; set; } + /// Managed resource group configuration. + internal ManagedRGConfiguration ManagedResourceGroupConfiguration { get; set; } + /// Managed resource group name. + public string ManagedResourceGroupName + { + get => ManagedResourceGroupConfiguration is null ? default : ManagedResourceGroupConfiguration.Name; + set + { + if (ManagedResourceGroupConfiguration is null) + ManagedResourceGroupConfiguration = new ManagedRGConfiguration(); + ManagedResourceGroupConfiguration.Name = value; + } + } + + /// Defines the SAP Instance status. + public SapVirtualInstanceStatus? Status { get; } + /// Defines the health of SAP Instances. + public SapHealthState? Health { get; } + /// Defines the Virtual Instance for SAP state. + public SapVirtualInstanceState? State { get; } + /// Defines the provisioning states. + public SapVirtualInstanceProvisioningState? ProvisioningState { get; } + /// Indicates any errors on the Virtual Instance for SAP solutions resource. + internal SapVirtualInstanceError Errors { get; } + /// The Virtual Instance for SAP error body. + public ErrorInformation ErrorsProperties + { + get => Errors?.Properties; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProvisioningState.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProvisioningState.cs new file mode 100644 index 000000000000..2c1b19b21645 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceProvisioningState.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.SapVirtualInstances.Models +{ + /// Defines the provisioning states. + public readonly partial struct SapVirtualInstanceProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapVirtualInstanceProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string UpdatingValue = "Updating"; + private const string CreatingValue = "Creating"; + private const string FailedValue = "Failed"; + private const string DeletingValue = "Deleting"; + private const string CanceledValue = "Canceled"; + + /// ACSS succeeded provisioning state. + public static SapVirtualInstanceProvisioningState Succeeded { get; } = new SapVirtualInstanceProvisioningState(SucceededValue); + /// ACSS updating provisioning state. + public static SapVirtualInstanceProvisioningState Updating { get; } = new SapVirtualInstanceProvisioningState(UpdatingValue); + /// ACSS Creating provisioning state. + public static SapVirtualInstanceProvisioningState Creating { get; } = new SapVirtualInstanceProvisioningState(CreatingValue); + /// ACSS Failed provisioning state. + public static SapVirtualInstanceProvisioningState Failed { get; } = new SapVirtualInstanceProvisioningState(FailedValue); + /// ACSS Deleting provisioning state. + public static SapVirtualInstanceProvisioningState Deleting { get; } = new SapVirtualInstanceProvisioningState(DeletingValue); + /// ACSS Canceled provisioning state. + public static SapVirtualInstanceProvisioningState Canceled { get; } = new SapVirtualInstanceProvisioningState(CanceledValue); + /// Determines if two values are the same. + public static bool operator ==(SapVirtualInstanceProvisioningState left, SapVirtualInstanceProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapVirtualInstanceProvisioningState left, SapVirtualInstanceProvisioningState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapVirtualInstanceProvisioningState(string value) => new SapVirtualInstanceProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapVirtualInstanceProvisioningState other && Equals(other); + /// + public bool Equals(SapVirtualInstanceProvisioningState 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceState.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceState.cs new file mode 100644 index 000000000000..b2aa043b9ae6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceState.cs @@ -0,0 +1,84 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Defines the Virtual Instance for SAP state. + public readonly partial struct SapVirtualInstanceState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapVirtualInstanceState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InfrastructureDeploymentPendingValue = "InfrastructureDeploymentPending"; + private const string InfrastructureDeploymentInProgressValue = "InfrastructureDeploymentInProgress"; + private const string InfrastructureDeploymentFailedValue = "InfrastructureDeploymentFailed"; + private const string SoftwareInstallationPendingValue = "SoftwareInstallationPending"; + private const string SoftwareInstallationInProgressValue = "SoftwareInstallationInProgress"; + private const string SoftwareInstallationFailedValue = "SoftwareInstallationFailed"; + private const string SoftwareDetectionInProgressValue = "SoftwareDetectionInProgress"; + private const string SoftwareDetectionFailedValue = "SoftwareDetectionFailed"; + private const string DiscoveryPendingValue = "DiscoveryPending"; + private const string DiscoveryInProgressValue = "DiscoveryInProgress"; + private const string DiscoveryFailedValue = "DiscoveryFailed"; + private const string RegistrationCompleteValue = "RegistrationComplete"; + private const string ACSSInstallationBlockedValue = "ACSSInstallationBlocked"; + + /// Infrastructure is not yet deployed. + public static SapVirtualInstanceState InfrastructureDeploymentPending { get; } = new SapVirtualInstanceState(InfrastructureDeploymentPendingValue); + /// Infrastructure deployment is in progress. + public static SapVirtualInstanceState InfrastructureDeploymentInProgress { get; } = new SapVirtualInstanceState(InfrastructureDeploymentInProgressValue); + /// Infrastructure deployment has failed. + public static SapVirtualInstanceState InfrastructureDeploymentFailed { get; } = new SapVirtualInstanceState(InfrastructureDeploymentFailedValue); + /// Infrastructure deployment is successful. Software installation is pending. + public static SapVirtualInstanceState SoftwareInstallationPending { get; } = new SapVirtualInstanceState(SoftwareInstallationPendingValue); + /// Software installation is in progress. + public static SapVirtualInstanceState SoftwareInstallationInProgress { get; } = new SapVirtualInstanceState(SoftwareInstallationInProgressValue); + /// Software installation failed. + public static SapVirtualInstanceState SoftwareInstallationFailed { get; } = new SapVirtualInstanceState(SoftwareInstallationFailedValue); + /// Software detection is in progress. + public static SapVirtualInstanceState SoftwareDetectionInProgress { get; } = new SapVirtualInstanceState(SoftwareDetectionInProgressValue); + /// Software detection failed. + public static SapVirtualInstanceState SoftwareDetectionFailed { get; } = new SapVirtualInstanceState(SoftwareDetectionFailedValue); + /// Registration has not started. + public static SapVirtualInstanceState DiscoveryPending { get; } = new SapVirtualInstanceState(DiscoveryPendingValue); + /// Registration is in progress. + public static SapVirtualInstanceState DiscoveryInProgress { get; } = new SapVirtualInstanceState(DiscoveryInProgressValue); + /// Registration has failed. + public static SapVirtualInstanceState DiscoveryFailed { get; } = new SapVirtualInstanceState(DiscoveryFailedValue); + /// Registration is complete. + public static SapVirtualInstanceState RegistrationComplete { get; } = new SapVirtualInstanceState(RegistrationCompleteValue); + /// ACSS installation cannot proceed. + public static SapVirtualInstanceState ACSSInstallationBlocked { get; } = new SapVirtualInstanceState(ACSSInstallationBlockedValue); + /// Determines if two values are the same. + public static bool operator ==(SapVirtualInstanceState left, SapVirtualInstanceState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapVirtualInstanceState left, SapVirtualInstanceState right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapVirtualInstanceState(string value) => new SapVirtualInstanceState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapVirtualInstanceState other && Equals(other); + /// + public bool Equals(SapVirtualInstanceState 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceStatus.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceStatus.cs new file mode 100644 index 000000000000..4ac8e7edc524 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SapVirtualInstanceStatus.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.SapVirtualInstances.Models +{ + /// Defines the SAP Instance status. + public readonly partial struct SapVirtualInstanceStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public SapVirtualInstanceStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string StartingValue = "Starting"; + private const string RunningValue = "Running"; + private const string StoppingValue = "Stopping"; + private const string OfflineValue = "Offline"; + private const string PartiallyRunningValue = "PartiallyRunning"; + private const string UnavailableValue = "Unavailable"; + private const string SoftShutdownValue = "SoftShutdown"; + + /// SAP system is getting started. + public static SapVirtualInstanceStatus Starting { get; } = new SapVirtualInstanceStatus(StartingValue); + /// SAP system is running. + public static SapVirtualInstanceStatus Running { get; } = new SapVirtualInstanceStatus(RunningValue); + /// SAP system is being stopped. + public static SapVirtualInstanceStatus Stopping { get; } = new SapVirtualInstanceStatus(StoppingValue); + /// SAP system is offline. + public static SapVirtualInstanceStatus Offline { get; } = new SapVirtualInstanceStatus(OfflineValue); + /// SAP system is partially running. + public static SapVirtualInstanceStatus PartiallyRunning { get; } = new SapVirtualInstanceStatus(PartiallyRunningValue); + /// SAP system status is unavailable. + public static SapVirtualInstanceStatus Unavailable { get; } = new SapVirtualInstanceStatus(UnavailableValue); + /// Soft shutdown of SAP system is initiated. + public static SapVirtualInstanceStatus SoftShutdown { get; } = new SapVirtualInstanceStatus(SoftShutdownValue); + /// Determines if two values are the same. + public static bool operator ==(SapVirtualInstanceStatus left, SapVirtualInstanceStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(SapVirtualInstanceStatus left, SapVirtualInstanceStatus right) => !left.Equals(right); + /// Converts a to a . + public static implicit operator SapVirtualInstanceStatus(string value) => new SapVirtualInstanceStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is SapVirtualInstanceStatus other && Equals(other); + /// + public bool Equals(SapVirtualInstanceStatus 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.Serialization.cs new file mode 100644 index 000000000000..5602fc145334 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.Serialization.cs @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class ServiceInitiatedSoftwareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ServiceInitiatedSoftwareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + writer.WritePropertyName("bomUrl"u8); + writer.WriteStringValue(BomUri); + writer.WritePropertyName("softwareVersion"u8); + writer.WriteStringValue(SoftwareVersion); + writer.WritePropertyName("sapBitsStorageAccountId"u8); + writer.WriteStringValue(SapBitsStorageAccountId); + writer.WritePropertyName("sapFqdn"u8); + writer.WriteStringValue(SapFqdn); + writer.WritePropertyName("sshPrivateKey"u8); + writer.WriteStringValue(SshPrivateKey); + if (Optional.IsDefined(HighAvailabilitySoftwareConfiguration)) + { + writer.WritePropertyName("highAvailabilitySoftwareConfiguration"u8); + writer.WriteObjectValue(HighAvailabilitySoftwareConfiguration, options); + } + } + + ServiceInitiatedSoftwareConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ServiceInitiatedSoftwareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeServiceInitiatedSoftwareConfiguration(document.RootElement, options); + } + + internal static ServiceInitiatedSoftwareConfiguration DeserializeServiceInitiatedSoftwareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string bomUrl = default; + string softwareVersion = default; + string sapBitsStorageAccountId = default; + string sapFqdn = default; + string sshPrivateKey = default; + HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration = default; + SapSoftwareInstallationType softwareInstallationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("bomUrl"u8)) + { + bomUrl = property.Value.GetString(); + continue; + } + if (property.NameEquals("softwareVersion"u8)) + { + softwareVersion = property.Value.GetString(); + continue; + } + if (property.NameEquals("sapBitsStorageAccountId"u8)) + { + sapBitsStorageAccountId = property.Value.GetString(); + continue; + } + if (property.NameEquals("sapFqdn"u8)) + { + sapFqdn = property.Value.GetString(); + continue; + } + if (property.NameEquals("sshPrivateKey"u8)) + { + sshPrivateKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("highAvailabilitySoftwareConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highAvailabilitySoftwareConfiguration = HighAvailabilitySoftwareConfiguration.DeserializeHighAvailabilitySoftwareConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("softwareInstallationType"u8)) + { + softwareInstallationType = new SapSoftwareInstallationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ServiceInitiatedSoftwareConfiguration( + softwareInstallationType, + serializedAdditionalRawData, + bomUrl, + softwareVersion, + sapBitsStorageAccountId, + sapFqdn, + sshPrivateKey, + highAvailabilitySoftwareConfiguration); + } + + BinaryData 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(ServiceInitiatedSoftwareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ServiceInitiatedSoftwareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeServiceInitiatedSoftwareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ServiceInitiatedSoftwareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.cs new file mode 100644 index 000000000000..74baf107de2a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ServiceInitiatedSoftwareConfiguration.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.SapVirtualInstances.Models +{ + /// The SAP Software configuration Input when the software is to be installed by service. + public partial class ServiceInitiatedSoftwareConfiguration : SoftwareConfiguration + { + /// Initializes a new instance of . + /// The URL to the SAP Build of Materials(BOM) file. + /// The software version to install. + /// The SAP bits storage account id. + /// The FQDN to set for the SAP system during install. + /// The SSH private key. + /// , , , or is null. + public ServiceInitiatedSoftwareConfiguration(string bomUri, string softwareVersion, string sapBitsStorageAccountId, string sapFqdn, string sshPrivateKey) + { + Argument.AssertNotNull(bomUri, nameof(bomUri)); + Argument.AssertNotNull(softwareVersion, nameof(softwareVersion)); + Argument.AssertNotNull(sapBitsStorageAccountId, nameof(sapBitsStorageAccountId)); + Argument.AssertNotNull(sapFqdn, nameof(sapFqdn)); + Argument.AssertNotNull(sshPrivateKey, nameof(sshPrivateKey)); + + BomUri = bomUri; + SoftwareVersion = softwareVersion; + SapBitsStorageAccountId = sapBitsStorageAccountId; + SapFqdn = sapFqdn; + SshPrivateKey = sshPrivateKey; + SoftwareInstallationType = SapSoftwareInstallationType.ServiceInitiated; + } + + /// Initializes a new instance of . + /// The SAP software installation type. + /// Keeps track of any properties unknown to the library. + /// The URL to the SAP Build of Materials(BOM) file. + /// The software version to install. + /// The SAP bits storage account id. + /// The FQDN to set for the SAP system during install. + /// The SSH private key. + /// Gets or sets the HA software configuration. + internal ServiceInitiatedSoftwareConfiguration(SapSoftwareInstallationType softwareInstallationType, IDictionary serializedAdditionalRawData, string bomUri, string softwareVersion, string sapBitsStorageAccountId, string sapFqdn, string sshPrivateKey, HighAvailabilitySoftwareConfiguration highAvailabilitySoftwareConfiguration) : base(softwareInstallationType, serializedAdditionalRawData) + { + BomUri = bomUri; + SoftwareVersion = softwareVersion; + SapBitsStorageAccountId = sapBitsStorageAccountId; + SapFqdn = sapFqdn; + SshPrivateKey = sshPrivateKey; + HighAvailabilitySoftwareConfiguration = highAvailabilitySoftwareConfiguration; + SoftwareInstallationType = softwareInstallationType; + } + + /// Initializes a new instance of for deserialization. + internal ServiceInitiatedSoftwareConfiguration() + { + } + + /// The URL to the SAP Build of Materials(BOM) file. + public string BomUri { get; set; } + /// The software version to install. + public string SoftwareVersion { get; set; } + /// The SAP bits storage account id. + public string SapBitsStorageAccountId { get; set; } + /// The FQDN to set for the SAP system during install. + public string SapFqdn { get; set; } + /// The SSH private key. + public string SshPrivateKey { get; set; } + /// Gets or sets the HA software configuration. + public HighAvailabilitySoftwareConfiguration HighAvailabilitySoftwareConfiguration { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.Serialization.cs new file mode 100644 index 000000000000..9fe70e7ccbde --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.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.SapVirtualInstances.Models +{ + public partial class SharedStorageResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SharedStorageResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SharedStorageAccountName)) + { + writer.WritePropertyName("sharedStorageAccountName"u8); + writer.WriteStringValue(SharedStorageAccountName); + } + if (Optional.IsDefined(SharedStorageAccountPrivateEndPointName)) + { + writer.WritePropertyName("sharedStorageAccountPrivateEndPointName"u8); + writer.WriteStringValue(SharedStorageAccountPrivateEndPointName); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + SharedStorageResourceNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SharedStorageResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSharedStorageResourceNames(document.RootElement, options); + } + + internal static SharedStorageResourceNames DeserializeSharedStorageResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string sharedStorageAccountName = default; + string sharedStorageAccountPrivateEndPointName = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sharedStorageAccountName"u8)) + { + sharedStorageAccountName = property.Value.GetString(); + continue; + } + if (property.NameEquals("sharedStorageAccountPrivateEndPointName"u8)) + { + sharedStorageAccountPrivateEndPointName = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SharedStorageResourceNames(sharedStorageAccountName, sharedStorageAccountPrivateEndPointName, serializedAdditionalRawData); + } + + BinaryData 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(SharedStorageResourceNames)} does not support writing '{options.Format}' format."); + } + } + + SharedStorageResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSharedStorageResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SharedStorageResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.cs new file mode 100644 index 000000000000..a63616969347 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SharedStorageResourceNames.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.SapVirtualInstances.Models +{ + /// The resource names object for shared storage. + public partial class SharedStorageResourceNames + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SharedStorageResourceNames() + { + } + + /// Initializes a new instance of . + /// The full name of the shared storage account. If it is not provided, it will be defaulted to {SID}nfs{guid of 15 chars}. + /// The full name of private end point for the shared storage account. If it is not provided, it will be defaulted to {storageAccountName}_pe. + /// Keeps track of any properties unknown to the library. + internal SharedStorageResourceNames(string sharedStorageAccountName, string sharedStorageAccountPrivateEndPointName, IDictionary serializedAdditionalRawData) + { + SharedStorageAccountName = sharedStorageAccountName; + SharedStorageAccountPrivateEndPointName = sharedStorageAccountPrivateEndPointName; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The full name of the shared storage account. If it is not provided, it will be defaulted to {SID}nfs{guid of 15 chars}. + public string SharedStorageAccountName { get; set; } + /// The full name of private end point for the shared storage account. If it is not provided, it will be defaulted to {storageAccountName}_pe. + public string SharedStorageAccountPrivateEndPointName { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.Serialization.cs new file mode 100644 index 000000000000..85822bd9ffe8 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.Serialization.cs @@ -0,0 +1,201 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class SingleServerConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SingleServerConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(NetworkConfiguration)) + { + writer.WritePropertyName("networkConfiguration"u8); + writer.WriteObjectValue(NetworkConfiguration, options); + } + if (Optional.IsDefined(DatabaseType)) + { + writer.WritePropertyName("databaseType"u8); + writer.WriteStringValue(DatabaseType.Value.ToString()); + } + writer.WritePropertyName("subnetId"u8); + writer.WriteStringValue(SubnetId); + writer.WritePropertyName("virtualMachineConfiguration"u8); + writer.WriteObjectValue(VirtualMachineConfiguration, options); + if (Optional.IsDefined(DbDiskConfiguration)) + { + writer.WritePropertyName("dbDiskConfiguration"u8); + writer.WriteObjectValue(DbDiskConfiguration, options); + } + if (Optional.IsDefined(CustomResourceNames)) + { + writer.WritePropertyName("customResourceNames"u8); + writer.WriteObjectValue(CustomResourceNames, options); + } + } + + SingleServerConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleServerConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleServerConfiguration(document.RootElement, options); + } + + internal static SingleServerConfiguration DeserializeSingleServerConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkConfiguration networkConfiguration = default; + SapDatabaseType? databaseType = default; + string subnetId = default; + VirtualMachineConfiguration virtualMachineConfiguration = default; + DiskConfiguration dbDiskConfiguration = default; + SingleServerCustomResourceNames customResourceNames = default; + string appResourceGroup = default; + SapDeploymentType deploymentType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("networkConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkConfiguration = NetworkConfiguration.DeserializeNetworkConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("databaseType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseType = new SapDatabaseType(property.Value.GetString()); + continue; + } + if (property.NameEquals("subnetId"u8)) + { + subnetId = property.Value.GetString(); + continue; + } + if (property.NameEquals("virtualMachineConfiguration"u8)) + { + virtualMachineConfiguration = VirtualMachineConfiguration.DeserializeVirtualMachineConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("dbDiskConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + dbDiskConfiguration = DiskConfiguration.DeserializeDiskConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("customResourceNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customResourceNames = SingleServerCustomResourceNames.DeserializeSingleServerCustomResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("appResourceGroup"u8)) + { + appResourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SingleServerConfiguration( + appResourceGroup, + deploymentType, + serializedAdditionalRawData, + networkConfiguration, + databaseType, + subnetId, + virtualMachineConfiguration, + dbDiskConfiguration, + customResourceNames); + } + + BinaryData 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(SingleServerConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SingleServerConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSingleServerConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleServerConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.cs new file mode 100644 index 000000000000..0c9786b43b71 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerConfiguration.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.SapVirtualInstances.Models +{ + /// Gets or sets the single server configuration. For prerequisites for creating the infrastructure, please see [here](https://go.microsoft.com/fwlink/?linkid=2212611&clcid=0x409). + public partial class SingleServerConfiguration : InfrastructureConfiguration + { + /// Initializes a new instance of . + /// The application resource group where SAP system resources will be deployed. + /// The subnet id. + /// Gets or sets the virtual machine configuration. + /// , or is null. + public SingleServerConfiguration(string appResourceGroup, string subnetId, VirtualMachineConfiguration virtualMachineConfiguration) : base(appResourceGroup) + { + Argument.AssertNotNull(appResourceGroup, nameof(appResourceGroup)); + Argument.AssertNotNull(subnetId, nameof(subnetId)); + Argument.AssertNotNull(virtualMachineConfiguration, nameof(virtualMachineConfiguration)); + + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + DeploymentType = SapDeploymentType.SingleServer; + } + + /// Initializes a new instance of . + /// The application resource group where SAP system resources will be deployed. + /// The SAP deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + /// Network configuration for the server. + /// The database type. + /// The subnet id. + /// Gets or sets the virtual machine configuration. + /// Gets or sets the disk configuration. + /// + /// The set of custom names to be used for underlying azure resources that are part of the SAP system. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + internal SingleServerConfiguration(string appResourceGroup, SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData, NetworkConfiguration networkConfiguration, SapDatabaseType? databaseType, string subnetId, VirtualMachineConfiguration virtualMachineConfiguration, DiskConfiguration dbDiskConfiguration, SingleServerCustomResourceNames customResourceNames) : base(appResourceGroup, deploymentType, serializedAdditionalRawData) + { + NetworkConfiguration = networkConfiguration; + DatabaseType = databaseType; + SubnetId = subnetId; + VirtualMachineConfiguration = virtualMachineConfiguration; + DbDiskConfiguration = dbDiskConfiguration; + CustomResourceNames = customResourceNames; + DeploymentType = deploymentType; + } + + /// Initializes a new instance of for deserialization. + internal SingleServerConfiguration() + { + } + + /// Network configuration for the server. + internal NetworkConfiguration NetworkConfiguration { get; set; } + /// Specifies whether a secondary IP address should be added to the network interface on all VMs of the SAP system being deployed. + public bool? IsSecondaryIPEnabled + { + get => NetworkConfiguration is null ? default : NetworkConfiguration.IsSecondaryIPEnabled; + set + { + if (NetworkConfiguration is null) + NetworkConfiguration = new NetworkConfiguration(); + NetworkConfiguration.IsSecondaryIPEnabled = value; + } + } + + /// The database type. + public SapDatabaseType? DatabaseType { get; set; } + /// The subnet id. + public string SubnetId { get; set; } + /// Gets or sets the virtual machine configuration. + public VirtualMachineConfiguration VirtualMachineConfiguration { get; set; } + /// Gets or sets the disk configuration. + internal DiskConfiguration DbDiskConfiguration { get; set; } + /// The disk configuration for the db volume. For HANA, Required volumes are: ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os'], Optional volume : ['backup']. + public IDictionary DiskVolumeConfigurations + { + get + { + if (DbDiskConfiguration is null) + DbDiskConfiguration = new DiskConfiguration(); + return DbDiskConfiguration.DiskVolumeConfigurations; + } + } + + /// + /// The set of custom names to be used for underlying azure resources that are part of the SAP system. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public SingleServerCustomResourceNames CustomResourceNames { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.Serialization.cs new file mode 100644 index 000000000000..e7f92e3d834a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownSingleServerCustomResourceNames))] + public partial class SingleServerCustomResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SingleServerCustomResourceNames)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("namingPatternType"u8); + writer.WriteStringValue(NamingPatternType.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 + } + } + } + + SingleServerCustomResourceNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleServerCustomResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleServerCustomResourceNames(document.RootElement, options); + } + + internal static SingleServerCustomResourceNames DeserializeSingleServerCustomResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("namingPatternType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "FullResourceName": return SingleServerFullResourceNames.DeserializeSingleServerFullResourceNames(element, options); + } + } + return UnknownSingleServerCustomResourceNames.DeserializeUnknownSingleServerCustomResourceNames(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(SingleServerCustomResourceNames)} does not support writing '{options.Format}' format."); + } + } + + SingleServerCustomResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSingleServerCustomResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleServerCustomResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.cs new file mode 100644 index 000000000000..707269bbfa9c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerCustomResourceNames.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.SapVirtualInstances.Models +{ + /// + /// The resource-names input to specify custom names for underlying azure resources that are part of a single server SAP system. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public abstract partial class SingleServerCustomResourceNames + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 SingleServerCustomResourceNames() + { + } + + /// Initializes a new instance of . + /// The naming pattern type. + /// Keeps track of any properties unknown to the library. + internal SingleServerCustomResourceNames(NamingPatternType namingPatternType, IDictionary serializedAdditionalRawData) + { + NamingPatternType = namingPatternType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The naming pattern type. + internal NamingPatternType NamingPatternType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.Serialization.cs new file mode 100644 index 000000000000..35815e7c5de2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.Serialization.cs @@ -0,0 +1,125 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class SingleServerFullResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SingleServerFullResourceNames)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(VirtualMachine)) + { + writer.WritePropertyName("virtualMachine"u8); + writer.WriteObjectValue(VirtualMachine, options); + } + } + + SingleServerFullResourceNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleServerFullResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleServerFullResourceNames(document.RootElement, options); + } + + internal static SingleServerFullResourceNames DeserializeSingleServerFullResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + VirtualMachineResourceNames virtualMachine = default; + NamingPatternType namingPatternType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("virtualMachine"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + virtualMachine = VirtualMachineResourceNames.DeserializeVirtualMachineResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("namingPatternType"u8)) + { + namingPatternType = new NamingPatternType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SingleServerFullResourceNames(namingPatternType, serializedAdditionalRawData, virtualMachine); + } + + BinaryData 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(SingleServerFullResourceNames)} does not support writing '{options.Format}' format."); + } + } + + SingleServerFullResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSingleServerFullResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleServerFullResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.cs new file mode 100644 index 000000000000..5d2c0d9d3cec --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerFullResourceNames.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The resource name object where the specified values will be full resource names of the corresponding resources in a single server SAP system. + public partial class SingleServerFullResourceNames : SingleServerCustomResourceNames + { + /// Initializes a new instance of . + public SingleServerFullResourceNames() + { + NamingPatternType = NamingPatternType.FullResourceName; + } + + /// Initializes a new instance of . + /// The naming pattern type. + /// Keeps track of any properties unknown to the library. + /// The resource names object for virtual machine and related resources. + internal SingleServerFullResourceNames(NamingPatternType namingPatternType, IDictionary serializedAdditionalRawData, VirtualMachineResourceNames virtualMachine) : base(namingPatternType, serializedAdditionalRawData) + { + VirtualMachine = virtualMachine; + NamingPatternType = namingPatternType; + } + + /// The resource names object for virtual machine and related resources. + public VirtualMachineResourceNames VirtualMachine { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.Serialization.cs new file mode 100644 index 000000000000..ade592cc8c65 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.Serialization.cs @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class SingleServerRecommendationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SingleServerRecommendationResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(VmSku)) + { + writer.WritePropertyName("vmSku"u8); + writer.WriteStringValue(VmSku); + } + } + + SingleServerRecommendationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleServerRecommendationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleServerRecommendationResult(document.RootElement, options); + } + + internal static SingleServerRecommendationResult DeserializeSingleServerRecommendationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string vmSku = default; + SapDeploymentType deploymentType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmSku"u8)) + { + vmSku = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SingleServerRecommendationResult(deploymentType, serializedAdditionalRawData, vmSku); + } + + BinaryData 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(SingleServerRecommendationResult)} does not support writing '{options.Format}' format."); + } + } + + SingleServerRecommendationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSingleServerRecommendationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleServerRecommendationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.cs new file mode 100644 index 000000000000..8da9f7ba1dba --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SingleServerRecommendationResult.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The recommended configuration for a single server SAP system. + public partial class SingleServerRecommendationResult : SapSizingRecommendationResult + { + /// Initializes a new instance of . + internal SingleServerRecommendationResult() + { + DeploymentType = SapDeploymentType.SingleServer; + } + + /// Initializes a new instance of . + /// The deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + /// The recommended VM SKU for single server. + internal SingleServerRecommendationResult(SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData, string vmSku) : base(deploymentType, serializedAdditionalRawData) + { + VmSku = vmSku; + DeploymentType = deploymentType; + } + + /// The recommended VM SKU for single server. + public string VmSku { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.Serialization.cs new file mode 100644 index 000000000000..94e0443f4816 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SkipFileShareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SkipFileShareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SkipFileShareConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SkipFileShareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSkipFileShareConfiguration(document.RootElement, options); + } + + internal static SkipFileShareConfiguration DeserializeSkipFileShareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FileShareConfigurationType configurationType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("configurationType"u8)) + { + configurationType = new FileShareConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SkipFileShareConfiguration(configurationType, serializedAdditionalRawData); + } + + BinaryData 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(SkipFileShareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SkipFileShareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSkipFileShareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SkipFileShareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.cs new file mode 100644 index 000000000000..0c117b45e74e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SkipFileShareConfiguration.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the file share configuration for scenarios where transport directory fileshare is not created or required. + public partial class SkipFileShareConfiguration : FileShareConfiguration + { + /// Initializes a new instance of . + public SkipFileShareConfiguration() + { + ConfigurationType = FileShareConfigurationType.Skip; + } + + /// Initializes a new instance of . + /// The type of file share config, eg: Mount/CreateAndMount/Skip. + /// Keeps track of any properties unknown to the library. + internal SkipFileShareConfiguration(FileShareConfigurationType configurationType, IDictionary serializedAdditionalRawData) : base(configurationType, serializedAdditionalRawData) + { + ConfigurationType = configurationType; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.Serialization.cs new file mode 100644 index 000000000000..359d709161df --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.Serialization.cs @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownSoftwareConfiguration))] + public partial class SoftwareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SoftwareConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("softwareInstallationType"u8); + writer.WriteStringValue(SoftwareInstallationType.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 + } + } + } + + SoftwareConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SoftwareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSoftwareConfiguration(document.RootElement, options); + } + + internal static SoftwareConfiguration DeserializeSoftwareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("softwareInstallationType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "External": return ExternalInstallationSoftwareConfiguration.DeserializeExternalInstallationSoftwareConfiguration(element, options); + case "SAPInstallWithoutOSConfig": return SapInstallWithoutOSConfigSoftwareConfiguration.DeserializeSapInstallWithoutOSConfigSoftwareConfiguration(element, options); + case "ServiceInitiated": return ServiceInitiatedSoftwareConfiguration.DeserializeServiceInitiatedSoftwareConfiguration(element, options); + } + } + return UnknownSoftwareConfiguration.DeserializeUnknownSoftwareConfiguration(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(SoftwareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SoftwareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSoftwareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SoftwareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.cs new file mode 100644 index 000000000000..571c580ec4b4 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SoftwareConfiguration.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.SapVirtualInstances.Models +{ + /// + /// The SAP Software configuration Input. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include , and . + /// + public abstract partial class SoftwareConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 SoftwareConfiguration() + { + } + + /// Initializes a new instance of . + /// The SAP software installation type. + /// Keeps track of any properties unknown to the library. + internal SoftwareConfiguration(SapSoftwareInstallationType softwareInstallationType, IDictionary serializedAdditionalRawData) + { + SoftwareInstallationType = softwareInstallationType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The SAP software installation type. + internal SapSoftwareInstallationType SoftwareInstallationType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.Serialization.cs new file mode 100644 index 000000000000..a2a85ee227c7 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.Serialization.cs @@ -0,0 +1,143 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class SshConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SshConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsCollectionDefined(PublicKeys)) + { + writer.WritePropertyName("publicKeys"u8); + writer.WriteStartArray(); + foreach (var item in PublicKeys) + { + 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 + } + } + } + + SshConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SshConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSshConfiguration(document.RootElement, options); + } + + internal static SshConfiguration DeserializeSshConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + IList publicKeys = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("publicKeys"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(SshPublicKey.DeserializeSshPublicKey(item, options)); + } + publicKeys = array; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SshConfiguration(publicKeys ?? 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(SshConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SshConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSshConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SshConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.cs new file mode 100644 index 000000000000..316b88634fcc --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshConfiguration.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.SapVirtualInstances.Models +{ + /// SSH configuration for Linux based VMs running on Azure. + internal partial class SshConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SshConfiguration() + { + PublicKeys = new ChangeTrackingList(); + } + + /// Initializes a new instance of . + /// The list of SSH public keys used to authenticate with linux based VMs. + /// Keeps track of any properties unknown to the library. + internal SshConfiguration(IList publicKeys, IDictionary serializedAdditionalRawData) + { + PublicKeys = publicKeys; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The list of SSH public keys used to authenticate with linux based VMs. + public IList PublicKeys { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.Serialization.cs new file mode 100644 index 000000000000..07a1e61003a1 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.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.SapVirtualInstances.Models +{ + public partial class SshKeyPair : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SshKeyPair)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(PublicKey)) + { + writer.WritePropertyName("publicKey"u8); + writer.WriteStringValue(PublicKey); + } + if (Optional.IsDefined(PrivateKey)) + { + writer.WritePropertyName("privateKey"u8); + writer.WriteStringValue(PrivateKey); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + SshKeyPair IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SshKeyPair)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSshKeyPair(document.RootElement, options); + } + + internal static SshKeyPair DeserializeSshKeyPair(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string publicKey = default; + string privateKey = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("publicKey"u8)) + { + publicKey = property.Value.GetString(); + continue; + } + if (property.NameEquals("privateKey"u8)) + { + privateKey = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SshKeyPair(publicKey, privateKey, serializedAdditionalRawData); + } + + BinaryData 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(SshKeyPair)} does not support writing '{options.Format}' format."); + } + } + + SshKeyPair IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSshKeyPair(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SshKeyPair)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.cs new file mode 100644 index 000000000000..f9d170196f73 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshKeyPair.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.SapVirtualInstances.Models +{ + /// The SSH Key-pair used to authenticate with the VM. The key needs to be at least 2048-bit and in ssh-rsa format. For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://learn.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + public partial class SshKeyPair + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SshKeyPair() + { + } + + /// Initializes a new instance of . + /// SSH public key. + /// SSH private key. + /// Keeps track of any properties unknown to the library. + internal SshKeyPair(string publicKey, string privateKey, IDictionary serializedAdditionalRawData) + { + PublicKey = publicKey; + PrivateKey = privateKey; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// SSH public key. + public string PublicKey { get; set; } + /// SSH private key. + public string PrivateKey { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.Serialization.cs new file mode 100644 index 000000000000..a2c47d6036c0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.Serialization.cs @@ -0,0 +1,129 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class SshPublicKey : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SshPublicKey)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(KeyData)) + { + writer.WritePropertyName("keyData"u8); + writer.WriteStringValue(KeyData); + } + if (options.Format != "W" && _serializedAdditionalRawData != null) + { + foreach (var 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 + } + } + } + + SshPublicKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SshPublicKey)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSshPublicKey(document.RootElement, options); + } + + internal static SshPublicKey DeserializeSshPublicKey(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string keyData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("keyData"u8)) + { + keyData = property.Value.GetString(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new SshPublicKey(keyData, serializedAdditionalRawData); + } + + BinaryData 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(SshPublicKey)} does not support writing '{options.Format}' format."); + } + } + + SshPublicKey IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSshPublicKey(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SshPublicKey)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.cs new file mode 100644 index 000000000000..f5eab58038c4 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/SshPublicKey.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.SapVirtualInstances.Models +{ + /// Contains information about SSH certificate public key and the path on the Linux VM where the public key is placed. + public partial class SshPublicKey + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 SshPublicKey() + { + } + + /// Initializes a new instance of . + /// SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://learn.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + /// Keeps track of any properties unknown to the library. + internal SshPublicKey(string keyData, IDictionary serializedAdditionalRawData) + { + KeyData = keyData; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// SSH public key certificate used to authenticate with the VM through ssh. The key needs to be at least 2048-bit and in ssh-rsa format. <br><br> For creating ssh keys, see [Create SSH keys on Linux and Mac for Linux VMs in Azure](https://learn.microsoft.com/azure/virtual-machines/linux/create-ssh-keys-detailed). + public string KeyData { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.Serialization.cs new file mode 100644 index 000000000000..ebd9ea27d193 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.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.SapVirtualInstances.Models +{ + public partial class StartContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(StartContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(StartVm)) + { + writer.WritePropertyName("startVm"u8); + writer.WriteBooleanValue(StartVm.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 + } + } + } + + StartContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StartContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStartContent(document.RootElement, options); + } + + internal static StartContent DeserializeStartContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + bool? startVm = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("startVm"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + startVm = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StartContent(startVm, serializedAdditionalRawData); + } + + BinaryData 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(StartContent)} does not support writing '{options.Format}' format."); + } + } + + StartContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStartContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StartContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.cs new file mode 100644 index 000000000000..c9b715489611 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StartContent.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.SapVirtualInstances.Models +{ + /// Start SAP instance(s) request body. + public partial class StartContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 StartContent() + { + } + + /// Initializes a new instance of . + /// The boolean value indicates whether to start the virtual machines before starting the SAP instances. + /// Keeps track of any properties unknown to the library. + internal StartContent(bool? startVm, IDictionary serializedAdditionalRawData) + { + StartVm = startVm; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The boolean value indicates whether to start the virtual machines before starting the SAP instances. + public bool? StartVm { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.Serialization.cs new file mode 100644 index 000000000000..b64cd3e2ee3c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.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.SapVirtualInstances.Models +{ + public partial class StopContent : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(StopContent)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(SoftStopTimeoutSeconds)) + { + writer.WritePropertyName("softStopTimeoutSeconds"u8); + writer.WriteNumberValue(SoftStopTimeoutSeconds.Value); + } + if (Optional.IsDefined(DeallocateVm)) + { + writer.WritePropertyName("deallocateVm"u8); + writer.WriteBooleanValue(DeallocateVm.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 + } + } + } + + StopContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StopContent)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStopContent(document.RootElement, options); + } + + internal static StopContent DeserializeStopContent(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + long? softStopTimeoutSeconds = default; + bool? deallocateVm = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("softStopTimeoutSeconds"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + softStopTimeoutSeconds = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("deallocateVm"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deallocateVm = property.Value.GetBoolean(); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StopContent(softStopTimeoutSeconds, deallocateVm, serializedAdditionalRawData); + } + + BinaryData 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(StopContent)} does not support writing '{options.Format}' format."); + } + } + + StopContent IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStopContent(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StopContent)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.cs new file mode 100644 index 000000000000..19f256f99e5c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StopContent.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.SapVirtualInstances.Models +{ + /// Stop SAP instance(s) request body. + public partial class StopContent + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 StopContent() + { + } + + /// Initializes a new instance of . + /// This parameter defines how long (in seconds) the soft shutdown waits until the RFC/HTTP clients no longer consider the server for calls with load balancing. Value 0 means that the kernel does not wait, but goes directly into the next shutdown state, i.e. hard stop. + /// The boolean value indicates whether to Stop and deallocate the virtual machines along with the SAP instances. + /// Keeps track of any properties unknown to the library. + internal StopContent(long? softStopTimeoutSeconds, bool? deallocateVm, IDictionary serializedAdditionalRawData) + { + SoftStopTimeoutSeconds = softStopTimeoutSeconds; + DeallocateVm = deallocateVm; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// This parameter defines how long (in seconds) the soft shutdown waits until the RFC/HTTP clients no longer consider the server for calls with load balancing. Value 0 means that the kernel does not wait, but goes directly into the next shutdown state, i.e. hard stop. + public long? SoftStopTimeoutSeconds { get; set; } + /// The boolean value indicates whether to Stop and deallocate the virtual machines along with the SAP instances. + public bool? DeallocateVm { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.Serialization.cs new file mode 100644 index 000000000000..abf6b7f87a9d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.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.SapVirtualInstances.Models +{ + internal partial class StorageConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(StorageConfiguration)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(TransportFileShareConfiguration)) + { + writer.WritePropertyName("transportFileShareConfiguration"u8); + writer.WriteObjectValue(TransportFileShareConfiguration, 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 + } + } + } + + StorageConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(StorageConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeStorageConfiguration(document.RootElement, options); + } + + internal static StorageConfiguration DeserializeStorageConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FileShareConfiguration transportFileShareConfiguration = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("transportFileShareConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + transportFileShareConfiguration = FileShareConfiguration.DeserializeFileShareConfiguration(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new StorageConfiguration(transportFileShareConfiguration, serializedAdditionalRawData); + } + + BinaryData 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(StorageConfiguration)} does not support writing '{options.Format}' format."); + } + } + + StorageConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeStorageConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(StorageConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.cs new file mode 100644 index 000000000000..faaba7453055 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/StorageConfiguration.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.SapVirtualInstances.Models +{ + /// Gets or sets the storage configuration. + internal partial class StorageConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 StorageConfiguration() + { + } + + /// Initializes a new instance of . + /// + /// The properties of the transport directory attached to the VIS. The default for transportFileShareConfiguration is the createAndMount flow if storage configuration is missing. + /// 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 StorageConfiguration(FileShareConfiguration transportFileShareConfiguration, IDictionary serializedAdditionalRawData) + { + TransportFileShareConfiguration = transportFileShareConfiguration; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// + /// The properties of the transport directory attached to the VIS. The default for transportFileShareConfiguration is the createAndMount flow if storage configuration is missing. + /// 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 FileShareConfiguration TransportFileShareConfiguration { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.Serialization.cs new file mode 100644 index 000000000000..21e761756ca3 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.Serialization.cs @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class ThreeTierConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ThreeTierConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(NetworkConfiguration)) + { + writer.WritePropertyName("networkConfiguration"u8); + writer.WriteObjectValue(NetworkConfiguration, options); + } + writer.WritePropertyName("centralServer"u8); + writer.WriteObjectValue(CentralServer, options); + writer.WritePropertyName("applicationServer"u8); + writer.WriteObjectValue(ApplicationServer, options); + writer.WritePropertyName("databaseServer"u8); + writer.WriteObjectValue(DatabaseServer, options); + if (Optional.IsDefined(HighAvailabilityConfig)) + { + writer.WritePropertyName("highAvailabilityConfig"u8); + writer.WriteObjectValue(HighAvailabilityConfig, options); + } + if (Optional.IsDefined(StorageConfiguration)) + { + writer.WritePropertyName("storageConfiguration"u8); + writer.WriteObjectValue(StorageConfiguration, options); + } + if (Optional.IsDefined(CustomResourceNames)) + { + writer.WritePropertyName("customResourceNames"u8); + writer.WriteObjectValue(CustomResourceNames, options); + } + } + + ThreeTierConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ThreeTierConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeThreeTierConfiguration(document.RootElement, options); + } + + internal static ThreeTierConfiguration DeserializeThreeTierConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NetworkConfiguration networkConfiguration = default; + CentralServerConfiguration centralServer = default; + ApplicationServerConfiguration applicationServer = default; + DatabaseConfiguration databaseServer = default; + HighAvailabilityConfiguration highAvailabilityConfig = default; + StorageConfiguration storageConfiguration = default; + ThreeTierCustomResourceNames customResourceNames = default; + string appResourceGroup = default; + SapDeploymentType deploymentType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("networkConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + networkConfiguration = NetworkConfiguration.DeserializeNetworkConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("centralServer"u8)) + { + centralServer = CentralServerConfiguration.DeserializeCentralServerConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("applicationServer"u8)) + { + applicationServer = ApplicationServerConfiguration.DeserializeApplicationServerConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("databaseServer"u8)) + { + databaseServer = DatabaseConfiguration.DeserializeDatabaseConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("highAvailabilityConfig"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + highAvailabilityConfig = HighAvailabilityConfiguration.DeserializeHighAvailabilityConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("storageConfiguration"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + storageConfiguration = StorageConfiguration.DeserializeStorageConfiguration(property.Value, options); + continue; + } + if (property.NameEquals("customResourceNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + customResourceNames = ThreeTierCustomResourceNames.DeserializeThreeTierCustomResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("appResourceGroup"u8)) + { + appResourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ThreeTierConfiguration( + appResourceGroup, + deploymentType, + serializedAdditionalRawData, + networkConfiguration, + centralServer, + applicationServer, + databaseServer, + highAvailabilityConfig, + storageConfiguration, + customResourceNames); + } + + BinaryData 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(ThreeTierConfiguration)} does not support writing '{options.Format}' format."); + } + } + + ThreeTierConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeThreeTierConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ThreeTierConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.cs new file mode 100644 index 000000000000..dd9e9cc5eff0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierConfiguration.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; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Gets or sets the three tier SAP configuration. For prerequisites for creating the infrastructure, please see [here](https://go.microsoft.com/fwlink/?linkid=2212611&clcid=0x409). + public partial class ThreeTierConfiguration : InfrastructureConfiguration + { + /// Initializes a new instance of . + /// The application resource group where SAP system resources will be deployed. + /// The central server configuration. + /// The application server configuration. + /// The database configuration. + /// , , or is null. + public ThreeTierConfiguration(string appResourceGroup, CentralServerConfiguration centralServer, ApplicationServerConfiguration applicationServer, DatabaseConfiguration databaseServer) : base(appResourceGroup) + { + Argument.AssertNotNull(appResourceGroup, nameof(appResourceGroup)); + Argument.AssertNotNull(centralServer, nameof(centralServer)); + Argument.AssertNotNull(applicationServer, nameof(applicationServer)); + Argument.AssertNotNull(databaseServer, nameof(databaseServer)); + + CentralServer = centralServer; + ApplicationServer = applicationServer; + DatabaseServer = databaseServer; + DeploymentType = SapDeploymentType.ThreeTier; + } + + /// Initializes a new instance of . + /// The application resource group where SAP system resources will be deployed. + /// The SAP deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + /// Network configuration common to all servers. + /// The central server configuration. + /// The application server configuration. + /// The database configuration. + /// The high availability configuration. + /// The storage configuration. + /// + /// The set of custom names to be used for underlying azure resources that are part of the SAP system. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + internal ThreeTierConfiguration(string appResourceGroup, SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData, NetworkConfiguration networkConfiguration, CentralServerConfiguration centralServer, ApplicationServerConfiguration applicationServer, DatabaseConfiguration databaseServer, HighAvailabilityConfiguration highAvailabilityConfig, StorageConfiguration storageConfiguration, ThreeTierCustomResourceNames customResourceNames) : base(appResourceGroup, deploymentType, serializedAdditionalRawData) + { + NetworkConfiguration = networkConfiguration; + CentralServer = centralServer; + ApplicationServer = applicationServer; + DatabaseServer = databaseServer; + HighAvailabilityConfig = highAvailabilityConfig; + StorageConfiguration = storageConfiguration; + CustomResourceNames = customResourceNames; + DeploymentType = deploymentType; + } + + /// Initializes a new instance of for deserialization. + internal ThreeTierConfiguration() + { + } + + /// Network configuration common to all servers. + internal NetworkConfiguration NetworkConfiguration { get; set; } + /// Specifies whether a secondary IP address should be added to the network interface on all VMs of the SAP system being deployed. + public bool? IsSecondaryIPEnabled + { + get => NetworkConfiguration is null ? default : NetworkConfiguration.IsSecondaryIPEnabled; + set + { + if (NetworkConfiguration is null) + NetworkConfiguration = new NetworkConfiguration(); + NetworkConfiguration.IsSecondaryIPEnabled = value; + } + } + + /// The central server configuration. + public CentralServerConfiguration CentralServer { get; set; } + /// The application server configuration. + public ApplicationServerConfiguration ApplicationServer { get; set; } + /// The database configuration. + public DatabaseConfiguration DatabaseServer { get; set; } + /// The high availability configuration. + internal HighAvailabilityConfiguration HighAvailabilityConfig { get; set; } + /// The high availability type. + public SapHighAvailabilityType? HighAvailabilityType + { + get => HighAvailabilityConfig is null ? default(SapHighAvailabilityType?) : HighAvailabilityConfig.HighAvailabilityType; + set + { + HighAvailabilityConfig = value.HasValue ? new HighAvailabilityConfiguration(value.Value) : null; + } + } + + /// The storage configuration. + internal StorageConfiguration StorageConfiguration { get; set; } + /// + /// The properties of the transport directory attached to the VIS. The default for transportFileShareConfiguration is the createAndMount flow if storage configuration is missing. + /// 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 FileShareConfiguration StorageTransportFileShareConfiguration + { + get => StorageConfiguration is null ? default : StorageConfiguration.TransportFileShareConfiguration; + set + { + if (StorageConfiguration is null) + StorageConfiguration = new StorageConfiguration(); + StorageConfiguration.TransportFileShareConfiguration = value; + } + } + + /// + /// The set of custom names to be used for underlying azure resources that are part of the SAP system. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public ThreeTierCustomResourceNames CustomResourceNames { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.Serialization.cs new file mode 100644 index 000000000000..a3151071903d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.Serialization.cs @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + [PersistableModelProxy(typeof(UnknownThreeTierCustomResourceNames))] + public partial class ThreeTierCustomResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ThreeTierCustomResourceNames)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("namingPatternType"u8); + writer.WriteStringValue(NamingPatternType.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 + } + } + } + + ThreeTierCustomResourceNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ThreeTierCustomResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeThreeTierCustomResourceNames(document.RootElement, options); + } + + internal static ThreeTierCustomResourceNames DeserializeThreeTierCustomResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + if (element.TryGetProperty("namingPatternType", out JsonElement discriminator)) + { + switch (discriminator.GetString()) + { + case "FullResourceName": return ThreeTierFullResourceNames.DeserializeThreeTierFullResourceNames(element, options); + } + } + return UnknownThreeTierCustomResourceNames.DeserializeUnknownThreeTierCustomResourceNames(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(ThreeTierCustomResourceNames)} does not support writing '{options.Format}' format."); + } + } + + ThreeTierCustomResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeThreeTierCustomResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ThreeTierCustomResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.cs new file mode 100644 index 000000000000..1da2eab3183d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierCustomResourceNames.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.SapVirtualInstances.Models +{ + /// + /// The resource-names input to specify custom names for underlying azure resources that are part of a three tier SAP system. + /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. + /// The available derived classes include . + /// + public abstract partial class ThreeTierCustomResourceNames + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload 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 ThreeTierCustomResourceNames() + { + } + + /// Initializes a new instance of . + /// The pattern type to be used for resource naming. + /// Keeps track of any properties unknown to the library. + internal ThreeTierCustomResourceNames(NamingPatternType namingPatternType, IDictionary serializedAdditionalRawData) + { + NamingPatternType = namingPatternType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The pattern type to be used for resource naming. + internal NamingPatternType NamingPatternType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.Serialization.cs new file mode 100644 index 000000000000..4689c06ed5b0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.Serialization.cs @@ -0,0 +1,176 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class ThreeTierFullResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ThreeTierFullResourceNames)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(CentralServer)) + { + writer.WritePropertyName("centralServer"u8); + writer.WriteObjectValue(CentralServer, options); + } + if (Optional.IsDefined(ApplicationServer)) + { + writer.WritePropertyName("applicationServer"u8); + writer.WriteObjectValue(ApplicationServer, options); + } + if (Optional.IsDefined(DatabaseServer)) + { + writer.WritePropertyName("databaseServer"u8); + writer.WriteObjectValue(DatabaseServer, options); + } + if (Optional.IsDefined(SharedStorage)) + { + writer.WritePropertyName("sharedStorage"u8); + writer.WriteObjectValue(SharedStorage, options); + } + } + + ThreeTierFullResourceNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ThreeTierFullResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeThreeTierFullResourceNames(document.RootElement, options); + } + + internal static ThreeTierFullResourceNames DeserializeThreeTierFullResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + CentralServerFullResourceNames centralServer = default; + ApplicationServerFullResourceNames applicationServer = default; + DatabaseServerFullResourceNames databaseServer = default; + SharedStorageResourceNames sharedStorage = default; + NamingPatternType namingPatternType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("centralServer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + centralServer = CentralServerFullResourceNames.DeserializeCentralServerFullResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("applicationServer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applicationServer = ApplicationServerFullResourceNames.DeserializeApplicationServerFullResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("databaseServer"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseServer = DatabaseServerFullResourceNames.DeserializeDatabaseServerFullResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("sharedStorage"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + sharedStorage = SharedStorageResourceNames.DeserializeSharedStorageResourceNames(property.Value, options); + continue; + } + if (property.NameEquals("namingPatternType"u8)) + { + namingPatternType = new NamingPatternType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ThreeTierFullResourceNames( + namingPatternType, + serializedAdditionalRawData, + centralServer, + applicationServer, + databaseServer, + sharedStorage); + } + + BinaryData 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(ThreeTierFullResourceNames)} does not support writing '{options.Format}' format."); + } + } + + ThreeTierFullResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeThreeTierFullResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ThreeTierFullResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.cs new file mode 100644 index 000000000000..30dac04bfc8d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierFullResourceNames.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The resource name object where the specified values will be full resource names of the corresponding resources in a three tier SAP system. + public partial class ThreeTierFullResourceNames : ThreeTierCustomResourceNames + { + /// Initializes a new instance of . + public ThreeTierFullResourceNames() + { + NamingPatternType = NamingPatternType.FullResourceName; + } + + /// Initializes a new instance of . + /// The pattern type to be used for resource naming. + /// Keeps track of any properties unknown to the library. + /// The full resource names object for central server layer resources. + /// The full resource names object for application layer resources. The number of entries in this list should be equal to the number VMs to be created for application layer. + /// The full resource names object for database layer resources. The number of entries in this list should be equal to the number VMs to be created for database layer. + /// The resource names object for shared storage. + internal ThreeTierFullResourceNames(NamingPatternType namingPatternType, IDictionary serializedAdditionalRawData, CentralServerFullResourceNames centralServer, ApplicationServerFullResourceNames applicationServer, DatabaseServerFullResourceNames databaseServer, SharedStorageResourceNames sharedStorage) : base(namingPatternType, serializedAdditionalRawData) + { + CentralServer = centralServer; + ApplicationServer = applicationServer; + DatabaseServer = databaseServer; + SharedStorage = sharedStorage; + NamingPatternType = namingPatternType; + } + + /// The full resource names object for central server layer resources. + public CentralServerFullResourceNames CentralServer { get; set; } + /// The full resource names object for application layer resources. The number of entries in this list should be equal to the number VMs to be created for application layer. + public ApplicationServerFullResourceNames ApplicationServer { get; set; } + /// The full resource names object for database layer resources. The number of entries in this list should be equal to the number VMs to be created for database layer. + public DatabaseServerFullResourceNames DatabaseServer { get; set; } + /// The resource names object for shared storage. + public SharedStorageResourceNames SharedStorage { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.Serialization.cs new file mode 100644 index 000000000000..18c506f2f1a6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.Serialization.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class ThreeTierRecommendationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ThreeTierRecommendationResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(DbVmSku)) + { + writer.WritePropertyName("dbVmSku"u8); + writer.WriteStringValue(DbVmSku); + } + if (Optional.IsDefined(DatabaseInstanceCount)) + { + writer.WritePropertyName("databaseInstanceCount"u8); + writer.WriteNumberValue(DatabaseInstanceCount.Value); + } + if (Optional.IsDefined(CentralServerVmSku)) + { + writer.WritePropertyName("centralServerVmSku"u8); + writer.WriteStringValue(CentralServerVmSku); + } + if (Optional.IsDefined(CentralServerInstanceCount)) + { + writer.WritePropertyName("centralServerInstanceCount"u8); + writer.WriteNumberValue(CentralServerInstanceCount.Value); + } + if (Optional.IsDefined(ApplicationServerVmSku)) + { + writer.WritePropertyName("applicationServerVmSku"u8); + writer.WriteStringValue(ApplicationServerVmSku); + } + if (Optional.IsDefined(ApplicationServerInstanceCount)) + { + writer.WritePropertyName("applicationServerInstanceCount"u8); + writer.WriteNumberValue(ApplicationServerInstanceCount.Value); + } + } + + ThreeTierRecommendationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ThreeTierRecommendationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeThreeTierRecommendationResult(document.RootElement, options); + } + + internal static ThreeTierRecommendationResult DeserializeThreeTierRecommendationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string dbVmSku = default; + long? databaseInstanceCount = default; + string centralServerVmSku = default; + long? centralServerInstanceCount = default; + string applicationServerVmSku = default; + long? applicationServerInstanceCount = default; + SapDeploymentType deploymentType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("dbVmSku"u8)) + { + dbVmSku = property.Value.GetString(); + continue; + } + if (property.NameEquals("databaseInstanceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + databaseInstanceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("centralServerVmSku"u8)) + { + centralServerVmSku = property.Value.GetString(); + continue; + } + if (property.NameEquals("centralServerInstanceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + centralServerInstanceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("applicationServerVmSku"u8)) + { + applicationServerVmSku = property.Value.GetString(); + continue; + } + if (property.NameEquals("applicationServerInstanceCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + applicationServerInstanceCount = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new ThreeTierRecommendationResult( + deploymentType, + serializedAdditionalRawData, + dbVmSku, + databaseInstanceCount, + centralServerVmSku, + centralServerInstanceCount, + applicationServerVmSku, + applicationServerInstanceCount); + } + + BinaryData 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(ThreeTierRecommendationResult)} does not support writing '{options.Format}' format."); + } + } + + ThreeTierRecommendationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeThreeTierRecommendationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ThreeTierRecommendationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.cs new file mode 100644 index 000000000000..cf68c754d75d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/ThreeTierRecommendationResult.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// The recommended configuration for a three tier SAP system. + public partial class ThreeTierRecommendationResult : SapSizingRecommendationResult + { + /// Initializes a new instance of . + internal ThreeTierRecommendationResult() + { + DeploymentType = SapDeploymentType.ThreeTier; + } + + /// Initializes a new instance of . + /// The deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + /// The database VM SKU. + /// The database server instance count. + /// The central server VM SKU. + /// The central server instance count. + /// The application server VM SKU. + /// The application server instance count. + internal ThreeTierRecommendationResult(SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData, string dbVmSku, long? databaseInstanceCount, string centralServerVmSku, long? centralServerInstanceCount, string applicationServerVmSku, long? applicationServerInstanceCount) : base(deploymentType, serializedAdditionalRawData) + { + DbVmSku = dbVmSku; + DatabaseInstanceCount = databaseInstanceCount; + CentralServerVmSku = centralServerVmSku; + CentralServerInstanceCount = centralServerInstanceCount; + ApplicationServerVmSku = applicationServerVmSku; + ApplicationServerInstanceCount = applicationServerInstanceCount; + DeploymentType = deploymentType; + } + + /// The database VM SKU. + public string DbVmSku { get; } + /// The database server instance count. + public long? DatabaseInstanceCount { get; } + /// The central server VM SKU. + public string CentralServerVmSku { get; } + /// The central server instance count. + public long? CentralServerInstanceCount { get; } + /// The application server VM SKU. + public string ApplicationServerVmSku { get; } + /// The application server instance count. + public long? ApplicationServerInstanceCount { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.Serialization.cs new file mode 100644 index 000000000000..306a68165137 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownFileShareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(FileShareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + FileShareConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(FileShareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeFileShareConfiguration(document.RootElement, options); + } + + internal static UnknownFileShareConfiguration DeserializeUnknownFileShareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + FileShareConfigurationType configurationType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("configurationType"u8)) + { + configurationType = new FileShareConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownFileShareConfiguration(configurationType, serializedAdditionalRawData); + } + + BinaryData 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(FileShareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + FileShareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeFileShareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(FileShareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.cs new file mode 100644 index 000000000000..d3588642b83c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownFileShareConfiguration.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of FileShareConfiguration. + internal partial class UnknownFileShareConfiguration : FileShareConfiguration + { + /// Initializes a new instance of . + /// The type of file share config, eg: Mount/CreateAndMount/Skip. + /// Keeps track of any properties unknown to the library. + internal UnknownFileShareConfiguration(FileShareConfigurationType configurationType, IDictionary serializedAdditionalRawData) : base(configurationType, serializedAdditionalRawData) + { + ConfigurationType = configurationType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownFileShareConfiguration() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.Serialization.cs new file mode 100644 index 000000000000..fee96cbfcace --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.Serialization.cs @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + internal partial class UnknownInfrastructureConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(InfrastructureConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + InfrastructureConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(InfrastructureConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeInfrastructureConfiguration(document.RootElement, options); + } + + internal static UnknownInfrastructureConfiguration DeserializeUnknownInfrastructureConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string appResourceGroup = default; + SapDeploymentType deploymentType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("appResourceGroup"u8)) + { + appResourceGroup = property.Value.GetString(); + continue; + } + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownInfrastructureConfiguration(appResourceGroup, deploymentType, serializedAdditionalRawData); + } + + BinaryData 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(InfrastructureConfiguration)} does not support writing '{options.Format}' format."); + } + } + + InfrastructureConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeInfrastructureConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(InfrastructureConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.cs new file mode 100644 index 000000000000..8cd6afc1beef --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownInfrastructureConfiguration.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of InfrastructureConfiguration. + internal partial class UnknownInfrastructureConfiguration : InfrastructureConfiguration + { + /// Initializes a new instance of . + /// The application resource group where SAP system resources will be deployed. + /// The SAP deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + internal UnknownInfrastructureConfiguration(string appResourceGroup, SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData) : base(appResourceGroup, deploymentType, serializedAdditionalRawData) + { + DeploymentType = deploymentType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownInfrastructureConfiguration() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.Serialization.cs new file mode 100644 index 000000000000..2d665f78c8f2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownOSConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(OSConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + OSConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(OSConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeOSConfiguration(document.RootElement, options); + } + + internal static UnknownOSConfiguration DeserializeUnknownOSConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OSType osType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("osType"u8)) + { + osType = new OSType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownOSConfiguration(osType, serializedAdditionalRawData); + } + + BinaryData 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(OSConfiguration)} does not support writing '{options.Format}' format."); + } + } + + OSConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeOSConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(OSConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.cs new file mode 100644 index 000000000000..266b67037b5b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownOSConfiguration.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of OSConfiguration. + internal partial class UnknownOSConfiguration : OSConfiguration + { + /// Initializes a new instance of . + /// The OS Type. + /// Keeps track of any properties unknown to the library. + internal UnknownOSConfiguration(OSType osType, IDictionary serializedAdditionalRawData) : base(osType, serializedAdditionalRawData) + { + OSType = osType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownOSConfiguration() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.Serialization.cs new file mode 100644 index 000000000000..7ffcecffdf21 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownSapConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SapConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapConfiguration(document.RootElement, options); + } + + internal static UnknownSapConfiguration DeserializeUnknownSapConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapConfigurationType configurationType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("configurationType"u8)) + { + configurationType = new SapConfigurationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownSapConfiguration(configurationType, serializedAdditionalRawData); + } + + BinaryData 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(SapConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SapConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.cs new file mode 100644 index 000000000000..43650e6a5ae5 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapConfiguration.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of SapConfiguration. + internal partial class UnknownSapConfiguration : SapConfiguration + { + /// Initializes a new instance of . + /// The configuration type. Eg: Deployment/Discovery. + /// Keeps track of any properties unknown to the library. + internal UnknownSapConfiguration(SapConfigurationType configurationType, IDictionary serializedAdditionalRawData) : base(configurationType, serializedAdditionalRawData) + { + ConfigurationType = configurationType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownSapConfiguration() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.Serialization.cs new file mode 100644 index 000000000000..a6188e419bf1 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownSapSizingRecommendationResult : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapSizingRecommendationResult)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SapSizingRecommendationResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapSizingRecommendationResult)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapSizingRecommendationResult(document.RootElement, options); + } + + internal static UnknownSapSizingRecommendationResult DeserializeUnknownSapSizingRecommendationResult(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapDeploymentType deploymentType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("deploymentType"u8)) + { + deploymentType = new SapDeploymentType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownSapSizingRecommendationResult(deploymentType, serializedAdditionalRawData); + } + + BinaryData 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(SapSizingRecommendationResult)} does not support writing '{options.Format}' format."); + } + } + + SapSizingRecommendationResult IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapSizingRecommendationResult(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapSizingRecommendationResult)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.cs new file mode 100644 index 000000000000..aed574f9819d --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSapSizingRecommendationResult.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of SapSizingRecommendationResult. + internal partial class UnknownSapSizingRecommendationResult : SapSizingRecommendationResult + { + /// Initializes a new instance of . + /// The deployment type. Eg: SingleServer/ThreeTier. + /// Keeps track of any properties unknown to the library. + internal UnknownSapSizingRecommendationResult(SapDeploymentType deploymentType, IDictionary serializedAdditionalRawData) : base(deploymentType, serializedAdditionalRawData) + { + DeploymentType = deploymentType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownSapSizingRecommendationResult() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.Serialization.cs new file mode 100644 index 000000000000..22477a6d0324 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownSingleServerCustomResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SingleServerCustomResourceNames)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SingleServerCustomResourceNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SingleServerCustomResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSingleServerCustomResourceNames(document.RootElement, options); + } + + internal static UnknownSingleServerCustomResourceNames DeserializeUnknownSingleServerCustomResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NamingPatternType namingPatternType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("namingPatternType"u8)) + { + namingPatternType = new NamingPatternType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownSingleServerCustomResourceNames(namingPatternType, serializedAdditionalRawData); + } + + BinaryData 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(SingleServerCustomResourceNames)} does not support writing '{options.Format}' format."); + } + } + + SingleServerCustomResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSingleServerCustomResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SingleServerCustomResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.cs new file mode 100644 index 000000000000..ca9167a891c3 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSingleServerCustomResourceNames.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of SingleServerCustomResourceNames. + internal partial class UnknownSingleServerCustomResourceNames : SingleServerCustomResourceNames + { + /// Initializes a new instance of . + /// The naming pattern type. + /// Keeps track of any properties unknown to the library. + internal UnknownSingleServerCustomResourceNames(NamingPatternType namingPatternType, IDictionary serializedAdditionalRawData) : base(namingPatternType, serializedAdditionalRawData) + { + NamingPatternType = namingPatternType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownSingleServerCustomResourceNames() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.Serialization.cs new file mode 100644 index 000000000000..16070b96acfe --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownSoftwareConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SoftwareConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + SoftwareConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SoftwareConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSoftwareConfiguration(document.RootElement, options); + } + + internal static UnknownSoftwareConfiguration DeserializeUnknownSoftwareConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapSoftwareInstallationType softwareInstallationType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("softwareInstallationType"u8)) + { + softwareInstallationType = new SapSoftwareInstallationType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownSoftwareConfiguration(softwareInstallationType, serializedAdditionalRawData); + } + + BinaryData 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(SoftwareConfiguration)} does not support writing '{options.Format}' format."); + } + } + + SoftwareConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSoftwareConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SoftwareConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.cs new file mode 100644 index 000000000000..469cfda732f1 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownSoftwareConfiguration.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of SoftwareConfiguration. + internal partial class UnknownSoftwareConfiguration : SoftwareConfiguration + { + /// Initializes a new instance of . + /// The SAP software installation type. + /// Keeps track of any properties unknown to the library. + internal UnknownSoftwareConfiguration(SapSoftwareInstallationType softwareInstallationType, IDictionary serializedAdditionalRawData) : base(softwareInstallationType, serializedAdditionalRawData) + { + SoftwareInstallationType = softwareInstallationType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownSoftwareConfiguration() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.Serialization.cs new file mode 100644 index 000000000000..b1c34a687545 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + internal partial class UnknownThreeTierCustomResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(ThreeTierCustomResourceNames)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + ThreeTierCustomResourceNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(ThreeTierCustomResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeThreeTierCustomResourceNames(document.RootElement, options); + } + + internal static UnknownThreeTierCustomResourceNames DeserializeUnknownThreeTierCustomResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + NamingPatternType namingPatternType = "Unknown"; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("namingPatternType"u8)) + { + namingPatternType = new NamingPatternType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UnknownThreeTierCustomResourceNames(namingPatternType, serializedAdditionalRawData); + } + + BinaryData 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(ThreeTierCustomResourceNames)} does not support writing '{options.Format}' format."); + } + } + + ThreeTierCustomResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeThreeTierCustomResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(ThreeTierCustomResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.cs new file mode 100644 index 000000000000..35ac6ef0a5f0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UnknownThreeTierCustomResourceNames.cs @@ -0,0 +1,29 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Unknown version of ThreeTierCustomResourceNames. + internal partial class UnknownThreeTierCustomResourceNames : ThreeTierCustomResourceNames + { + /// Initializes a new instance of . + /// The pattern type to be used for resource naming. + /// Keeps track of any properties unknown to the library. + internal UnknownThreeTierCustomResourceNames(NamingPatternType namingPatternType, IDictionary serializedAdditionalRawData) : base(namingPatternType, serializedAdditionalRawData) + { + NamingPatternType = namingPatternType; + } + + /// Initializes a new instance of for deserialization. + internal UnknownThreeTierCustomResourceNames() + { + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.Serialization.cs new file mode 100644 index 000000000000..6bfe5e1690a0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.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.SapVirtualInstances.Models +{ + internal partial class UpdateSapVirtualInstanceProperties : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(UpdateSapVirtualInstanceProperties)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(ManagedResourcesNetworkAccessType)) + { + writer.WritePropertyName("managedResourcesNetworkAccessType"u8); + writer.WriteStringValue(ManagedResourcesNetworkAccessType.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 + } + } + } + + UpdateSapVirtualInstanceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(UpdateSapVirtualInstanceProperties)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeUpdateSapVirtualInstanceProperties(document.RootElement, options); + } + + internal static UpdateSapVirtualInstanceProperties DeserializeUpdateSapVirtualInstanceProperties(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ManagedResourcesNetworkAccessType? managedResourcesNetworkAccessType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("managedResourcesNetworkAccessType"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + managedResourcesNetworkAccessType = new ManagedResourcesNetworkAccessType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new UpdateSapVirtualInstanceProperties(managedResourcesNetworkAccessType, serializedAdditionalRawData); + } + + BinaryData 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(UpdateSapVirtualInstanceProperties)} does not support writing '{options.Format}' format."); + } + } + + UpdateSapVirtualInstanceProperties IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeUpdateSapVirtualInstanceProperties(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(UpdateSapVirtualInstanceProperties)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.cs new file mode 100644 index 000000000000..5a311122d9de --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/UpdateSapVirtualInstanceProperties.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.SapVirtualInstances.Models +{ + /// Defines the update request body properties for updating Virtual Instance for SAP. + internal partial class UpdateSapVirtualInstanceProperties + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 UpdateSapVirtualInstanceProperties() + { + } + + /// Initializes a new instance of . + /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the managed resource group storage account. This setting is currently applicable only to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + /// Keeps track of any properties unknown to the library. + internal UpdateSapVirtualInstanceProperties(ManagedResourcesNetworkAccessType? managedResourcesNetworkAccessType, IDictionary serializedAdditionalRawData) + { + ManagedResourcesNetworkAccessType = managedResourcesNetworkAccessType; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Specifies the network access configuration for the resources that will be deployed in the Managed Resource Group. The options to choose from are Public and Private. If 'Private' is chosen, the Storage Account service tag should be enabled on the subnets in which the SAP VMs exist. This is required for establishing connectivity between VM extensions and the managed resource group storage account. This setting is currently applicable only to Storage Account. Learn more here https://go.microsoft.com/fwlink/?linkid=2247228. + public ManagedResourcesNetworkAccessType? ManagedResourcesNetworkAccessType { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.Serialization.cs new file mode 100644 index 000000000000..7b2554bf1403 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.Serialization.cs @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class VirtualMachineConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(VirtualMachineConfiguration)} does not support writing '{format}' format."); + } + + writer.WritePropertyName("vmSize"u8); + writer.WriteStringValue(VmSize); + writer.WritePropertyName("imageReference"u8); + writer.WriteObjectValue(ImageReference, options); + writer.WritePropertyName("osProfile"u8); + writer.WriteObjectValue(OSProfile, 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 + } + } + } + + VirtualMachineConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VirtualMachineConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVirtualMachineConfiguration(document.RootElement, options); + } + + internal static VirtualMachineConfiguration DeserializeVirtualMachineConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string vmSize = default; + ImageReference imageReference = default; + OSProfile osProfile = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmSize"u8)) + { + vmSize = property.Value.GetString(); + continue; + } + if (property.NameEquals("imageReference"u8)) + { + imageReference = ImageReference.DeserializeImageReference(property.Value, options); + continue; + } + if (property.NameEquals("osProfile"u8)) + { + osProfile = OSProfile.DeserializeOSProfile(property.Value, options); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VirtualMachineConfiguration(vmSize, imageReference, osProfile, serializedAdditionalRawData); + } + + BinaryData 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(VirtualMachineConfiguration)} does not support writing '{options.Format}' format."); + } + } + + VirtualMachineConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVirtualMachineConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VirtualMachineConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.cs new file mode 100644 index 000000000000..7292e4ec577f --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineConfiguration.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.SapVirtualInstances.Models +{ + /// Defines the virtual machine configuration. + public partial class VirtualMachineConfiguration + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 virtual machine size. + /// The image reference. + /// The OS profile. + /// , or is null. + public VirtualMachineConfiguration(string vmSize, ImageReference imageReference, OSProfile osProfile) + { + Argument.AssertNotNull(vmSize, nameof(vmSize)); + Argument.AssertNotNull(imageReference, nameof(imageReference)); + Argument.AssertNotNull(osProfile, nameof(osProfile)); + + VmSize = vmSize; + ImageReference = imageReference; + OSProfile = osProfile; + } + + /// Initializes a new instance of . + /// The virtual machine size. + /// The image reference. + /// The OS profile. + /// Keeps track of any properties unknown to the library. + internal VirtualMachineConfiguration(string vmSize, ImageReference imageReference, OSProfile osProfile, IDictionary serializedAdditionalRawData) + { + VmSize = vmSize; + ImageReference = imageReference; + OSProfile = osProfile; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal VirtualMachineConfiguration() + { + } + + /// The virtual machine size. + public string VmSize { get; set; } + /// The image reference. + public ImageReference ImageReference { get; set; } + /// The OS profile. + public OSProfile OSProfile { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.Serialization.cs new file mode 100644 index 000000000000..7b9bf7a0a2b2 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.Serialization.cs @@ -0,0 +1,230 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// 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.SapVirtualInstances.Models +{ + public partial class VirtualMachineResourceNames : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(VirtualMachineResourceNames)} does not support writing '{format}' format."); + } + + if (Optional.IsDefined(VmName)) + { + writer.WritePropertyName("vmName"u8); + writer.WriteStringValue(VmName); + } + if (Optional.IsDefined(HostName)) + { + writer.WritePropertyName("hostName"u8); + writer.WriteStringValue(HostName); + } + if (Optional.IsCollectionDefined(NetworkInterfaces)) + { + writer.WritePropertyName("networkInterfaces"u8); + writer.WriteStartArray(); + foreach (var item in NetworkInterfaces) + { + writer.WriteObjectValue(item, options); + } + writer.WriteEndArray(); + } + if (Optional.IsDefined(OSDiskName)) + { + writer.WritePropertyName("osDiskName"u8); + writer.WriteStringValue(OSDiskName); + } + if (Optional.IsCollectionDefined(DataDiskNames)) + { + writer.WritePropertyName("dataDiskNames"u8); + writer.WriteStartObject(); + foreach (var item in DataDiskNames) + { + writer.WritePropertyName(item.Key); + if (item.Value == null) + { + writer.WriteNullValue(); + continue; + } + writer.WriteStartArray(); + foreach (var item0 in item.Value) + { + writer.WriteStringValue(item0); + } + writer.WriteEndArray(); + } + 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 + } + } + } + + VirtualMachineResourceNames IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(VirtualMachineResourceNames)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeVirtualMachineResourceNames(document.RootElement, options); + } + + internal static VirtualMachineResourceNames DeserializeVirtualMachineResourceNames(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string vmName = default; + string hostName = default; + IList networkInterfaces = default; + string osDiskName = default; + IDictionary> dataDiskNames = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("vmName"u8)) + { + vmName = property.Value.GetString(); + continue; + } + if (property.NameEquals("hostName"u8)) + { + hostName = property.Value.GetString(); + continue; + } + if (property.NameEquals("networkInterfaces"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(NetworkInterfaceResourceNames.DeserializeNetworkInterfaceResourceNames(item, options)); + } + networkInterfaces = array; + continue; + } + if (property.NameEquals("osDiskName"u8)) + { + osDiskName = property.Value.GetString(); + continue; + } + if (property.NameEquals("dataDiskNames"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary> dictionary = new Dictionary>(); + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + dictionary.Add(property0.Name, null); + } + else + { + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(item.GetString()); + } + dictionary.Add(property0.Name, array); + } + } + dataDiskNames = dictionary; + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new VirtualMachineResourceNames( + vmName, + hostName, + networkInterfaces ?? new ChangeTrackingList(), + osDiskName, + dataDiskNames ?? 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(VirtualMachineResourceNames)} does not support writing '{options.Format}' format."); + } + } + + VirtualMachineResourceNames IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeVirtualMachineResourceNames(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(VirtualMachineResourceNames)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.cs new file mode 100644 index 000000000000..f1e4d4439a2a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/VirtualMachineResourceNames.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.SapVirtualInstances.Models +{ + /// The resource names object for virtual machine and related resources. + public partial class VirtualMachineResourceNames + { + /// + /// Keeps track of any properties unknown to the library. + /// + /// To assign an object to the value of this property use . + /// + /// + /// To assign an already formatted json string to this property use . + /// + /// + /// Examples: + /// + /// + /// BinaryData.FromObjectAsJson("foo") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromString("\"foo\"") + /// Creates a payload of "foo". + /// + /// + /// BinaryData.FromObjectAsJson(new { key = "value" }) + /// 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 VirtualMachineResourceNames() + { + NetworkInterfaces = new ChangeTrackingList(); + DataDiskNames = new ChangeTrackingDictionary>(); + } + + /// Initializes a new instance of . + /// The full name for virtual machine. The length of this field can be upto 64 characters. If name is not provided, service uses a default name based on the deployment type. For SingleServer, default name is {SID}vm. In case of HA-AvZone systems, default name will be {SID}{app/ascs/db}z{a/b}vm with an incrementor at the end in case of more than 1 vm per layer. For distributed and HA-AvSet systems, default name will be {SID}{app/ascs/db}vm with an incrementor at the end in case of more than 1 vm per layer. + /// The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are less than or equal to 13 characters long. If this value is not provided, vmName will be used as host name. + /// The list of network interface name objects for the selected virtual machine. Currently, only one network interface is supported per virtual machine. + /// The full name for OS disk attached to the VM. If this value is not provided, it will be named by ARM as per its default naming standards (prefixed with vm name). There is only one OS disk attached per Virtual Machine. + /// The full resource names for virtual machine data disks. This is a dictionary containing list of names of data disks per volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. For application and cs layers, only 'default' volume is supported. + /// Keeps track of any properties unknown to the library. + internal VirtualMachineResourceNames(string vmName, string hostName, IList networkInterfaces, string osDiskName, IDictionary> dataDiskNames, IDictionary serializedAdditionalRawData) + { + VmName = vmName; + HostName = hostName; + NetworkInterfaces = networkInterfaces; + OSDiskName = osDiskName; + DataDiskNames = dataDiskNames; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// The full name for virtual machine. The length of this field can be upto 64 characters. If name is not provided, service uses a default name based on the deployment type. For SingleServer, default name is {SID}vm. In case of HA-AvZone systems, default name will be {SID}{app/ascs/db}z{a/b}vm with an incrementor at the end in case of more than 1 vm per layer. For distributed and HA-AvSet systems, default name will be {SID}{app/ascs/db}vm with an incrementor at the end in case of more than 1 vm per layer. + public string VmName { get; set; } + /// The full name for virtual-machine's host (computer name). Currently, ACSS only supports host names which are less than or equal to 13 characters long. If this value is not provided, vmName will be used as host name. + public string HostName { get; set; } + /// The list of network interface name objects for the selected virtual machine. Currently, only one network interface is supported per virtual machine. + public IList NetworkInterfaces { get; } + /// The full name for OS disk attached to the VM. If this value is not provided, it will be named by ARM as per its default naming standards (prefixed with vm name). There is only one OS disk attached per Virtual Machine. + public string OSDiskName { get; set; } + /// The full resource names for virtual machine data disks. This is a dictionary containing list of names of data disks per volume. Currently supported volumes for database layer are ['hana/data', 'hana/log', hana/shared', 'usr/sap', 'os', 'backup']. For application and cs layers, only 'default' volume is supported. + public IDictionary> DataDiskNames { get; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.Serialization.cs new file mode 100644 index 000000000000..9561d76734d4 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.Serialization.cs @@ -0,0 +1,110 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + public partial class WindowsConfiguration : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(WindowsConfiguration)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + } + + WindowsConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(WindowsConfiguration)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeWindowsConfiguration(document.RootElement, options); + } + + internal static WindowsConfiguration DeserializeWindowsConfiguration(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + OSType osType = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("osType"u8)) + { + osType = new OSType(property.Value.GetString()); + continue; + } + if (options.Format != "W") + { + rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText())); + } + } + serializedAdditionalRawData = rawDataDictionary; + return new WindowsConfiguration(osType, serializedAdditionalRawData); + } + + BinaryData 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(WindowsConfiguration)} does not support writing '{options.Format}' format."); + } + } + + WindowsConfiguration IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeWindowsConfiguration(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(WindowsConfiguration)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.cs new file mode 100644 index 000000000000..55729d7198eb --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/Models/WindowsConfiguration.cs @@ -0,0 +1,30 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; + +namespace Azure.ResourceManager.SapVirtualInstances.Models +{ + /// Specifies Windows operating system settings on the virtual machine. + public partial class WindowsConfiguration : OSConfiguration + { + /// Initializes a new instance of . + public WindowsConfiguration() + { + OSType = OSType.Windows; + } + + /// Initializes a new instance of . + /// The OS Type. + /// Keeps track of any properties unknown to the library. + internal WindowsConfiguration(OSType osType, IDictionary serializedAdditionalRawData) : base(osType, serializedAdditionalRawData) + { + OSType = osType; + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/ProviderConstants.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/ProviderConstants.cs new file mode 100644 index 000000000000..c33e111ebe5c --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/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.SapVirtualInstances +{ + internal static class ProviderConstants + { + public static string DefaultProviderNamespace { get; } = ClientDiagnostics.GetResourceProviderNamespace(typeof(ProviderConstants).Assembly); + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapApplicationServerInstancesRestOperations.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapApplicationServerInstancesRestOperations.cs new file mode 100644 index 000000000000..20334b33da48 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapApplicationServerInstancesRestOperations.cs @@ -0,0 +1,827 @@ +// 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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal partial class SapApplicationServerInstancesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SapApplicationServerInstancesRestOperations. + /// 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 SapApplicationServerInstancesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// 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 sapVirtualInstanceName, string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapApplicationServerInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapApplicationServerInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// 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 sapVirtualInstanceName, string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapApplicationServerInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapApplicationServerInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstanceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstanceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, 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; + } + + /// Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// 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 Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// The SAP Application Server Instance resource request body. + /// 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 sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, 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); + } + } + + /// Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// 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 Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// The SAP Application Server Instance resource request body. + /// 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 sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, 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 sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstancePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstancePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, 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; + } + + /// Puts the SAP Application Server Instance resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// The SAP Application Server Instance resource request body. + /// 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 sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapApplicationServerInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Puts the SAP Application Server Instance resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// The SAP Application Server Instance resource request body. + /// 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 sapVirtualInstanceName, string applicationInstanceName, SapApplicationServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapApplicationServerInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service only. Delete by end user will return a Bad Request error. + /// 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 Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// 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 sapVirtualInstanceName, string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service only. Delete by end user will return a Bad Request error. + /// 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 Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// 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 sapVirtualInstanceName, string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPApplicationServerInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SAPApplicationServerInstanceListResult.DeserializeSAPApplicationServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPApplicationServerInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SAPApplicationServerInstanceListResult.DeserializeSAPApplicationServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StartContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StartContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Starts the SAP Application Server Instance. + /// 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 Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// SAP Application server instance start request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StartAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Starts the SAP Application Server Instance. + /// 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 Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// SAP Application server instance start request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Start(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStopRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StopContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StopContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/applicationInstances/", false); + uri.AppendPath(applicationInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Stops the SAP Application Server Instance. + /// 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 Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// SAP Application server instance stop request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StopAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Stops the SAP Application Server Instance. + /// 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 Virtual Instances for SAP solutions resource. + /// The name of SAP Application Server instance resource. + /// SAP Application server instance stop request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Stop(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, applicationInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + /// 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 Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPApplicationServerInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SAPApplicationServerInstanceListResult.DeserializeSAPApplicationServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + /// 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 Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPApplicationServerInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SAPApplicationServerInstanceListResult.DeserializeSAPApplicationServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapCentralServerInstancesRestOperations.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapCentralServerInstancesRestOperations.cs new file mode 100644 index 000000000000..bb6d957e0fde --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapCentralServerInstancesRestOperations.cs @@ -0,0 +1,827 @@ +// 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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal partial class SapCentralServerInstancesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SapCentralServerInstancesRestOperations. + /// 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 SapCentralServerInstancesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the SAP Central Services Instance resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// 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 sapVirtualInstanceName, string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapCentralServerInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapCentralServerInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the SAP Central Services Instance resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// 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 sapVirtualInstanceName, string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapCentralServerInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapCentralServerInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstanceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstanceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. + /// 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 Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The SAP Central Services Instance request body. + /// 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 sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. + /// 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 Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The SAP Central Services Instance request body. + /// 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 sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, 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 sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstancePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstancePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The SAP Central Services Instance resource request body. + /// 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 sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapCentralServerInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The SAP Central Services Instance resource request body. + /// 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 sapVirtualInstanceName, string centralInstanceName, SapCentralServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapCentralServerInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. + /// 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 Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// 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 sapVirtualInstanceName, string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. + /// 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 Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// 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 sapVirtualInstanceName, string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPCentralServerInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SAPCentralServerInstanceListResult.DeserializeSAPCentralServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPCentralServerInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SAPCentralServerInstanceListResult.DeserializeSAPCentralServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StartContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StartContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Starts the SAP Central Services Instance. + /// 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 Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// SAP Central Services instance start request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StartAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Starts the SAP Central Services Instance. + /// 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 Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// SAP Central Services instance start request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Start(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStopRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StopContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StopContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/centralInstances/", false); + uri.AppendPath(centralInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Stops the SAP Central Services Instance. + /// 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 Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// SAP Central Services instance stop request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StopAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Stops the SAP Central Services Instance. + /// 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 Virtual Instances for SAP solutions resource. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// SAP Central Services instance stop request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Stop(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, centralInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + /// 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 Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPCentralServerInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SAPCentralServerInstanceListResult.DeserializeSAPCentralServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + /// 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 Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPCentralServerInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SAPCentralServerInstanceListResult.DeserializeSAPCentralServerInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapDatabaseInstancesRestOperations.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapDatabaseInstancesRestOperations.cs new file mode 100644 index 000000000000..d0049a10de25 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapDatabaseInstancesRestOperations.cs @@ -0,0 +1,827 @@ +// 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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal partial class SapDatabaseInstancesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SapDatabaseInstancesRestOperations. + /// 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 SapDatabaseInstancesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets the SAP Database Instance resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// 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 sapVirtualInstanceName, string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapDatabaseInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapDatabaseInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the SAP Database Instance resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// 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 sapVirtualInstanceName, string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapDatabaseInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapDatabaseInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstanceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstanceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// 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 Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Request body of Database resource of a SAP system. + /// 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 sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// 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 Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Request body of Database resource of a SAP system. + /// 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 sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, 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 sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstancePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstancePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates the Database resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Database resource update request body. + /// 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 sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapDatabaseInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates the Database resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Database resource update request body. + /// 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 sapVirtualInstanceName, string databaseInstanceName, SapDatabaseInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapDatabaseInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateDeleteRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + /// 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 Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// 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 sapVirtualInstanceName, string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + /// 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 Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// 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 sapVirtualInstanceName, string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPDatabaseInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SAPDatabaseInstanceListResult.DeserializeSAPDatabaseInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPDatabaseInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SAPDatabaseInstanceListResult.DeserializeSAPDatabaseInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StartContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StartContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Starts the database instance of the SAP system. + /// 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 Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// SAP Database server instance start request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StartAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Starts the database instance of the SAP system. + /// 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 Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// SAP Database server instance start request body. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Start(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStopRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StopContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StopContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/databaseInstances/", false); + uri.AppendPath(databaseInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Stops the database instance of the SAP system. + /// 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 Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Stop request for the database instance of the SAP system. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task StopAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Stops the database instance of the SAP system. + /// 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 Virtual Instances for SAP solutions resource. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Stop request for the database instance of the SAP system. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response Stop(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, databaseInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListNextPageRequestUri(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + /// 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 Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPDatabaseInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SAPDatabaseInstanceListResult.DeserializeSAPDatabaseInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + /// 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 Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPDatabaseInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SAPDatabaseInstanceListResult.DeserializeSAPDatabaseInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapVirtualInstancesRestOperations.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapVirtualInstancesRestOperations.cs new file mode 100644 index 000000000000..7de7877e90aa --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/RestOperations/SapVirtualInstancesRestOperations.cs @@ -0,0 +1,1281 @@ +// 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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + internal partial class SapVirtualInstancesRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of SapVirtualInstancesRestOperations. + /// 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 SapVirtualInstancesRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2024-09-01"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal RequestUriBuilder CreateGetRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets a Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// 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 sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapVirtualInstanceData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SapVirtualInstanceData.DeserializeSapVirtualInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapVirtualInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets a Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// 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 sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapVirtualInstanceData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SapVirtualInstanceData.DeserializeSapVirtualInstanceData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((SapVirtualInstanceData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateCreateRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, SapVirtualInstanceData data) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateCreateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, SapVirtualInstanceData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a Virtual Instance for SAP solutions (VIS) resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Virtual Instance for SAP solutions resource request body. + /// 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 sapVirtualInstanceName, SapVirtualInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a Virtual Instance for SAP solutions (VIS) resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Virtual Instance for SAP solutions resource request body. + /// 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 sapVirtualInstanceName, SapVirtualInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, 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 sapVirtualInstanceName, SapVirtualInstancePatch patch) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, SapVirtualInstancePatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch, ModelSerializationExtensions.WireOptions); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates a Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Request body to update a Virtual Instance for SAP solutions resource. + /// 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 sapVirtualInstanceName, SapVirtualInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates a Virtual Instance for SAP solutions resource. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the resource group. The name is case insensitive. + /// The name of the Virtual Instances for SAP solutions resource. + /// Request body to update a Virtual Instance for SAP solutions resource. + /// 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 sapVirtualInstanceName, SapVirtualInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, 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 sapVirtualInstanceName) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central Services Instance, Application Server Instances and Database Instance. + /// 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 Virtual Instances for SAP solutions resource. + /// 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 sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central Services Instance, Application Server Instances and Database Instance. + /// 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 Virtual Instances for SAP solutions resource. + /// 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 sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName); + _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/Microsoft.Workloads/sapVirtualInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all Virtual Instances for SAP solutions resources in a 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: + { + SAPVirtualInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all Virtual Instances for SAP solutions resources in a 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: + { + SAPVirtualInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionRequestUri(string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateListBySubscriptionRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPVirtualInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscription(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPVirtualInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStartRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StartContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStartRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StartContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/start", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Starts the SAP application, that is the Central Services instance and Application server instances. + /// 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 Virtual Instances for SAP solutions resource. + /// The Virtual Instance for SAP solutions resource start request body. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task StartAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Starts the SAP application, that is the Central Services instance and Application server instances. + /// 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 Virtual Instances for SAP solutions resource. + /// The Virtual Instance for SAP solutions resource start request body. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Start(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StartContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateStartRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateStopRequestUri(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StopContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateStopRequest(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StopContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.Workloads/sapVirtualInstances/", false); + uri.AppendPath(sapVirtualInstanceName, true); + uri.AppendPath("/stop", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + if (content != null) + { + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + } + _userAgent.Apply(message); + return message; + } + + /// Stops the SAP Application, that is the Application server instances and Central Services instance. + /// 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 Virtual Instances for SAP solutions resource. + /// The Virtual Instance for SAP solutions resource stop request body. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task StopAsync(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Stops the SAP Application, that is the Application server instances and Central Services instance. + /// 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 Virtual Instances for SAP solutions resource. + /// The Virtual Instance for SAP solutions resource stop request body. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Stop(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, StopContent content = null, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var message = CreateStopRequest(subscriptionId, resourceGroupName, sapVirtualInstanceName, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 200: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetSizingRecommendationsRequestUri(string subscriptionId, AzureLocation location, SapSizingRecommendationContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getSizingRecommendations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetSizingRecommendationsRequest(string subscriptionId, AzureLocation location, SapSizingRecommendationContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getSizingRecommendations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Gets the sizing recommendations. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// 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> GetSizingRecommendationsAsync(string subscriptionId, AzureLocation location, SapSizingRecommendationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetSizingRecommendationsRequest(subscriptionId, location, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapSizingRecommendationResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SapSizingRecommendationResult.DeserializeSapSizingRecommendationResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets the sizing recommendations. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// 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 GetSizingRecommendations(string subscriptionId, AzureLocation location, SapSizingRecommendationContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetSizingRecommendationsRequest(subscriptionId, location, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapSizingRecommendationResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SapSizingRecommendationResult.DeserializeSapSizingRecommendationResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetSapSupportedSkuRequestUri(string subscriptionId, AzureLocation location, SapSupportedSkusContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getSapSupportedSku", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetSapSupportedSkuRequest(string subscriptionId, AzureLocation location, SapSupportedSkusContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getSapSupportedSku", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Get a list of SAP supported SKUs for ASCS, Application and Database tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// 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> GetSapSupportedSkuAsync(string subscriptionId, AzureLocation location, SapSupportedSkusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetSapSupportedSkuRequest(subscriptionId, location, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapSupportedResourceSkusResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SapSupportedResourceSkusResult.DeserializeSapSupportedResourceSkusResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get a list of SAP supported SKUs for ASCS, Application and Database tier. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// 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 GetSapSupportedSku(string subscriptionId, AzureLocation location, SapSupportedSkusContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetSapSupportedSkuRequest(subscriptionId, location, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapSupportedResourceSkusResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SapSupportedResourceSkusResult.DeserializeSapSupportedResourceSkusResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetDiskConfigurationsRequestUri(string subscriptionId, AzureLocation location, SapDiskConfigurationsContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getDiskConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetDiskConfigurationsRequest(string subscriptionId, AzureLocation location, SapDiskConfigurationsContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getDiskConfigurations", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Get the SAP Disk Configuration Layout prod/non-prod SAP System. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// 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> GetDiskConfigurationsAsync(string subscriptionId, AzureLocation location, SapDiskConfigurationsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetDiskConfigurationsRequest(subscriptionId, location, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapDiskConfigurationsResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SapDiskConfigurationsResult.DeserializeSapDiskConfigurationsResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the SAP Disk Configuration Layout prod/non-prod SAP System. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// 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 GetDiskConfigurations(string subscriptionId, AzureLocation location, SapDiskConfigurationsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetDiskConfigurationsRequest(subscriptionId, location, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapDiskConfigurationsResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SapDiskConfigurationsResult.DeserializeSapDiskConfigurationsResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateGetAvailabilityZoneDetailsRequestUri(string subscriptionId, AzureLocation location, SapAvailabilityZoneDetailsContent content) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + return uri; + } + + internal HttpMessage CreateGetAvailabilityZoneDetailsRequest(string subscriptionId, AzureLocation location, SapAvailabilityZoneDetailsContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.Workloads/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/sapVirtualInstanceMetadata/default/getAvailabilityZoneDetails", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content, ModelSerializationExtensions.WireOptions); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Get the recommended SAP Availability Zone Pair Details for your region. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// 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> GetAvailabilityZoneDetailsAsync(string subscriptionId, AzureLocation location, SapAvailabilityZoneDetailsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetAvailabilityZoneDetailsRequest(subscriptionId, location, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SapAvailabilityZoneDetailsResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SapAvailabilityZoneDetailsResult.DeserializeSapAvailabilityZoneDetailsResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Get the recommended SAP Availability Zone Pair Details for your region. + /// The ID of the target subscription. The value must be an UUID. + /// The name of the Azure region. + /// 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 GetAvailabilityZoneDetails(string subscriptionId, AzureLocation location, SapAvailabilityZoneDetailsContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateGetAvailabilityZoneDetailsRequest(subscriptionId, location, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SapAvailabilityZoneDetailsResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SapAvailabilityZoneDetailsResult.DeserializeSapAvailabilityZoneDetailsResult(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; + } + + /// Gets all Virtual Instances for SAP solutions resources in a 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: + { + SAPVirtualInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all Virtual Instances for SAP solutions resources in a 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: + { + SAPVirtualInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal RequestUriBuilder CreateListBySubscriptionNextPageRequestUri(string nextLink, string subscriptionId) + { + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + return uri; + } + + internal HttpMessage CreateListBySubscriptionNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListBySubscriptionNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + SAPVirtualInstanceListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions, cancellationToken).ConfigureAwait(false); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets all Virtual Instances for SAP solutions resources in a Subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. The value must be an UUID. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListBySubscriptionNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListBySubscriptionNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + SAPVirtualInstanceListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream, ModelSerializationExtensions.JsonDocumentOptions); + value = SAPVirtualInstanceListResult.DeserializeSAPVirtualInstanceListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceCollection.cs new file mode 100644 index 000000000000..ce15a8b6e1d0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceCollection.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.SapVirtualInstances +{ + /// + /// 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 GetSapApplicationServerInstances method from an instance of . + /// + public partial class SapApplicationServerInstanceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _sapApplicationServerInstanceClientDiagnostics; + private readonly SapApplicationServerInstancesRestOperations _sapApplicationServerInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected SapApplicationServerInstanceCollection() + { + } + + /// 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 SapApplicationServerInstanceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapApplicationServerInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", SapApplicationServerInstanceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SapApplicationServerInstanceResource.ResourceType, out string sapApplicationServerInstanceApiVersion); + _sapApplicationServerInstanceRestClient = new SapApplicationServerInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapApplicationServerInstanceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SapVirtualInstanceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SapVirtualInstanceResource.ResourceType), nameof(id)); + } + + /// + /// Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of SAP Application Server instance resource. + /// The SAP Application Server Instance resource request body. + /// 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 applicationInstanceName, SapApplicationServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, data, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new SapApplicationServerInstanceOperationSource(Client), _sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Puts the SAP Application Server Instance resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of SAP Application Server instance resource. + /// The SAP Application Server Instance resource request body. + /// 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 applicationInstanceName, SapApplicationServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, data, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new SapApplicationServerInstanceOperationSource(Client), _sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.Get"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.Get"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _sapApplicationServerInstanceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapApplicationServerInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapApplicationServerInstanceResource(Client, SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(e)), _sapApplicationServerInstanceClientDiagnostics, Pipeline, "SapApplicationServerInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the SAP Application Server Instance resources for a given Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _sapApplicationServerInstanceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapApplicationServerInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapApplicationServerInstanceResource(Client, SapApplicationServerInstanceData.DeserializeSapApplicationServerInstanceData(e)), _sapApplicationServerInstanceClientDiagnostics, Pipeline, "SapApplicationServerInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.Exists"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.Exists"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string applicationInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(applicationInstanceName, nameof(applicationInstanceName)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, applicationInstanceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapApplicationServerInstanceResource(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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.Serialization.cs new file mode 100644 index 000000000000..d542f27c894e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + public partial class SapApplicationServerInstanceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapApplicationServerInstanceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + SapApplicationServerInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapApplicationServerInstanceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapApplicationServerInstanceData(document.RootElement, options); + } + + internal static SapApplicationServerInstanceData DeserializeSapApplicationServerInstanceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapApplicationServerProperties 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 = SapApplicationServerProperties.DeserializeSapApplicationServerProperties(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 SapApplicationServerInstanceData( + 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(SapApplicationServerInstanceData)} does not support writing '{options.Format}' format."); + } + } + + SapApplicationServerInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapApplicationServerInstanceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapApplicationServerInstanceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.cs new file mode 100644 index 000000000000..cbf2c3802f58 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceData.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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A class representing the SapApplicationServerInstance data model. + /// Define the SAP Application Server Instance resource. + /// + public partial class SapApplicationServerInstanceData : 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 SapApplicationServerInstanceData(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 SapApplicationServerInstanceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SapApplicationServerProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapApplicationServerInstanceData() + { + } + + /// The resource-specific properties for this resource. + public SapApplicationServerProperties Properties { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.Serialization.cs new file mode 100644 index 000000000000..8949a7b78c7b --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.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.SapVirtualInstances +{ + public partial class SapApplicationServerInstanceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SapApplicationServerInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SapApplicationServerInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.cs new file mode 100644 index 000000000000..09a7cb6fbf68 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapApplicationServerInstanceResource.cs @@ -0,0 +1,871 @@ +// 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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A Class representing a SapApplicationServerInstance 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 GetSapApplicationServerInstanceResource method. + /// Otherwise you can get one from its parent resource using the GetSapApplicationServerInstance method. + /// + public partial class SapApplicationServerInstanceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The sapVirtualInstanceName. + /// The applicationInstanceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string applicationInstanceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _sapApplicationServerInstanceClientDiagnostics; + private readonly SapApplicationServerInstancesRestOperations _sapApplicationServerInstanceRestClient; + private readonly SapApplicationServerInstanceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Workloads/sapVirtualInstances/applicationInstances"; + + /// Initializes a new instance of the class for mocking. + protected SapApplicationServerInstanceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SapApplicationServerInstanceResource(ArmClient client, SapApplicationServerInstanceData 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 SapApplicationServerInstanceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapApplicationServerInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string sapApplicationServerInstanceApiVersion); + _sapApplicationServerInstanceRestClient = new SapApplicationServerInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapApplicationServerInstanceApiVersion); +#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 SapApplicationServerInstanceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Get"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.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 SapApplicationServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Get"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service only. Delete by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Delete"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(_sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the SAP Application Server Instance resource. <br><br>This operation will be used by service only. Delete by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Delete"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(_sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.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; + } + } + + /// + /// Puts the SAP Application Server Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The SAP Application Server Instance resource request body. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(SapApplicationServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Update"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Puts the SAP Application Server Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The SAP Application Server Instance resource request body. + /// The cancellation token to use. + /// is null. + public virtual Response Update(SapApplicationServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Update"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the SAP Application Server Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/start + /// + /// + /// Operation Id + /// SAPApplicationServerInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SAP Application server instance start request body. + /// The cancellation token to use. + public virtual async Task> StartAsync(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Start"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the SAP Application Server Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/start + /// + /// + /// Operation Id + /// SAPApplicationServerInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SAP Application server instance start request body. + /// The cancellation token to use. + public virtual ArmOperation Start(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Start"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the SAP Application Server Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/stop + /// + /// + /// Operation Id + /// SAPApplicationServerInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SAP Application server instance stop request body. + /// The cancellation token to use. + public virtual async Task> StopAsync(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Stop"); + scope.Start(); + try + { + var response = await _sapApplicationServerInstanceRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the SAP Application Server Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName}/stop + /// + /// + /// Operation Id + /// SAPApplicationServerInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SAP Application server instance stop request body. + /// The cancellation token to use. + public virtual ArmOperation Stop(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.Stop"); + scope.Start(); + try + { + var response = _sapApplicationServerInstanceRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapApplicationServerInstanceClientDiagnostics, Pipeline, _sapApplicationServerInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.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 _sapApplicationServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapApplicationServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.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 = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapApplicationServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.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 _sapApplicationServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapApplicationServerInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.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 = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapApplicationServerInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.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 _sapApplicationServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapApplicationServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapApplicationServerInstanceClientDiagnostics.CreateScope("SapApplicationServerInstanceResource.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 = _sapApplicationServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapApplicationServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapApplicationServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceCollection.cs new file mode 100644 index 000000000000..f4720665bca6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceCollection.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.SapVirtualInstances +{ + /// + /// 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 GetSapCentralServerInstances method from an instance of . + /// + public partial class SapCentralServerInstanceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _sapCentralServerInstanceClientDiagnostics; + private readonly SapCentralServerInstancesRestOperations _sapCentralServerInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected SapCentralServerInstanceCollection() + { + } + + /// 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 SapCentralServerInstanceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapCentralServerInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", SapCentralServerInstanceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SapCentralServerInstanceResource.ResourceType, out string sapCentralServerInstanceApiVersion); + _sapCentralServerInstanceRestClient = new SapCentralServerInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapCentralServerInstanceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SapVirtualInstanceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SapVirtualInstanceResource.ResourceType), nameof(id)); + } + + /// + /// Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The SAP Central Services Instance request body. + /// 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 centralInstanceName, SapCentralServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, data, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new SapCentralServerInstanceOperationSource(Client), _sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the SAP Central Services Instance resource. <br><br>This will be used by service only. PUT operation on this resource by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The SAP Central Services Instance request body. + /// 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 centralInstanceName, SapCentralServerInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, data, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new SapCentralServerInstanceOperationSource(Client), _sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Central Services Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.Get"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapCentralServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Central Services Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.Get"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapCentralServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances + /// + /// + /// Operation Id + /// SAPCentralServerInstance_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _sapCentralServerInstanceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapCentralServerInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapCentralServerInstanceResource(Client, SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(e)), _sapCentralServerInstanceClientDiagnostics, Pipeline, "SapCentralServerInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the SAP Central Services Instance resource for the given Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances + /// + /// + /// Operation Id + /// SAPCentralServerInstance_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _sapCentralServerInstanceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapCentralServerInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapCentralServerInstanceResource(Client, SapCentralServerInstanceData.DeserializeSapCentralServerInstanceData(e)), _sapCentralServerInstanceClientDiagnostics, Pipeline, "SapCentralServerInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.Exists"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.Exists"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapCentralServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string centralInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(centralInstanceName, nameof(centralInstanceName)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, centralInstanceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapCentralServerInstanceResource(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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.Serialization.cs new file mode 100644 index 000000000000..05a4d380f634 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + public partial class SapCentralServerInstanceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapCentralServerInstanceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + SapCentralServerInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapCentralServerInstanceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapCentralServerInstanceData(document.RootElement, options); + } + + internal static SapCentralServerInstanceData DeserializeSapCentralServerInstanceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapCentralServerProperties 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 = SapCentralServerProperties.DeserializeSapCentralServerProperties(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 SapCentralServerInstanceData( + 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(SapCentralServerInstanceData)} does not support writing '{options.Format}' format."); + } + } + + SapCentralServerInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapCentralServerInstanceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapCentralServerInstanceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.cs new file mode 100644 index 000000000000..e2b64daf7eee --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceData.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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A class representing the SapCentralServerInstance data model. + /// Define the SAP Central Services Instance resource. + /// + public partial class SapCentralServerInstanceData : 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 SapCentralServerInstanceData(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 SapCentralServerInstanceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SapCentralServerProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapCentralServerInstanceData() + { + } + + /// The resource-specific properties for this resource. + public SapCentralServerProperties Properties { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.Serialization.cs new file mode 100644 index 000000000000..b133bd8eceef --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.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.SapVirtualInstances +{ + public partial class SapCentralServerInstanceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SapCentralServerInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SapCentralServerInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.cs new file mode 100644 index 000000000000..80e3337f1da6 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapCentralServerInstanceResource.cs @@ -0,0 +1,871 @@ +// 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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A Class representing a SapCentralServerInstance 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 GetSapCentralServerInstanceResource method. + /// Otherwise you can get one from its parent resource using the GetSapCentralServerInstance method. + /// + public partial class SapCentralServerInstanceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The sapVirtualInstanceName. + /// The centralInstanceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string centralInstanceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _sapCentralServerInstanceClientDiagnostics; + private readonly SapCentralServerInstancesRestOperations _sapCentralServerInstanceRestClient; + private readonly SapCentralServerInstanceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Workloads/sapVirtualInstances/centralInstances"; + + /// Initializes a new instance of the class for mocking. + protected SapCentralServerInstanceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SapCentralServerInstanceResource(ArmClient client, SapCentralServerInstanceData 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 SapCentralServerInstanceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapCentralServerInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string sapCentralServerInstanceApiVersion); + _sapCentralServerInstanceRestClient = new SapCentralServerInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapCentralServerInstanceApiVersion); +#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 SapCentralServerInstanceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the SAP Central Services Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Get"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.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 SapCentralServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Central Services Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Get"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapCentralServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Delete"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(_sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the SAP Central Services Instance resource. <br><br>This will be used by service only. Delete operation on this resource by end user will return a Bad Request error. You can delete the parent resource, which is the Virtual Instance for SAP solutions resource, using the delete operation on it. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Delete"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(_sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.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; + } + } + + /// + /// Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The SAP Central Services Instance resource request body. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(SapCentralServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Update"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapCentralServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the SAP Central Services Instance resource. <br><br>This can be used to update tags on the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The SAP Central Services Instance resource request body. + /// The cancellation token to use. + /// is null. + public virtual Response Update(SapCentralServerInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Update"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + return Response.FromValue(new SapCentralServerInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the SAP Central Services Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/start + /// + /// + /// Operation Id + /// SAPCentralServerInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SAP Central Services instance start request body. + /// The cancellation token to use. + public virtual async Task> StartAsync(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Start"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the SAP Central Services Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/start + /// + /// + /// Operation Id + /// SAPCentralServerInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SAP Central Services instance start request body. + /// The cancellation token to use. + public virtual ArmOperation Start(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Start"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the SAP Central Services Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/stop + /// + /// + /// Operation Id + /// SAPCentralServerInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SAP Central Services instance stop request body. + /// The cancellation token to use. + public virtual async Task> StopAsync(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Stop"); + scope.Start(); + try + { + var response = await _sapCentralServerInstanceRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the SAP Central Services Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName}/stop + /// + /// + /// Operation Id + /// SAPCentralServerInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SAP Central Services instance stop request body. + /// The cancellation token to use. + public virtual ArmOperation Stop(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.Stop"); + scope.Start(); + try + { + var response = _sapCentralServerInstanceRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapCentralServerInstanceClientDiagnostics, Pipeline, _sapCentralServerInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.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 _sapCentralServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapCentralServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapCentralServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.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 = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapCentralServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapCentralServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.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 _sapCentralServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapCentralServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapCentralServerInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.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 = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapCentralServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapCentralServerInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.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 _sapCentralServerInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapCentralServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapCentralServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapCentralServerInstanceClientDiagnostics.CreateScope("SapCentralServerInstanceResource.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 = _sapCentralServerInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapCentralServerInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapCentralServerInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceCollection.cs new file mode 100644 index 000000000000..838f24961510 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceCollection.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.SapVirtualInstances +{ + /// + /// 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 GetSapDatabaseInstances method from an instance of . + /// + public partial class SapDatabaseInstanceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _sapDatabaseInstanceClientDiagnostics; + private readonly SapDatabaseInstancesRestOperations _sapDatabaseInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected SapDatabaseInstanceCollection() + { + } + + /// 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 SapDatabaseInstanceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapDatabaseInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", SapDatabaseInstanceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SapDatabaseInstanceResource.ResourceType, out string sapDatabaseInstanceApiVersion); + _sapDatabaseInstanceRestClient = new SapDatabaseInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapDatabaseInstanceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != SapVirtualInstanceResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, SapVirtualInstanceResource.ResourceType), nameof(id)); + } + + /// + /// Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Request body of Database resource of a SAP system. + /// 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 databaseInstanceName, SapDatabaseInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, data, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new SapDatabaseInstanceOperationSource(Client), _sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates the Database resource corresponding to the Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. PUT by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// Request body of Database resource of a SAP system. + /// 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 databaseInstanceName, SapDatabaseInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, data, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new SapDatabaseInstanceOperationSource(Client), _sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Database Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.Get"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapDatabaseInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Database Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.Get"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapDatabaseInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances + /// + /// + /// Operation Id + /// SAPDatabaseInstance_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _sapDatabaseInstanceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapDatabaseInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapDatabaseInstanceResource(Client, SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(e)), _sapDatabaseInstanceClientDiagnostics, Pipeline, "SapDatabaseInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Lists the Database resources associated with a Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances + /// + /// + /// Operation Id + /// SAPDatabaseInstance_List + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _sapDatabaseInstanceRestClient.CreateListRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapDatabaseInstanceRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapDatabaseInstanceResource(Client, SapDatabaseInstanceData.DeserializeSapDatabaseInstanceData(e)), _sapDatabaseInstanceClientDiagnostics, Pipeline, "SapDatabaseInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.Exists"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.Exists"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapDatabaseInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string databaseInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(databaseInstanceName, nameof(databaseInstanceName)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, databaseInstanceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapDatabaseInstanceResource(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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.Serialization.cs new file mode 100644 index 000000000000..aabec700b433 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + public partial class SapDatabaseInstanceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapDatabaseInstanceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + } + + SapDatabaseInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapDatabaseInstanceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapDatabaseInstanceData(document.RootElement, options); + } + + internal static SapDatabaseInstanceData DeserializeSapDatabaseInstanceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapDatabaseProperties 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 = SapDatabaseProperties.DeserializeSapDatabaseProperties(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 SapDatabaseInstanceData( + 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(SapDatabaseInstanceData)} does not support writing '{options.Format}' format."); + } + } + + SapDatabaseInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapDatabaseInstanceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapDatabaseInstanceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.cs new file mode 100644 index 000000000000..2a7a52a0a861 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceData.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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A class representing the SapDatabaseInstance data model. + /// Define the Database resource. + /// + public partial class SapDatabaseInstanceData : 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 SapDatabaseInstanceData(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 SapDatabaseInstanceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SapDatabaseProperties properties, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapDatabaseInstanceData() + { + } + + /// The resource-specific properties for this resource. + public SapDatabaseProperties Properties { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.Serialization.cs new file mode 100644 index 000000000000..7dea59643721 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.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.SapVirtualInstances +{ + public partial class SapDatabaseInstanceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SapDatabaseInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SapDatabaseInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.cs new file mode 100644 index 000000000000..7143c285d63a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapDatabaseInstanceResource.cs @@ -0,0 +1,871 @@ +// 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.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A Class representing a SapDatabaseInstance 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 GetSapDatabaseInstanceResource method. + /// Otherwise you can get one from its parent resource using the GetSapDatabaseInstance method. + /// + public partial class SapDatabaseInstanceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The sapVirtualInstanceName. + /// The databaseInstanceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName, string databaseInstanceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _sapDatabaseInstanceClientDiagnostics; + private readonly SapDatabaseInstancesRestOperations _sapDatabaseInstanceRestClient; + private readonly SapDatabaseInstanceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Workloads/sapVirtualInstances/databaseInstances"; + + /// Initializes a new instance of the class for mocking. + protected SapDatabaseInstanceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SapDatabaseInstanceResource(ArmClient client, SapDatabaseInstanceData 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 SapDatabaseInstanceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapDatabaseInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string sapDatabaseInstanceApiVersion); + _sapDatabaseInstanceRestClient = new SapDatabaseInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapDatabaseInstanceApiVersion); +#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 SapDatabaseInstanceData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets the SAP Database Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Get"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.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 SapDatabaseInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets the SAP Database Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Get"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapDatabaseInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Delete"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(_sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes the Database resource corresponding to a Virtual Instance for SAP solutions resource. <br><br>This will be used by service only. Delete by end user will return a Bad Request error. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Delete"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(_sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.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; + } + } + + /// + /// Updates the Database resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource update request body. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(SapDatabaseInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Update"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapDatabaseInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates the Database resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource update request body. + /// The cancellation token to use. + /// is null. + public virtual Response Update(SapDatabaseInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Update"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, patch, cancellationToken); + return Response.FromValue(new SapDatabaseInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the database instance of the SAP system. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/start + /// + /// + /// Operation Id + /// SAPDatabaseInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SAP Database server instance start request body. + /// The cancellation token to use. + public virtual async Task> StartAsync(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Start"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the database instance of the SAP system. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/start + /// + /// + /// Operation Id + /// SAPDatabaseInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// SAP Database server instance start request body. + /// The cancellation token to use. + public virtual ArmOperation Start(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Start"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the database instance of the SAP system. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/stop + /// + /// + /// Operation Id + /// SAPDatabaseInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Stop request for the database instance of the SAP system. + /// The cancellation token to use. + public virtual async Task> StopAsync(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Stop"); + scope.Start(); + try + { + var response = await _sapDatabaseInstanceRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the database instance of the SAP system. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName}/stop + /// + /// + /// Operation Id + /// SAPDatabaseInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Stop request for the database instance of the SAP system. + /// The cancellation token to use. + public virtual ArmOperation Stop(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.Stop"); + scope.Start(); + try + { + var response = _sapDatabaseInstanceRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapDatabaseInstanceClientDiagnostics, Pipeline, _sapDatabaseInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.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 _sapDatabaseInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapDatabaseInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapDatabaseInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.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 = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapDatabaseInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapDatabaseInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.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 _sapDatabaseInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapDatabaseInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapDatabaseInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.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 = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapDatabaseInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapDatabaseInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.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 _sapDatabaseInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapDatabaseInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapDatabaseInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapDatabaseInstanceClientDiagnostics.CreateScope("SapDatabaseInstanceResource.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 = _sapDatabaseInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + return Response.FromValue(new SapDatabaseInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapDatabaseInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(patch, cancellationToken: cancellationToken); + return result; + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceCollection.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceCollection.cs new file mode 100644 index 000000000000..5544653d0006 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceCollection.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.SapVirtualInstances +{ + /// + /// 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 GetSapVirtualInstances method from an instance of . + /// + public partial class SapVirtualInstanceCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _sapVirtualInstanceClientDiagnostics; + private readonly SapVirtualInstancesRestOperations _sapVirtualInstanceRestClient; + + /// Initializes a new instance of the class for mocking. + protected SapVirtualInstanceCollection() + { + } + + /// 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 SapVirtualInstanceCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapVirtualInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", SapVirtualInstanceResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(SapVirtualInstanceResource.ResourceType, out string sapVirtualInstanceApiVersion); + _sapVirtualInstanceRestClient = new SapVirtualInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapVirtualInstanceApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Creates a Virtual Instance for SAP solutions (VIS) resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Virtual Instances for SAP solutions resource. + /// Virtual Instance for SAP solutions resource request body. + /// 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 sapVirtualInstanceName, SapVirtualInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.CreateAsync(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, data, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new SapVirtualInstanceOperationSource(Client), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a Virtual Instance for SAP solutions (VIS) resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Create + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the Virtual Instances for SAP solutions resource. + /// Virtual Instance for SAP solutions resource request body. + /// 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 sapVirtualInstanceName, SapVirtualInstanceData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Create(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, data, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new SapVirtualInstanceOperationSource(Client), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateCreateRequest(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.Get"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapVirtualInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.Get"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapVirtualInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets all Virtual Instances for SAP solutions resources in a Resource Group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances + /// + /// + /// Operation Id + /// SAPVirtualInstance_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _sapVirtualInstanceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapVirtualInstanceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new SapVirtualInstanceResource(Client, SapVirtualInstanceData.DeserializeSapVirtualInstanceData(e)), _sapVirtualInstanceClientDiagnostics, Pipeline, "SapVirtualInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Gets all Virtual Instances for SAP solutions resources in a Resource Group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances + /// + /// + /// Operation Id + /// SAPVirtualInstance_ListByResourceGroup + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _sapVirtualInstanceRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _sapVirtualInstanceRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return GeneratorPageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new SapVirtualInstanceResource(Client, SapVirtualInstanceData.DeserializeSapVirtualInstanceData(e)), _sapVirtualInstanceClientDiagnostics, Pipeline, "SapVirtualInstanceCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.Exists"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.Exists"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetIfExistsAsync(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, cancellationToken: cancellationToken).ConfigureAwait(false); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapVirtualInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Tries to get details for this resource from the service. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of the Virtual Instances for SAP solutions resource. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual NullableResponse GetIfExists(string sapVirtualInstanceName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(sapVirtualInstanceName, nameof(sapVirtualInstanceName)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceCollection.GetIfExists"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, sapVirtualInstanceName, cancellationToken: cancellationToken); + if (response.Value == null) + return new NoValueResponse(response.GetRawResponse()); + return Response.FromValue(new SapVirtualInstanceResource(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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.Serialization.cs new file mode 100644 index 000000000000..8bceae591aef --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.Serialization.cs @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ClientModel.Primitives; +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + public partial class SapVirtualInstanceData : IUtf8JsonSerializable, IJsonModel + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); + + void IJsonModel.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(SapVirtualInstanceData)} does not support writing '{format}' format."); + } + + base.JsonModelWriteCore(writer, options); + if (Optional.IsDefined(Properties)) + { + writer.WritePropertyName("properties"u8); + writer.WriteObjectValue(Properties, options); + } + if (Optional.IsDefined(Identity)) + { + writer.WritePropertyName("identity"u8); + writer.WriteObjectValue(Identity, options); + } + } + + SapVirtualInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + if (format != "J") + { + throw new FormatException($"The model {nameof(SapVirtualInstanceData)} does not support reading '{format}' format."); + } + + using JsonDocument document = JsonDocument.ParseValue(ref reader); + return DeserializeSapVirtualInstanceData(document.RootElement, options); + } + + internal static SapVirtualInstanceData DeserializeSapVirtualInstanceData(JsonElement element, ModelReaderWriterOptions options = null) + { + options ??= ModelSerializationExtensions.WireOptions; + + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + SapVirtualInstanceProperties properties = default; + SAPVirtualInstanceIdentity identity = default; + IDictionary tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + SystemData systemData = default; + IDictionary serializedAdditionalRawData = default; + Dictionary rawDataDictionary = new Dictionary(); + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + properties = SapVirtualInstanceProperties.DeserializeSapVirtualInstanceProperties(property.Value, options); + continue; + } + if (property.NameEquals("identity"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + identity = SAPVirtualInstanceIdentity.DeserializeSAPVirtualInstanceIdentity(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 SapVirtualInstanceData( + id, + name, + type, + systemData, + tags ?? new ChangeTrackingDictionary(), + location, + properties, + identity, + serializedAdditionalRawData); + } + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + return ModelReaderWriter.Write(this, options); + default: + throw new FormatException($"The model {nameof(SapVirtualInstanceData)} does not support writing '{options.Format}' format."); + } + } + + SapVirtualInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) + { + var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; + + switch (format) + { + case "J": + { + using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions); + return DeserializeSapVirtualInstanceData(document.RootElement, options); + } + default: + throw new FormatException($"The model {nameof(SapVirtualInstanceData)} does not support reading '{options.Format}' format."); + } + } + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J"; + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.cs new file mode 100644 index 000000000000..23effb8e55dd --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceData.cs @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.Models; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A class representing the SapVirtualInstance data model. + /// Define the Virtual Instance for SAP solutions resource. + /// + public partial class SapVirtualInstanceData : 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 SapVirtualInstanceData(AzureLocation location) : base(location) + { + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The resource-specific properties for this resource. + /// The managed service identities assigned to this resource. + /// Keeps track of any properties unknown to the library. + internal SapVirtualInstanceData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, SapVirtualInstanceProperties properties, SAPVirtualInstanceIdentity identity, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location) + { + Properties = properties; + Identity = identity; + _serializedAdditionalRawData = serializedAdditionalRawData; + } + + /// Initializes a new instance of for deserialization. + internal SapVirtualInstanceData() + { + } + + /// The resource-specific properties for this resource. + public SapVirtualInstanceProperties Properties { get; set; } + /// The managed service identities assigned to this resource. + public SAPVirtualInstanceIdentity Identity { get; set; } + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.Serialization.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.Serialization.cs new file mode 100644 index 000000000000..bb21a27aa9a0 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.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.SapVirtualInstances +{ + public partial class SapVirtualInstanceResource : IJsonModel + { + void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) => ((IJsonModel)Data).Write(writer, options); + + SapVirtualInstanceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) => ((IJsonModel)Data).Create(ref reader, options); + + BinaryData IPersistableModel.Write(ModelReaderWriterOptions options) => ModelReaderWriter.Write(Data, options); + + SapVirtualInstanceData IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options) => ModelReaderWriter.Read(data, options); + + string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => ((IPersistableModel)Data).GetFormatFromOptions(options); + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.cs new file mode 100644 index 000000000000..7880898f8e6a --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Generated/SapVirtualInstanceResource.cs @@ -0,0 +1,1086 @@ +// 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.Resources; +using Azure.ResourceManager.SapVirtualInstances.Models; + +namespace Azure.ResourceManager.SapVirtualInstances +{ + /// + /// A Class representing a SapVirtualInstance 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 GetSapVirtualInstanceResource method. + /// Otherwise you can get one from its parent resource using the GetSapVirtualInstance method. + /// + public partial class SapVirtualInstanceResource : ArmResource + { + /// Generate the resource identifier of a instance. + /// The subscriptionId. + /// The resourceGroupName. + /// The sapVirtualInstanceName. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string sapVirtualInstanceName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _sapVirtualInstanceClientDiagnostics; + private readonly SapVirtualInstancesRestOperations _sapVirtualInstanceRestClient; + private readonly SapVirtualInstanceData _data; + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.Workloads/sapVirtualInstances"; + + /// Initializes a new instance of the class for mocking. + protected SapVirtualInstanceResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal SapVirtualInstanceResource(ArmClient client, SapVirtualInstanceData 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 SapVirtualInstanceResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _sapVirtualInstanceClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.SapVirtualInstances", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string sapVirtualInstanceApiVersion); + _sapVirtualInstanceRestClient = new SapVirtualInstancesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, sapVirtualInstanceApiVersion); +#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 SapVirtualInstanceData 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 SapCentralServerInstanceResources in the SapVirtualInstance. + /// An object representing collection of SapCentralServerInstanceResources and their operations over a SapCentralServerInstanceResource. + public virtual SapCentralServerInstanceCollection GetSapCentralServerInstances() + { + return GetCachedClient(client => new SapCentralServerInstanceCollection(client, Id)); + } + + /// + /// Gets the SAP Central Services Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSapCentralServerInstanceAsync(string centralInstanceName, CancellationToken cancellationToken = default) + { + return await GetSapCentralServerInstances().GetAsync(centralInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the SAP Central Services Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/centralInstances/{centralInstanceName} + /// + /// + /// Operation Id + /// SAPCentralServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Central Services Instance resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSapCentralServerInstance(string centralInstanceName, CancellationToken cancellationToken = default) + { + return GetSapCentralServerInstances().Get(centralInstanceName, cancellationToken); + } + + /// Gets a collection of SapDatabaseInstanceResources in the SapVirtualInstance. + /// An object representing collection of SapDatabaseInstanceResources and their operations over a SapDatabaseInstanceResource. + public virtual SapDatabaseInstanceCollection GetSapDatabaseInstances() + { + return GetCachedClient(client => new SapDatabaseInstanceCollection(client, Id)); + } + + /// + /// Gets the SAP Database Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSapDatabaseInstanceAsync(string databaseInstanceName, CancellationToken cancellationToken = default) + { + return await GetSapDatabaseInstances().GetAsync(databaseInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the SAP Database Instance resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/databaseInstances/{databaseInstanceName} + /// + /// + /// Operation Id + /// SAPDatabaseInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// Database resource name string modeled as parameter for auto generation to work correctly. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSapDatabaseInstance(string databaseInstanceName, CancellationToken cancellationToken = default) + { + return GetSapDatabaseInstances().Get(databaseInstanceName, cancellationToken); + } + + /// Gets a collection of SapApplicationServerInstanceResources in the SapVirtualInstance. + /// An object representing collection of SapApplicationServerInstanceResources and their operations over a SapApplicationServerInstanceResource. + public virtual SapApplicationServerInstanceCollection GetSapApplicationServerInstances() + { + return GetCachedClient(client => new SapApplicationServerInstanceCollection(client, Id)); + } + + /// + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual async Task> GetSapApplicationServerInstanceAsync(string applicationInstanceName, CancellationToken cancellationToken = default) + { + return await GetSapApplicationServerInstances().GetAsync(applicationInstanceName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets the SAP Application Server Instance corresponding to the Virtual Instance for SAP solutions resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/applicationInstances/{applicationInstanceName} + /// + /// + /// Operation Id + /// SAPApplicationServerInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The name of SAP Application Server instance resource. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + [ForwardsClientCalls] + public virtual Response GetSapApplicationServerInstance(string applicationInstanceName, CancellationToken cancellationToken = default) + { + return GetSapApplicationServerInstances().Get(applicationInstanceName, cancellationToken); + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Get"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapVirtualInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Get"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new SapVirtualInstanceResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central Services Instance, Application Server Instances and Database Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Delete"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(_sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a Virtual Instance for SAP solutions resource and its child resources, that is the associated Central Services Instance, Application Server Instances and Database Instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Delete + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Delete"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(_sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request body to update a Virtual Instance for SAP solutions resource. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, SapVirtualInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Update"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new SapVirtualInstanceOperationSource(Client), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.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; + } + } + + /// + /// Updates a Virtual Instance for SAP solutions resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Update + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// Request body to update a Virtual Instance for SAP solutions resource. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, SapVirtualInstancePatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Update"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new SapVirtualInstanceOperationSource(Client), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.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; + } + } + + /// + /// Starts the SAP application, that is the Central Services instance and Application server instances. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/start + /// + /// + /// Operation Id + /// SAPVirtualInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The Virtual Instance for SAP solutions resource start request body. + /// The cancellation token to use. + public virtual async Task> StartAsync(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Start"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.StartAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Starts the SAP application, that is the Central Services instance and Application server instances. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/start + /// + /// + /// Operation Id + /// SAPVirtualInstances_Start + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The Virtual Instance for SAP solutions resource start request body. + /// The cancellation token to use. + public virtual ArmOperation Start(WaitUntil waitUntil, StartContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Start"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Start(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateStartRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the SAP Application, that is the Application server instances and Central Services instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/stop + /// + /// + /// Operation Id + /// SAPVirtualInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The Virtual Instance for SAP solutions resource stop request body. + /// The cancellation token to use. + public virtual async Task> StopAsync(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Stop"); + scope.Start(); + try + { + var response = await _sapVirtualInstanceRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken).ConfigureAwait(false); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Stops the SAP Application, that is the Application server instances and Central Services instance. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName}/stop + /// + /// + /// Operation Id + /// SAPVirtualInstances_Stop + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The Virtual Instance for SAP solutions resource stop request body. + /// The cancellation token to use. + public virtual ArmOperation Stop(WaitUntil waitUntil, StopContent content = null, CancellationToken cancellationToken = default) + { + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.Stop"); + scope.Start(); + try + { + var response = _sapVirtualInstanceRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content, cancellationToken); + var operation = new SapVirtualInstancesArmOperation(new OperationStatusResultOperationSource(), _sapVirtualInstanceClientDiagnostics, Pipeline, _sapVirtualInstanceRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, content).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.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 _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapVirtualInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapVirtualInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.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 = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new SapVirtualInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapVirtualInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.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 _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapVirtualInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapVirtualInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.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 = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new SapVirtualInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapVirtualInstancePatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.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 _sapVirtualInstanceRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new SapVirtualInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new SapVirtualInstancePatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Workloads/sapVirtualInstances/{sapVirtualInstanceName} + /// + /// + /// Operation Id + /// SAPVirtualInstance_Get + /// + /// + /// Default Api Version + /// 2024-09-01 + /// + /// + /// Resource + /// + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _sapVirtualInstanceClientDiagnostics.CreateScope("SapVirtualInstanceResource.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 = _sapVirtualInstanceRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new SapVirtualInstanceResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new SapVirtualInstancePatch(); + 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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Properties/AssemblyInfo.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/src/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..bd4bf19bb2e8 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/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.SapVirtualInstances.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("SapVirtualInstances")] diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/Azure.ResourceManager.SapVirtualInstances.Tests.csproj b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/Azure.ResourceManager.SapVirtualInstances.Tests.csproj new file mode 100644 index 000000000000..7fdacf298294 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/Azure.ResourceManager.SapVirtualInstances.Tests.csproj @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestBase.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestBase.cs new file mode 100644 index 000000000000..9197b1df6841 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestBase.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.SapVirtualInstances.Tests +{ + public class SapVirtualInstancesManagementTestBase : ManagementRecordedTestBase + { + protected ArmClient Client { get; private set; } + protected SubscriptionResource DefaultSubscription { get; private set; } + + protected SapVirtualInstancesManagementTestBase(bool isAsync, RecordedTestMode mode) + : base(isAsync, mode) + { + } + + protected SapVirtualInstancesManagementTestBase(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/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestEnvironment.cs b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestEnvironment.cs new file mode 100644 index 000000000000..8ffa2df9862e --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tests/SapVirtualInstancesManagementTestEnvironment.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +using Azure.Core.TestFramework; + +namespace Azure.ResourceManager.SapVirtualInstances.Tests +{ + public class SapVirtualInstancesManagementTestEnvironment : TestEnvironment + { + } +} diff --git a/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tsp-location.yaml b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tsp-location.yaml new file mode 100644 index 000000000000..729d353a6f21 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/Azure.ResourceManager.SapVirtualInstances/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/workloads/Workloads.SAPVirtualInstance.Management +commit: b4cb90744f6ab64fffe81f29f699dfd750eb154b +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/workloadssapvirtualinstance/ci.mgmt.yml b/sdk/workloadssapvirtualinstance/ci.mgmt.yml new file mode 100644 index 000000000000..a90c11972d53 --- /dev/null +++ b/sdk/workloadssapvirtualinstance/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/workloadssapvirtualinstance /ci.mgmt.yml + - sdk/workloadssapvirtualinstance /Azure.ResourceManager.SapVirtualInstances / + + +extends: + template: /eng/pipelines/templates/stages/archetype-sdk-client.yml + parameters: + ServiceDirectory: workloadssapvirtualinstance + ArtifactName: packages + LimitForPullRequest: true + Artifacts: + - name: Azure.ResourceManager.SapVirtualInstances + safeName: AzureResourceManagerSapVirtualInstances